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

Add location info to the event. #44

Merged
merged 3 commits into from
Nov 13, 2020
Merged

Conversation

fabfurnari
Copy link
Contributor

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.

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).
@fabfurnari
Copy link
Contributor Author

I've added a small fix in case event location is not defined

@rosenpin
Copy link
Owner

rosenpin commented Nov 10, 2020

Also, might not be related necessarily to this PR, but I think there should be a flag like --show-location that when enabled will print the location in the event information, for example "10:30 Title @location"

@@ -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:
Copy link
Owner

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']

@fabfurnari
Copy link
Contributor Author

Also, might not be related necessarily to this PR, but I think there should be a flag like --show-location that when enabled will print the location in the event information, for example "10:30 Title @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...

@rosenpin
Copy link
Owner

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

@rosenpin rosenpin merged commit 4378470 into rosenpin:master Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants