From 348a78e4b34b009946fb0969f184d7efa4171fc1 Mon Sep 17 00:00:00 2001 From: Romain J Date: Mon, 16 Dec 2019 21:41:10 +0100 Subject: [PATCH] update(git|gitignore): add venv to gitignore --- .gitignore | 133 +++++++++++++++++++++++++++++++++- bot.py | 8 +- cogs/utils/config.py | 2 +- cogs/utils/models/__init__.py | 2 +- cogs/utils/models/poll.py | 4 +- migrate.py | 2 +- requirements.txt | 1 + 7 files changed, 141 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 28a7297..12b2b12 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,135 @@ private.py .idea/ #other -*.log \ No newline at end of file +*.log + + +# 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/ +pip-wheel-metadata/ +share/python-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 +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# 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 + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# 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/ diff --git a/bot.py b/bot.py index 7a023ae..d73cad6 100755 --- a/bot.py +++ b/bot.py @@ -23,11 +23,11 @@ build = git.Repo(search_parent_directories=True).head.object.hexsha log = logging.getLogger(__name__) l_extensions: List[str] = [ - # 'cogs.admin', + 'cogs.admin', 'cogs.basics', - # 'cogs.utility', - # 'cogs.logs', - # 'cogs.poll', + 'cogs.utility', + 'cogs.logs', + 'cogs.poll', 'jishaku', ] diff --git a/cogs/utils/config.py b/cogs/utils/config.py index 832d24a..bae139f 100644 --- a/cogs/utils/config.py +++ b/cogs/utils/config.py @@ -14,7 +14,7 @@ class Config: return item in self._db def __getitem__(self, item): - return self._db[str(item)] + return self._db[item] def all(self) -> list: return self._db.sections() diff --git a/cogs/utils/models/__init__.py b/cogs/utils/models/__init__.py index 4b2dcdc..8042881 100644 --- a/cogs/utils/models/__init__.py +++ b/cogs/utils/models/__init__.py @@ -3,4 +3,4 @@ Base = declarative_base() from .lang import Lang from .warn import Warn -# from .poll import Poll, Responses +from .poll import Poll, Responses diff --git a/cogs/utils/models/poll.py b/cogs/utils/models/poll.py index 88b625d..72e5f67 100644 --- a/cogs/utils/models/poll.py +++ b/cogs/utils/models/poll.py @@ -1,10 +1,8 @@ -from sqlalchemy.ext.declarative import declarative_base +from . import Base from sqlalchemy import Column, Integer, BigInteger, JSON, ForeignKey, Boolean from sqlalchemy.orm import relationship from werkzeug.security import generate_password_hash, check_password_hash -Base = declarative_base() - class Poll(Base): __tablename__ = 'polls' diff --git a/migrate.py b/migrate.py index be1987b..31c2ef6 100644 --- a/migrate.py +++ b/migrate.py @@ -2,6 +2,6 @@ from cogs.utils.models import * from cogs.utils.config import Config from cogs.utils.database import Database -database = Database(Config("config.cfg")) +database = Database(Config("./configs/config.cfg")) Base.metadata.create_all(database.engine) diff --git a/requirements.txt b/requirements.txt index 6f86e00..a288e29 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ configparser psutil tcp_latency i18n +werkzeug \ No newline at end of file