2018-10-15 14:16:10 +01:00
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import argparse
|
|
|
|
import logging
|
|
|
|
|
2020-05-06 13:27:49 +01:00
|
|
|
class nameddict(dict):
|
|
|
|
__getattr__ = dict.get
|
|
|
|
__setattr__ = dict.__setitem__
|
|
|
|
__delattr__ = dict.__delitem__
|
|
|
|
|
|
|
|
paths = nameddict({
|
2020-09-07 08:35:30 +01:00
|
|
|
"archive": os.path.join(os.path.expanduser('~'), "archive"),
|
2020-05-06 13:27:49 +01:00
|
|
|
})
|
2018-10-15 14:16:10 +01:00
|
|
|
|
2019-07-13 21:01:57 +01:00
|
|
|
loglevels = {"critical": 50, "error": 40, "warning": 30, "info": 20, "debug": 10}
|
2018-10-15 14:16:10 +01:00
|
|
|
|
2019-07-13 21:01:57 +01:00
|
|
|
_parser = argparse.ArgumentParser(description="Parameters for silo.pasta")
|
|
|
|
_parser.add_argument("--loglevel", default="debug", help="change loglevel")
|
2018-10-15 14:16:10 +01:00
|
|
|
|
|
|
|
args = vars(_parser.parse_args())
|
|
|
|
logging.basicConfig(
|
2019-07-13 21:01:57 +01:00
|
|
|
level=loglevels[args.get("loglevel")],
|
|
|
|
format="%(asctime)s - %(levelname)s - %(message)s",
|
2018-10-15 14:16:10 +01:00
|
|
|
)
|