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

Lock file maintenance (master) #1962

Merged
merged 2 commits 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
64 changes: 32 additions & 32 deletions c2cciutils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 3 additions & 10 deletions c2cciutils/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self) -> None:
self._update_creds()
self.service = build("calendar", "v3", credentials=self.creds)

def init_calendar_service(self) -> Credentials:
def init_calendar_service(self) -> Credentials: # type: ignore
"""
Initialize the calendar service.
"""
Expand All @@ -74,10 +74,10 @@ def init_calendar_service(self) -> Credentials:
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
creds.refresh(Request()) # type: ignore
else:
if self.token:
creds = Credentials(
creds = Credentials( # type: ignore
self.token,
refresh_token=self.refresh_token,
token_uri=self.token_uri,
Expand Down Expand Up @@ -177,13 +177,6 @@ def create_event(
event_result = self.service.events().insert(calendarId=self.calendar_id, body=body).execute()
print(f"Created event with id: {event_result['id']}")

def _print_credentials(self) -> None:
"""
Print the credentials.
"""
# UNSAFE: DO NEVER PRINT CREDENTIALS IN CI ENVIRONMENT, DEBUG ONLY!!!!
print(self.creds.to_json())

def save_credentials_to_gopass(self) -> None:
"""
Save the calendar credentials to gopass.
Expand Down
Loading
Loading