aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/task_server/__main__.py25
1 files changed, 15 insertions, 10 deletions
diff --git a/python/task_server/__main__.py b/python/task_server/__main__.py
index c7852dac..ed6b8c1e 100644
--- a/python/task_server/__main__.py
+++ b/python/task_server/__main__.py
@@ -5,24 +5,29 @@ from . import LOG_DIR
from .globeop import download_data, upload_data
from sqlalchemy import create_engine
-logging.basicConfig(filename=LOG_DIR / 'globeop.log',
- level=logging.INFO,
- format='%(asctime)s %(message)s')
+logging.basicConfig(
+ filename=LOG_DIR / "globeop.log",
+ level=logging.INFO,
+ format="%(asctime)s %(message)s",
+)
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
## options are technically not exclusive, but we will be running them
## at different times of the day
-group.add_argument("-d", "--download", action="store_true",
- help="download reports from GlobeOp")
-group.add_argument("-u", "--upload", action="store_true",
- help="upload marks to GlobeOp")
-parser.add_argument("date", nargs='?', type=datetime.date.fromisoformat,
- default=datetime.date.today())
+group.add_argument(
+ "-d", "--download", action="store_true", help="download reports from GlobeOp"
+)
+group.add_argument(
+ "-u", "--upload", action="store_true", help="upload marks to GlobeOp"
+)
+parser.add_argument(
+ "date", nargs="?", type=datetime.date.fromisoformat, default=datetime.date.today()
+)
args = parser.parse_args()
if args.download:
download_data(args.date)
elif args.upload:
- engine = create_engine('postgresql://dawn_user@debian/dawndb')
+ engine = create_engine("postgresql://dawn_user@debian/dawndb")
upload_data(engine, args.date)