Skip to content

Commit

Permalink
Merge pull request #19 from deoren/i18-add-weekly-weekend-frequencies
Browse files Browse the repository at this point in the history
I18 add weekly weekend frequencies
  • Loading branch information
deoren authored Jun 3, 2018
2 parents 8ca6d89 + 93beab4 commit e405764
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
20 changes: 3 additions & 17 deletions automated_tickets.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,27 +63,13 @@
)

# This will need to be broken up later by the script
# WARNING: This needs to be kept in sync with DATE_LABEL within
# the library file.
parser.add_argument(
'--event_schedule',
action='store',
required=True,
choices=[
'daily',
'twice_week',
'weekly_monday',
'weekly_tuesday',
'weekly_wednesday',
'weekly_thursday',
'weekly_friday',
'weekly',
'twice_month',
'monthly',
'twice_year',
'quarterly',
'yearly'
]

# Reuse keys from DATE_LABEL dict in library file instead of repeating here
choices=list(DATE_LABEL.keys())
)

# NOTE: Probably want to leave this as not required and fall back to checking
Expand Down
10 changes: 6 additions & 4 deletions automated_tickets_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@
# we will get the same result as what we're doing here
TODAY = date.strftime('%Y-%m-%d')

# These entries match up with the event schedule "keywords". For example,
# when daily events are requested, active daily events will result in
# notifications generated which have subject lines that include the value
# that is paired with the keyword below.
# These entries serve both as a mapping of display formats and also as
# valid parameter values. For example, when daily events are requested,
# active daily events will result in notifications generated which have
# subject lines that include the value that is paired with the keyword below.
DATE_LABEL = {
'daily':TODAY,
'twice_week':TODAY,
Expand All @@ -91,6 +91,8 @@
'weekly_wednesday':TODAY,
'weekly_thursday':TODAY,
'weekly_friday':TODAY,
'weekly_saturday':TODAY,
'weekly_sunday':TODAY,
'twice_month':TODAY,
'monthly':MONTH_YEAR,
'twice_year':MONTH_YEAR,
Expand Down

0 comments on commit e405764

Please sign in to comment.