GLOBAL_LOG_FILE = "log.txt"
DEFAULT_EDITOR = "/usr/bin/nano"
IS_DIGIT_REGEX = re.compile("^[0-9]+$")
+STRFTIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
class ArchPkgVersion:
and kwargs["other_state"]["is_timed"]
):
t = datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d_%H-%M-%S_%Z"
+ STRFTIME_FORMAT
)
print(t, end=" ")
with open(GLOBAL_LOG_FILE, "a", encoding="utf-8") as lf:
if other_state["is_log_timed"]:
nowstring = datetime.datetime.now(
datetime.timezone.utc
- ).strftime("%Y-%m-%d_%H-%M-%S_%Z ")
+ ).strftime(STRFTIME_FORMAT + " ")
line = nowstring + line
log_count += len(line)
if log_count > other_state["log_limit"]:
)
post_command_list.insert(3, "RUSTC_WRAPPER=/usr/bin/sccache")
nowstring = datetime.datetime.now(datetime.timezone.utc).strftime(
- "%Y-%m-%d_%H-%M-%S_%Z"
+ STRFTIME_FORMAT
)
if "link_cargo_registry" in pkg_state[pkg]:
command_list.insert(2, "-d")
if args_logs_dir is not None:
GLOBAL_LOG_FILE = args_logs_dir + "/update.py_logs"
log_print(
- f"{datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%d %H:%M %Z')}",
+ datetime.datetime.now(datetime.timezone.utc).strftime(
+ STRFTIME_FORMAT
+ ),
other_state=other_state,
)
log_print(
if other_state["logs_dir"] is not None:
GLOBAL_LOG_FILE = other_state["logs_dir"] + "/update.py_logs"
log_print(
- f"{datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%d %H:%M %Z')}",
+ datetime.datetime.now(datetime.timezone.utc).strftime(
+ STRFTIME_FORMAT
+ ),
other_state=other_state,
)
log_print(