Skip to content

Commit

Permalink
Temp save - code not working
Browse files Browse the repository at this point in the history
  • Loading branch information
JanhSander committed Jan 24, 2024
1 parent 97636e6 commit 341bb25
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/datadoc/backend/dapla_dataset_path_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@


class SupportedDateFormats(Enum):
"""The Date formats supported by the naming convention."""
ISO_YEAR = auto() # String format YYYY
ISO_YEAR_MONTH = auto() # String format YYYY-MM
ISO_YEAR_MONTH_DAY = auto() # String format YYYY-MM-DD
SSB_YEAR_SEME TER= auto()
# String format YYYY-Hn
SSB_YEAR_TRIMESTER = auto() # String format YYYY-Tn
SSB_YEAR_SEMESTER = auto() SSB_YEAR_TRIMESTER = auto() # String format YYYY-Tn
SSB_YEAR_QUARTER = auto() # String format YYYY-Qn
SSB_YEAR_BIMESTER = auto() # String format YYYY-Bn
SSB_YEAR_WEEK = auto() # String format YYYY-Wnn


class RegexEqual(str):
"""Helper class for structual pattern matching using regex""""
"""Helper class for structual pattern matching using regex."""
def __eq__(self, pattern:str)->bool:
return bool(re.search(pattern, self))

Expand All @@ -48,10 +48,10 @@ def __init__(self, dataset_path: str) -> None:
self.second_period_string = _period_strings[1]


def _categorize_period_string(period: str) -> SupportedDateFormats:
def _categorize_period_string(self,period: str) -> SupportedDateFormats:
"""A naive string validator."""
match RegexEqual(period):
case "\d+":
case r"\d+":
return SupportedDateFormats.ISO_YEAR


Expand Down

0 comments on commit 341bb25

Please sign in to comment.