diff --git a/LICENSE b/LICENSE index 14bf200..96376c5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Gaetan Jonathan BAKARY +Copyright (c) 2022 iTeam-$ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/ampalibe/__init__.py b/ampalibe/__init__.py index 2e6775e..24fb7d1 100644 --- a/ampalibe/__init__.py +++ b/ampalibe/__init__.py @@ -1,5 +1,5 @@ from .server import run -from .server import req -from .requete import Request +from .server import req as Req +from .messenger import Messenger from .utils import action, commande -from .messenger import Messenger \ No newline at end of file +from .requete import Request as Model \ No newline at end of file diff --git a/ampalibe/server.py b/ampalibe/server.py index 816099e..5078541 100644 --- a/ampalibe/server.py +++ b/ampalibe/server.py @@ -26,7 +26,7 @@ def run(cnf): global _req conf = cnf _req = Model(cnf) - uvicorn.run(webserver) + uvicorn.run(webserver, port=cnf.APP_PORT, host=cnf.APP_HOST) @webserver.get('/') diff --git a/bin/ampalibe b/bin/ampalibe index 8f2a0d7..05a7907 100644 --- a/bin/ampalibe +++ b/bin/ampalibe @@ -1,3 +1,2 @@ #!/bin/bash -# script de creation sy config mety ty? \ No newline at end of file diff --git a/bin/ampalibe.exe b/bin/ampalibe.exe new file mode 100644 index 0000000..e69de29 diff --git a/setup.cfg b/setup.cfg index d91caca..f39c6c7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -11,6 +11,10 @@ project_urls = Bug Tracker = https://github.com/iTeam-S/ampalibe/issues classifiers = Programming Language :: Python :: 3 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 License :: OSI Approved :: MIT License Operating System :: OS Independent diff --git a/setup.py b/setup.py index 0c9ea3d..04f3702 100644 --- a/setup.py +++ b/setup.py @@ -13,10 +13,14 @@ packages=setuptools.find_packages(), # List of all modules to be installed classifiers=[ "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], # Information to filter the project on PyPi website - python_requires='>=3.6', + python_requires='>=3.7', py_modules=["ampalibe"], # Name of the python package install_requires=[ "fastapi", "uvicorn", "python-dotenv", "mysql-connector", "retry"], # depandance diff --git a/src/conf.py b/src/conf.py index 8e078e6..33c6c75 100644 --- a/src/conf.py +++ b/src/conf.py @@ -18,3 +18,6 @@ class Configuration: ACCESS_TOKEN = env.get('AMP_ACCESS_TOKEN') VERIF_TOKEN = env.get('AMP_VERIF_TOKEN') + + APP_HOST = env.get('AMP_HOST') + APP_PORT = int(env.get('AMP_PORT')) diff --git a/src/core.py b/src/core.py index fb74981..5d0992e 100644 --- a/src/core.py +++ b/src/core.py @@ -10,7 +10,7 @@ @param extends: contiennent la liste des autres données envoyé par facebook (heure d'envoi, ...) ''' -req = ampalibe.req(Configuration()) +req = ampalibe.Req(Configuration()) bot = ampalibe.Messenger(Configuration.ACCESS_TOKEN) diff --git a/src/example.env b/src/example.env index 85c5bff..27c1b8f 100644 --- a/src/example.env +++ b/src/example.env @@ -8,4 +8,8 @@ AMP_VERIF_TOKEN= DB_HOST= DB_USER= DB_PASSWORD= -DB_PORT=3306 \ No newline at end of file +DB_PORT=3306 + +### APPLICATION CONFIGURATION +AMP_HOST=0.0.0.0 +AMP_PORT=4555 \ No newline at end of file diff --git a/src/server.py b/src/server.py index 742f02e..f398b42 100644 --- a/src/server.py +++ b/src/server.py @@ -6,10 +6,6 @@ sys.path.insert(0, os.path.dirname('/'.join(__file__.split('/')[:-1]))) if True: import ampalibe - print(round(time.time() - t)) from conf import Configuration - print(round(time.time() - t)) import core - print(round(time.time() - t)) -print(round(time.time() - t)) ampalibe.run(Configuration())