diff options
| author | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-01 19:31:47 +0300 |
|---|---|---|
| committer | Jan Tuomi <jans.tuomi@gmail.com> | 2023-09-10 19:01:00 +0300 |
| commit | 398799de0c1826c3544eb6eec681fa48096932a0 (patch) | |
| tree | c2a2cf7fcf30276ffc432e7a1750efd6b7d2c8bf | |
| parent | b7f129b29b8b8103336bfae265b3d5a0bc5ea03a (diff) | |
Refactor
| -rw-r--r-- | aggro.py (renamed from src/aggro.py) | 5 | ||||
| -rw-r--r-- | app/AggroConfig.py (renamed from src/AggroConfig.py) | 0 | ||||
| -rw-r--r-- | app/FeedSourcePlugin.py (renamed from src/FeedSourcePlugin.py) | 6 | ||||
| -rw-r--r-- | app/FilterPlugin.py (renamed from src/FilterPlugin.py) | 6 | ||||
| -rw-r--r-- | app/Item.py (renamed from src/Item.py) | 0 | ||||
| -rw-r--r-- | app/PluginInterface.py (renamed from src/PluginInterface.py) | 2 | ||||
| -rw-r--r-- | app/PluginManager.py (renamed from src/PluginManager.py) | 10 | ||||
| -rw-r--r-- | app/utils.py (renamed from src/utils.py) | 0 |
8 files changed, 15 insertions, 14 deletions
@@ -1,8 +1,9 @@ import json -from AggroConfig import AggroConfig -from PluginManager import PluginManager import os +from app.AggroConfig import AggroConfig +from app.PluginManager import PluginManager + if __name__ == "__main__": print("Starting aggro. Press CTRL-C to exit.") diff --git a/src/AggroConfig.py b/app/AggroConfig.py index e933eec..e933eec 100644 --- a/src/AggroConfig.py +++ b/app/AggroConfig.py diff --git a/src/FeedSourcePlugin.py b/app/FeedSourcePlugin.py index e6e4366..af686b9 100644 --- a/src/FeedSourcePlugin.py +++ b/app/FeedSourcePlugin.py @@ -1,8 +1,8 @@ import feedparser # type: ignore from typing import Any -from Item import Item -from PluginInterface import PluginInterface -from utils import get_param +from app.Item import Item +from app.PluginInterface import PluginInterface +from app.utils import get_param class Plugin(PluginInterface): diff --git a/src/FilterPlugin.py b/app/FilterPlugin.py index 6524d20..fd3984a 100644 --- a/src/FilterPlugin.py +++ b/app/FilterPlugin.py @@ -1,7 +1,7 @@ from typing import Any -from Item import Item -from PluginInterface import PluginInterface -from utils import get_param +from app.Item import Item +from app.PluginInterface import PluginInterface +from app.utils import get_param class Plugin(PluginInterface): diff --git a/src/Item.py b/app/Item.py index e74239f..e74239f 100644 --- a/src/Item.py +++ b/app/Item.py diff --git a/src/PluginInterface.py b/app/PluginInterface.py index c6be538..6194436 100644 --- a/src/PluginInterface.py +++ b/app/PluginInterface.py @@ -1,7 +1,7 @@ from abc import ABC, abstractmethod from typing import Any -from Item import Item +from app.Item import Item class PluginInterface(ABC): diff --git a/src/PluginManager.py b/app/PluginManager.py index 4a9bd13..8d60bc1 100644 --- a/src/PluginManager.py +++ b/app/PluginManager.py @@ -3,10 +3,10 @@ import schedule import time from types import ModuleType from typing import Any -from AggroConfig import AggroConfig -from Item import Item -from PluginInterface import PluginInterface -from utils import get_param +from app.Item import Item +from app.PluginInterface import PluginInterface +from app.AggroConfig import AggroConfig +from app.utils import get_param class PluginManager: @@ -17,7 +17,7 @@ class PluginManager: self.config = config def load_plugin(self, plugin_name: str) -> None: - module: ModuleType = importlib.import_module(plugin_name) + module: ModuleType = importlib.import_module(f"app.{plugin_name}") plugin_class = module.Plugin self._plugins[plugin_name] = plugin_class diff --git a/src/utils.py b/app/utils.py index ac07bf7..ac07bf7 100644 --- a/src/utils.py +++ b/app/utils.py |
