Skip to content

Commit

Permalink
Simplify/unify match logic a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwash committed Nov 26, 2023
1 parent 95a6849 commit c436d65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions caldav/lib/vcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ def __call__(self, line):
self.stamped = 0
self.ended = 0

elif re.search("^(DURATION|DTEND|DUE)[:;]", line):
elif re.match("(DURATION|DTEND|DUE)[:;]", line):
if self.ended:
return False
self.ended += 1

elif line.startswith("DTSTAMP") and line[7] in (";", ":"):
elif re.match("DTSTAMP[:;]", line):
if self.stamped:
return False
self.stamped += 1
Expand Down

0 comments on commit c436d65

Please sign in to comment.