From: Jo Sutton Date: Mon, 4 Mar 2024 23:33:33 +0000 (+1300) Subject: python: Reformat code X-Git-Tag: tdb-1.4.11~1058 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56dd910b8372bee82e9cbe26b730dd4c938c9803;p=thirdparty%2Fsamba.git python: Reformat code Signed-off-by: Jo Sutton Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/nt_time.py b/python/samba/nt_time.py index 098748f4f3c..714f9e97ef4 100644 --- a/python/samba/nt_time.py +++ b/python/samba/nt_time.py @@ -85,19 +85,21 @@ def nt_time_from_string(s: str) -> NtTime: UTC). """ try: - if s == 'now': + if s == "now": dt = datetime.datetime.now(datetime.timezone.utc) - elif re.match(r'^\d{14}\.0Z$', s): + elif re.match(r"^\d{14}\.0Z$", s): # "20230127223641.0Z" - dt = datetime.datetime.strptime(s, '%Y%m%d%H%M%S.0Z') + dt = datetime.datetime.strptime(s, "%Y%m%d%H%M%S.0Z") else: dt = datetime.datetime.fromisoformat(s) except ValueError: - raise ValueError("Expected a date in either " - "ISO8601 'YYYY-MM-DD HH:MM:SS' format, " - "LDAP timestamp 'YYYYmmddHHMMSS.0Z', " - "or the literal string 'now'. " - f" Got '{s}'.") + raise ValueError( + "Expected a date in either " + "ISO8601 'YYYY-MM-DD HH:MM:SS' format, " + "LDAP timestamp 'YYYYmmddHHMMSS.0Z', " + "or the literal string 'now'. " + f" Got '{s}'." + ) if dt.tzinfo is None: # This is a cursed timestamp with no timezone info. We have to