-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Add location info to the event. #44
Conversation
If the location property is set to the event it can be used to open with right-click the URL (it must be actionable with XDG-OPEN).
I've added a small fix in case event location is not defined |
Also, might not be related necessarily to this PR, but I think there should be a flag like |
i3_agenda/__init__.py
Outdated
@@ -144,7 +150,16 @@ def getEvents(service, allowed_calendars_ids: List[str], max_results: int, today | |||
end_time = get_event_time(event['end'].get('dateTime', event['end'].get('date'))) | |||
start_time = event['start'].get('dateTime', event['start'].get('date')) | |||
unix_time = get_event_time(start_time) | |||
all.append(Event(event['summary'], is_allday(start_time), unix_time, end_time)) | |||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of try, catch a better approach would be:
location = None
if 'location' in event:
location = event['location']
Yes, this is fine most of the times but what when location is a link to a meeting? Usually these links (like Zoom) are quite long strings and would be very ugly to display in i3bar... |
Didn't really know this was a thing, guess we could find a workaround for it like checking if the location is a link, but that's definitely a different PR |
This should be related to #37
If the location property is set to the event it can be used to open
with right-click the URL (it must be actionable with XDG-OPEN).
Also some minor formatting with long lines.