diff options
author | David Luevano Alvarado <david@luevano.xyz> | 2023-08-22 01:05:45 -0600 |
---|---|---|
committer | David Luevano Alvarado <david@luevano.xyz> | 2023-08-22 01:05:45 -0600 |
commit | 4bcc2029c25cb5b640eff5ea59ab020da6a42e2b (patch) | |
tree | 3161603e6c55564b69f99f939413be4b6b9d177d /src/pyssg/utils.py | |
parent | 19b23dd2ba0dfc97ed5bbfba02eaeeb0dca88919 (diff) |
refactor: simplify config parsing and init
got rid of all the overengineered configuration parsing, everything is more simple and the error handling is left to the user as it would only mean checking their configuration based on the error message
Diffstat (limited to 'src/pyssg/utils.py')
-rw-r--r-- | src/pyssg/utils.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pyssg/utils.py b/src/pyssg/utils.py index b1ed8c1..d391ccf 100644 --- a/src/pyssg/utils.py +++ b/src/pyssg/utils.py @@ -3,6 +3,7 @@ import sys import shutil from hashlib import md5 from logging import Logger, getLogger +from datetime import datetime, timezone log: Logger = getLogger(__name__) @@ -106,3 +107,8 @@ def get_expanded_path(path: str) -> str: sys.exit(1) log.debug('expanded path "%s" to "%s"', path, expanded_path) return expanded_path + + +def get_time_now(fmt: str, tz: timezone=timezone.utc) -> str: + return datetime.now(tz=tz).strftime(fmt) + |