-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
|
||
Arguments: | ||
app: Application instance | ||
config: Config instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Точки?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А я не работаю в гугле)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(((((((((((((
""" | ||
self.app = app | ||
self.config = config | ||
self.log = get_logger(self.__class__.__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ты же его по файлам разделяешь, не по классам.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В других логгерах я поменял на классы, для читаемости и эстатичности
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
По файлам был перебор, а тут... У нас для каждого класса свой файл, зачем еще больше разделять? Хотя... это убирает инициализацию логгера при импорте.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, да, давая всё в __init__.py
хуячить!
log.info("Enabling `%s`..." % plugins_path) | ||
plugins_module = import_module(plugins_path) | ||
if "setup" in plugins_module.__dir__(): | ||
if plugins_module.__api_version__ != 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO мне: переделать ifы в класс с цепочкой обработчиков (паттерн Цепочка обязанностей
)
log = get_logger("PluginManager") | ||
|
||
|
||
def initialize_all() -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Переделай пожалуйста эту функцию в класс, для более легкого тестирования.
Because it's more understandable
* aiohttp init * Add changes to CHANGELOG.md * Change `import ?` to `from ? import ?` * Change branch `master` to `aiohttp` * Fix CI * Move ifmain block to function (#27) * Change poetry installation (#26) * Change poetry installation * Fix typo in word * Add script to remove residual trash (#28) * Port logger from django branch 🚚 (#30) * Port logger from django branch 🚚 * Add log levels * Add @PerchunPak suggestions * Add LOG_SEPARATE and LOG_PATH features * Sync `pyproject.toml` and `docs/requirments.txt` This fix `readthedocs` build. * Remove Python3.11 from CICD (#37) * Remove Python3.11 from CICD * Add changes from PR to CHANGELOG.md * Apply codestyle ✏️ [skip ci] * Update poetry.lock 📈 * Fix typo in poetry command * Port Config class from `master` (#38) * Port Config class from `master` * Add Singleton to Config class * Make `furo` auto-updateble * Update poetry.lock 📈 * Fix Docker container build * Update poetry.lock 📈 * Fix CI pushing in pull requests (cherry picked from commit 54b39e2) * Final fix CI pushing in pull requests (cherry picked from commit e6ab8df) * Update poetry.lock 📈 * Plugin API (#43) * Add base aiohttp sub-apps initialization * Add mako as templating language * Fix VSC config for Win * Type init func * Update [skip ci] * DL VSC folder * DL app view * Add plugin initialization * TLTD * Fix tests * Private methods can start with one _ * Rename variable `e` to `exception` * Change `pip freeze` to `pip list` Because it's more understandable * Remove necessary checks Co-authored-by: PerchunPak <perchunpak@gmail.com>
Важный check-list
CHANGELOG.md
и добавил номер PR туда.make test
и с тех пор ничего не менял.