diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53f16e5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,117 @@ +# ---> Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +.idea/ \ No newline at end of file diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..4c89db7 --- /dev/null +++ b/__init__.py @@ -0,0 +1,13 @@ +import inspect + +from config import Config +import os +import toml + +class BasePython: + def __init__(self, client): + with open(os.path.join(os.path.dirname(inspect.getfile(self.__class__)),"infos.toml")) as f: + self.infos = toml.load(f) + self.name = self.infos["name"] + self.client = client + self.config = Config(path=os.path.join(client.config["data_folder"], self.name.lower())) \ No newline at end of file diff --git a/infos.toml b/infos.toml new file mode 100644 index 0000000..1478f70 --- /dev/null +++ b/infos.toml @@ -0,0 +1,9 @@ +name = "Base" +description = "Base module to avoid code repetition" + +version = "0.1.0" +bot_version = "~=0.1.0" + +metamodule = true + +[dependencies] \ No newline at end of file