Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
TaiSakuma committed Jun 21, 2023
2 parents 7b4e5ab + a9d5132 commit e7b1ad3
Show file tree
Hide file tree
Showing 385 changed files with 5,208 additions and 16,514 deletions.
38 changes: 22 additions & 16 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"python.linting.pylintEnabled": false,
"python.formatting.provider": "black",
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--ignore=E265, E266, E501, W503",
"--max-line-length=150",
"--max-complexity=20"
],
"python.linting.enabled": true,
"python.formatting.blackArgs": [
"--line-length",
"79"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
}
"[markdown]": {
"editor.rulers": [80]
},
"[python]": {
"editor.rulers": [89]
},
"prettier.printWidth": 79,
"rewrap.wrappingColumn": 79,
"python.formatting.provider": "black",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.linting.mypyEnabled": true,
"python.linting.flake8Enabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": ["tests"],
"isort.check": true,
"markdownlint.config": {
"MD033": { "allowed_elements": ["i", "span", "a", "img"] },
"MD041": false
}
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Set environmental variables

```bash
export FLASK_APP="acondbs:create_app('$PWD/instance/config.py')"
export FLASK_ENV=development
export FLASK_DEBUG=1
```

### Initialize database
Expand Down
8 changes: 1 addition & 7 deletions acondbs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
from . import _warnings # noqa: F401
from . import _logging

##__________________________________________________________________||

DEFAULT_CONFIG_DICT = dict(
SECRET_KEY="dev",
SQLALCHEMY_DATABASE_URI="sqlite:///:memory:",
SQLALCHEMY_TRACK_MODIFICATIONS=False,
)


##__________________________________________________________________||
def create_app(config_path=None, **kwargs):

_logging.configure_logging()

app = Flask(__name__, instance_relative_config=False)
Expand Down Expand Up @@ -65,8 +63,6 @@ def create_app(config_path=None, **kwargs):
return app


##__________________________________________________________________||

from ._version import get_versions # noqa: E402

__version__ = get_versions()["version"]
Expand All @@ -80,5 +76,3 @@ def create_app(config_path=None, **kwargs):
"""

del get_versions

##__________________________________________________________________||
13 changes: 2 additions & 11 deletions acondbs/_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from logging.config import dictConfig
from pathlib import Path

##__________________________________________________________________||
_module_path = Path(__file__).resolve().parent.parent
# the path to the dir in which the module is installed,
# i.e., the one dir above the module path.
Expand All @@ -28,9 +27,7 @@ def record_factory(*args, **kwargs):

record = _old_factory(*args, **kwargs)
try:
record.pathname = (
Path(record.pathname).resolve().relative_to(_module_path)
)
record.pathname = Path(record.pathname).resolve().relative_to(_module_path)
except Exception:
pass
return record
Expand All @@ -39,7 +36,6 @@ def record_factory(*args, **kwargs):
logging.setLogRecordFactory(record_factory)


##__________________________________________________________________||
def configure_logging():
"""configure logging
Expand Down Expand Up @@ -72,11 +68,6 @@ def configure_logging():
"formatter": "default",
}
},
"loggers": {
logger_name: {"level": logger_level, "handlers": ["wsgi"]}
},
"loggers": {logger_name: {"level": logger_level, "handlers": ["wsgi"]}},
}
)


##__________________________________________________________________||
Loading

0 comments on commit e7b1ad3

Please sign in to comment.