Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve TRIGGER DURATION parsing logic #148

Merged

Conversation

@jessejoe
Copy link
Contributor

@jessejoe jessejoe commented Oct 10, 2018

TRIGGER DURATIONs can also take the form TRIGGER;VALUE=DURATION:-PT30M. The existing logic only accounts for TRIGGER:-PT30M.

This can be tested with any of the NHL ical schedules from this season, e.g. https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics .

Before:

In [2]: cal = ics.Calendar(requests.get('https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics').text)

ParserError: Could not match input to any of ['YYYY-MM-DDTHH:mm']

After:

In [2]: cal = ics.Calendar(requests.get('https://www.stanza.co/api/schedules/nhl-sabres/nhl-sabres.ics').text)

In [3]: cal.events[0].alarms[0].trigger
Out[3]: datetime.timedelta(0, 1800)
TRIGGER DURATIONs can also take the form `TRIGGER;VALUE=DURATION:-PT30M`. The
existing logic only accounts for `TRIGGER:-PT30M`.
@jessejoe jessejoe force-pushed the jessejoe:improve_trigger_duration_logic branch from defe715 to 0486174 Oct 10, 2018
@C4ptainCrunch C4ptainCrunch merged commit b49ad6a into C4ptainCrunch:master Oct 27, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@C4ptainCrunch
Copy link
Owner

@C4ptainCrunch C4ptainCrunch commented Oct 27, 2018

Great, thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.