Fix "datetime_in_local_time" usage

This commit is contained in:
Stephen Seo 2023-09-11 10:29:10 +09:00
parent 46216ebf37
commit 0a449d168d
2 changed files with 10 additions and 8 deletions

View file

@ -20,6 +20,8 @@ is_log_timed = true
log_limit = 1073741824
# If true, then make the build fail if the limit is reached
error_on_limit = false
# If true, timestamps are in localtime. If false, timestamps are UTC.
datetime_in_local_time = true
########## END OF MANDATORY VARIABLES
# Each [[entry]] needs a "name".

View file

@ -1833,6 +1833,14 @@ if __name__ == "__main__":
other_state["gpg_home"] = d["gpg_dir"]
other_state["logs_dir"] = d["logs_dir"]
other_state["clones_dir"] = d["clones_dir"]
if (
"datetime_in_local_time" in d
and type(d["datetime_in_local_time"]) is bool
and d["datetime_in_local_time"]
):
other_state["datetime_in_local_time"] = True
else:
other_state["datetime_in_local_time"] = False
if other_state["logs_dir"] is not None:
GLOBAL_LOG_FILE = other_state["logs_dir"] + "/update.py_logs"
log_print(
@ -1902,14 +1910,6 @@ if __name__ == "__main__":
other_state["error_on_limit"]
)
)
if (
"datetime_in_local_time" in d
and type(d["datetime_in_local_time"]) is bool
and d["datetime_in_local_time"]
):
other_state["datetime_in_local_time"] = True
else:
other_state["datetime_in_local_time"] = False
else:
log_print(
'ERROR: At least "--config" or "--pkg" must be specified',