X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=string_utils.py;h=ec662d234d8afa788cce2779e51f51622bc2862e;hb=309ddadb402e09bf09bc38ca455dcaef7e08619e;hp=6f3cc90ed46f5c238b0887848c1cf7504ec3bcc0;hpb=713a609bd19d491de03debf8a4a6ddf2540b13dc;p=python_utils.git diff --git a/string_utils.py b/string_utils.py index 6f3cc90..ec662d2 100644 --- a/string_utils.py +++ b/string_utils.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 +# -*- coding: utf-8 -*- """The MIT License (MIT) @@ -141,16 +142,16 @@ MARGIN_RE = re.compile(r"^[^\S\r\n]+") ESCAPE_SEQUENCE_RE = re.compile(r"\[[^A-Za-z]*[A-Za-z]") NUM_SUFFIXES = { - "Pb": (1024 ** 5), - "P": (1024 ** 5), - "Tb": (1024 ** 4), - "T": (1024 ** 4), - "Gb": (1024 ** 3), - "G": (1024 ** 3), - "Mb": (1024 ** 2), - "M": (1024 ** 2), - "Kb": (1024 ** 1), - "K": (1024 ** 1), + "Pb": (1024**5), + "P": (1024**5), + "Tb": (1024**4), + "T": (1024**4), + "Gb": (1024**3), + "G": (1024**3), + "Mb": (1024**2), + "M": (1024**2), + "Kb": (1024**1), + "K": (1024**1), } @@ -1074,7 +1075,7 @@ def to_date(in_str: str) -> Optional[datetime.date]: """ Parses a date string. See DateParser docs for details. """ - import dateparse.dateparse_utils as dp # type: ignore + import dateparse.dateparse_utils as dp try: d = dp.DateParser()