Skip to content

Commit

Permalink
Fix redundant "Ignore and refresh" prompt from init (#798)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarnett authored Oct 2, 2024
1 parent bf57778 commit e6d4521
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
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

0 comments on commit e6d4521

Please sign in to comment.