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

Fix redundant "Ignore and refresh" prompt from init #798

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
v4.5.1
* Fix bizarre SSL recursion errors by moving truststore init earlier
* Fix redundant "Ignore and refresh" prompt from `init`
* Adjust "when" value parsing to handle YYYY-MM-DD consistently

v4.5.0
Expand Down
2 changes: 2 additions & 0 deletions gcalcli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def main():
cal_names=cal_names,
printer=printer,
userless_mode=userless_mode,
# TODO: Avoid heavy unnecessary setup in general, remove override.
do_eager_init=parsed_args.command != 'init',
**vars(parsed_args),
)

Expand Down
9 changes: 7 additions & 2 deletions gcalcli/gcal.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,12 @@ class GoogleCalendarInterface:
UNIWIDTH = {'W': 2, 'F': 2, 'N': 1, 'Na': 1, 'H': 1, 'A': 1}

def __init__(
self, cal_names=(), printer=PRINTER, userless_mode=False, **options
self,
cal_names=(),
printer=PRINTER,
userless_mode=False,
do_eager_init=True,
**options,
):
self.cals = []
self.printer = printer
Expand All @@ -83,7 +88,7 @@ def __init__(
"Running in GCALCLI_USERLESS_MODE. Most operations will fail!",
file=sys.stderr,
)
else:
elif do_eager_init:
self._get_cached()

self._select_cals(cal_names)
Expand Down