Skip to content

Commit

Permalink
- Readded 'unused function' (It was used afterall)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJSchaffner committed Sep 19, 2020
1 parent a64f28d commit 529c78b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ def remove_patched_files(original_dir: pathlib.Path, override_dir: pathlib.Path)
except BaseException as e:
raise e

def extract_date(date_string: str):
"""Extract a date in the format of 'd(d) Monthname yyyy'.
Returns a datetime object
"""
date_stripped = re.search(r"\d+ \w* \d+", date_string).group(0)

locale.setlocale(locale.LC_TIME, "en_US")
date = time.strptime(date_stripped, "%d %B %Y")
locale.setlocale(locale.LC_TIME, "de_DE")

return date

def check_dotnet():
"""Checks if dotnet is available."""
return not (shutil.which("dotnet") is None)
Expand Down

0 comments on commit 529c78b

Please sign in to comment.