Commit aad6736
google-calendar: Call get-google-credentials script internally.
The auth tokens expire every hour. So, the google-calendar script would
stop functioning one hour after start, if it only loads from the token
file.
The get-google-credential script needs to be called directly from the
google-calendar script, without the user needing to run that as a
separate command.
The get-google-credentials script is not a module.
And it uses hyphens in its name, hence it cannot be directly imported
into google-calendar.
To avoid renaming files, and smoothly pass in arguments, runpy is used.
Though google-calendar script is currently the only google service
integration that uses get-google-credentials, the script is not merged
with the google-calendar script, to keep the logic separate, and easy
to expand.
The get-google-credentials script can no longer be run directly, as the
get_credentials() arguments do not have any default values, with the
constants deleted, to avoid redundancy with the google-calendar script.
Updated the function docstrings, usage help and error messages.1 parent 3d85751 commit aad6736
File tree
2 files changed
+12
-28
lines changed- zulip/integrations/google
2 files changed
+12
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
17 | 14 | | |
18 | 15 | | |
19 | 16 | | |
20 | 17 | | |
21 | | - | |
| 18 | + | |
22 | 19 | | |
23 | 20 | | |
24 | 21 | | |
| |||
33 | 30 | | |
34 | 31 | | |
35 | 32 | | |
36 | | - | |
37 | 33 | | |
38 | | - | |
39 | | - | |
40 | 34 | | |
41 | | - | |
| 35 | + | |
42 | 36 | | |
43 | 37 | | |
44 | 38 | | |
| |||
50 | 44 | | |
51 | 45 | | |
52 | 46 | | |
53 | | - | |
| 47 | + | |
54 | 48 | | |
55 | 49 | | |
56 | 50 | | |
57 | 51 | | |
58 | | - | |
59 | | - | |
60 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
37 | | - | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
78 | 77 | | |
79 | 78 | | |
80 | 79 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 80 | + | |
86 | 81 | | |
87 | | - | |
88 | | - | |
| 82 | + | |
| 83 | + | |
89 | 84 | | |
90 | 85 | | |
91 | 86 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
98 | 91 | | |
99 | 92 | | |
100 | 93 | | |
| |||
0 commit comments