Skip to content

Commit

Permalink
add plugins loader
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Mar 16, 2020
1 parent 2174f09 commit 8f6886f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Userge/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import logging


logging.basicConfig(
level=logging.INFO,
format='[%(asctime)s - %(levelname)s] - %(name)s - %(message)s',
datefmt='%d-%b-%y %H:%M:%S'
)

log = logging.getLogger(__name__)
16 changes: 16 additions & 0 deletions Userge/plugins/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from Userge import log
from os.path import dirname, basename, isfile
import glob


plugins = sorted(
[
basename(f)[:-3] for f in glob.glob(dirname(__file__) + "/*.py")
if isfile(f) and f.endswith(".py") and not f.endswith("__init__.py")
]
)


log.info(f"plugins to load: {plugins}")

__all__ = plugins + ["plugins"]
Empty file added requirements.txt
Empty file.

0 comments on commit 8f6886f

Please sign in to comment.