You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
google-calendar: Support loading options from the zuliprc.
By loading from the new "google-calendar" section of the zuliprc.
Moved the default values out of the argparse arguments, and into a
dataclass, to implement the below hierarchy of loading options:
- initialize options to default values
- overwrite with the options present in the config file
- overwrite with the options passed-in via the command line
help="Minutes before event for reminder [default: 30]",
60
73
)
61
74
parser.add_argument(
62
75
"--calendar",
63
76
dest="calendar_id",
64
-
default="primary",
65
77
help="The ID of the calendar you want to receive reminders from. By default, the primary calendar is used.",
66
78
)
67
79
parser.add_argument(
@@ -71,30 +83,77 @@ parser.add_argument(
71
83
parser.add_argument(
72
84
"--topic",
73
85
help="The topic to which to send the reminders to. Ignored if --channel is unspecified. 'calendar-reminders' is used as the default topic name.",
74
-
default="calendar-reminders",
75
86
)
76
87
parser.add_argument(
77
88
"--client-secret-file",
78
89
help="The path to the file containing the client secret for the Google Calendar API. By default, the client secret file is assumed to be at {CLIENT_SECRET_PATH}.",
79
-
default=CLIENT_SECRET_PATH,
80
90
dest="client_secret_path",
81
91
)
82
92
parser.add_argument(
83
93
"--tokens-file",
84
94
help=f"The path to the file containing the tokens for the Google Calendar API. By default, the tokens file is generated at {TOKENS_PATH} after the first run.",
85
-
default=TOKENS_PATH,
86
95
dest="tokens_path",
87
96
)
88
97
parser.add_argument(
89
98
"-n",
90
99
"--noauth_local_webserver",
91
100
action="store_true",
92
-
default=False,
93
101
help="The default authorization process runs a local web server, which requires a browser on the same machine. For non-interactive environments and machines without browser access, e.g., remote servers, this option allows manual authorization. The authorization URL is printed, which the user can copy into a browser, copy the resulting authorization code, and paste back into the command line.",
0 commit comments