python: Reformat code
authorJo Sutton <josutton@catalyst.net.nz>
Mon, 4 Mar 2024 23:33:33 +0000 (12:33 +1300)
committerJo Sutton <jsutton@samba.org>
Sun, 21 Apr 2024 22:10:36 +0000 (22:10 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/nt_time.py

index 098748f4f3c9ea73c395a3362311fea84e5d3e6d..714f9e97ef4ae738357ca1a65e839eea6ff9c0a5 100644 (file)
@@ -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