fix attr issue

This commit is contained in:
meisnate12 2021-10-07 11:17:20 -04:00
parent 014d6c859c
commit 2cd489ea62
2 changed files with 9 additions and 9 deletions

View file

@ -40,12 +40,12 @@ class Config:
logger.info(f"Using {self.config_path} as config")
self.default_dir = default_dir
self.test_mode = attrs["test"]
self.test_mode = attrs["test"] if "test" in attrs else False
self.run_start_time = attrs["time"]
self.run_hour = datetime.strptime(attrs["time"], "%H:%M").hour
self.requested_collections = util.get_list(attrs["collections"])
self.requested_libraries = util.get_list(attrs["libraries"])
self.resume_from = attrs["resume"]
self.requested_collections = util.get_list(attrs["collections"]) if "collections" in attrs else None
self.requested_libraries = util.get_list(attrs["libraries"]) if "libraries" in attrs else None
self.resume_from = attrs["resume"] if "resume" in attrs else None
yaml.YAML().allow_duplicate_keys = True
try:

View file

@ -116,11 +116,11 @@ def start(attrs):
logger.info(util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| "))
logger.info(util.centered(" |___/ "))
logger.info(util.centered(" Version: 1.12.2-develop1004 "))
if "time" in attrs: start_type = f"{attrs['time']} "
elif "test" in attrs: start_type = "Test "
elif "collections" in attrs: start_type = "Collections "
elif "libraries" in attrs: start_type = "Libraries "
else: start_type = ""
if "time" in attrs and attrs["time"]: start_type = f"{attrs['time']} "
elif "test" in attrs and attrs["test"]: start_type = "Test "
elif "collections" in attrs and attrs["collections"]: start_type = "Collections "
elif "libraries" in attrs and attrs["libraries"]: start_type = "Libraries "
else: start_type = ""
start_time = datetime.now()
if "time" not in attrs:
attrs["time"] = start_time.strftime("%H:%M")