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 authored and tobixen committed Nov 28, 2023
1 parent a22d14e commit 242c4c0
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 @@ -131,12 +131,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 242c4c0

Please sign in to comment.