Skip to content

Commit

Permalink
Fix mypy unreachable error in file_templates
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen committed Jul 29, 2023
1 parent 1774e25 commit ef8e857
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions PFERD/crawl/ilias/file_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,24 +102,24 @@ class Links(Enum):
INTERNET_SHORTCUT = "internet-shortcut"

def template(self) -> Optional[str]:
if self == self.FANCY:
if self == Links.FANCY:
return _link_template_fancy
elif self == self.PLAINTEXT:
elif self == Links.PLAINTEXT:
return _link_template_plain
elif self == self.INTERNET_SHORTCUT:
elif self == Links.INTERNET_SHORTCUT:
return _link_template_internet_shortcut
elif self == self.IGNORE:
elif self == Links.IGNORE:
return None
raise ValueError("Missing switch case")

def extension(self) -> Optional[str]:
if self == self.FANCY:
if self == Links.FANCY:
return ".html"
elif self == self.PLAINTEXT:
elif self == Links.PLAINTEXT:
return ".txt"
elif self == self.INTERNET_SHORTCUT:
elif self == Links.INTERNET_SHORTCUT:
return ".url"
elif self == self.IGNORE:
elif self == Links.IGNORE:
return None
raise ValueError("Missing switch case")

Expand Down

0 comments on commit ef8e857

Please sign in to comment.