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

Add default DATE_LABEL entry to allow for custom entries? #40

Open
deoren opened this issue Jun 14, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@deoren
Copy link
Collaborator

commented Jun 14, 2019

Example entries from the current dictionary:

# 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,
    'weekly':TODAY,
    'weekly_monday':TODAY,
    'weekly_tuesday':TODAY,
    '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,
    'quarterly':MONTH_YEAR,
    'yearly':YEAR
}

As indicated, the earlier line of thought was that if an entry requested via the cron script call wasn't in this dictionary, it wasn't valid and would be rejected.

Perhaps we should instead set a default value to be used for non-matches against this dictionary in order to allow implementations to set a desired keyword within the events table and call that keyword from the cron entry, all without requiring that the script be updated to include a matching entry.

Another, potentially much better option would be to pull that dictionary out and store as a JSON file. The sysadmin would then modify the file as desired in order to extend behavior, all without requiring them to modify the Python source file.

@deoren deoren added this to the Future milestone Jun 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.