From 2c6495ffe1a7e97e7c573f57746d91142ae3df5e Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Mon, 10 Sep 2018 02:25:08 -0700 Subject: [PATCH] Basic skeleton --- setup.py | 16 ++++++++++++++++ wubloader/__init__.py | 0 wubloader/__main__.py | 12 ++++++++++++ wubloader/main.py | 14 ++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 setup.py create mode 100644 wubloader/__init__.py create mode 100644 wubloader/__main__.py create mode 100644 wubloader/main.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..eedebdb --- /dev/null +++ b/setup.py @@ -0,0 +1,16 @@ +from setuptools import setup, find_packages + +setup( + name='wubloader', + version='0.0.1', + author='VST video cutting bot', + author_email='mikelang3000@gmail.com', + description=True, + packages=find_packages(), + install_requires=[ + 'argh', + 'gevent', + 'gspread', + 'oauth2client', + ], +) diff --git a/wubloader/__init__.py b/wubloader/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/wubloader/__main__.py b/wubloader/__main__.py new file mode 100644 index 0000000..b1097c5 --- /dev/null +++ b/wubloader/__main__.py @@ -0,0 +1,12 @@ + +import gevent.monkey +gevent.monkey.patch_all() + +import logging +logging.basicConfig(level='DEBUG') + +import argh + +from wubloader.main import main + +argh.dispatch_command(main) diff --git a/wubloader/main.py b/wubloader/main.py new file mode 100644 index 0000000..bfc28ff --- /dev/null +++ b/wubloader/main.py @@ -0,0 +1,14 @@ + +import logging + +# Verbose format but includes all extra info +LOG_FORMAT = "[%(asctime)s] %(levelname)s pid:%(process)d tid:%(thread)d %(name)s (%(pathname)s:%(funcName)s:%(lineno)d): %(message)s" + + +def main(conf_file, log_level='INFO'): + logging.basicConfig(level=log_level, format=LOG_FORMAT) + + with open(conf_file) as f: + config = json.load(f) + +