caleb531 Posted November 22, 2020 Posted November 22, 2020 With the "new normal", many of us are working from home and jumping from one virtual meeting to the next to the next: from Zoom to Google Meet to GoToMeeting, etc. To save the pain of scrambling to open your next meeting link, I have written a workflow just for that! It's called "Open Conference URL", and its usage is simple: type conf to see your upcoming calendar events. Hit Enter to launch Zoom/Meet/etc. immediately. And even if you are 15 minutes late, the workflow will know what to do. (Download Workflow) If there are no nearby calendar events, the workflow displays all events for today: Download Workflow For documentation on all the configurable preferences, see the project's GitHub page: https://github.com/caleb531/open-conference-url
deanishe Posted November 23, 2020 Posted November 23, 2020 I'm getting an error in cache.py: File "ocu/cache.py", line 42, in __init__ self.refresh() File "ocu/cache.py", line 110, in refresh if self.get('event_blobs') != event_blobs: File "ocu/cache.py", line 77, in get return self.__dict__[key] KeyError: u'event_blobs' You’re using dict incorrectly. dict[key] always throws a KeyError if a key doesn’t exist. # Return True if the given key exists in the cache; otherwise, return false def has(self, key): if self.__dict__[key]: return True else: return False # Return True if the given key exists in the cache; otherwise, return false def get(self, key): return self.__dict__[key] I think you mean to be using self.__dict__.has_key() and self.__dict__.get()? If you’re going to store data in __dict__, you might as well inherit from dict instead of object. It's not a good idea to store user preferences in the workflow's own folder: they'll get overwritten by a workflow update. If you can't or don't want to store them in info.plist as workflow environment variables, put them in the workflow's data directory.
JuanDz Posted November 25, 2020 Posted November 25, 2020 On 11/22/2020 at 11:46 PM, deanishe said: I think you mean to be using self.__dict__.has_key() and self.__dict__.get()? If you’re going to store data in __dict__, you might as well inherit from dict instead of object. Im having exactly this error, i'm just a rookie developer and tried this change you mention but still does not work for me, could you lend a hand? from ocu.cache import cache File "ocu/cache.py", line 130, in <module> cache = Cache() File "ocu/cache.py", line 42, in __init__ self.refresh() File "ocu/cache.py", line 110, in refresh if self.get('event_blobs') != event_blobs: File "ocu/cache.py", line 77, in get return self.__dict__.get([key]) TypeError: unhashable type: 'list'
deanishe Posted November 26, 2020 Posted November 26, 2020 11 hours ago, JuanDz said: self.__dict__.get([key]) self.__dict__.get(key) (no square brackets). I’ve no idea if that will fix anything. It fixes a bug, but it also changes the semantics. JuanDz 1
ashishb Posted December 30, 2020 Posted December 30, 2020 (edited) How do I fix this error? Found the answer: Edited December 30, 2020 by ashishb Adding the solution
qbat Posted January 18, 2021 Posted January 18, 2021 Yeah it looks like the version that's current on master branch on github works great! BUT the most recent packaged version, v2.0.1 is broken. @caleb531 If you release the current state of the master branch it'll fix this issue! But v2.0.1 throws an error and fails bc of the issue identified above (self.get() in cache.py is broken, it throws a KeyError bc neither it nor has() actually safely check whether the key exists) Also btw... this workflow is EXTREMELY cool, thank you for building it!!
deanishe Posted January 19, 2021 Posted January 19, 2021 Has this still not been fixed? You could try this workflow instead. It does what this one is supposed to do.
Skone Posted September 21, 2021 Posted September 21, 2021 So glad you made this one Dean. If Alfred has access to the calendars, do you need to separately allow the workflow access to calendar? No prompt has come up, and the workflow isn't pulling up any upcoming meetings even after tweaking the event across different calendars and adjusting the config.
deanishe Posted September 23, 2021 Posted September 23, 2021 On 9/21/2021 at 11:09 PM, bazerman said: If Alfred has access to the calendars, do you need to separately allow the workflow access to calendar? I don’t think so, no. If it isn’t working, please check Alfred’s workflow debugger and the log file (enter .vc workflow:openlog into Alfred) for an error message.
Skone Posted September 25, 2021 Posted September 25, 2021 Thanks Dean - it looks like it's finding my calendar events but not picking up any of the conference URLs :39:02 video-conferences.py:65 DEBUG max_cache_age=300 14:39:02 video-conferences.py:67 DEBUG lookahead_days=5 14:39:02 video-conferences.py:82 DEBUG regex=https://teams\.live\.com/meet/[a-z0-9]+ 14:39:02 video-conferences.py:82 DEBUG regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)? 14:39:02 video-conferences.py:82 DEBUG regex=https://meet\.google\.com/[a-z-]+ 14:39:02 video-conferences.py:82 DEBUG regex=https://[a-z0-9]+\.zoom\.us/[a-z0-9_.-]+/\d+\?pwd=[a-z0-9]+ 14:39:02 video-conferences.py:76 DEBUG calendar='Default' 14:39:02 video-conferences.py:82 DEBUG regex=https://([a-z0-9]+\.)?zoom\.us/j/\d+(\?pwd=[a-z0-9]+)? 14:39:02 video-conferences.py:82 DEBUG regex=https://meet\.lync\.com/[a-z0-9_.-]+/[a-z0-9_.-]+/[a-z0-9]+ 14:39:02 video-conferences.py:82 DEBUG regex=https://teams\.microsoft\.com/l/meetup-join/[a-zA-Z0-9/%?&=._-]+ 14:39:02 workflow.py:1695 DEBUG loading cached data: /Users/name/Library/Caches/com.runningwithcrayons.Alfred/Workflow Data/net.deanishe.alfred.video-conferences/events.cpickle 14:39:02 video-conferences.py:245 DEBUG 0/90 event(s) in specified accounts & calendars are video conferences 14:39:02 workflow.py:1468 DEBUG reading settings from /Users/name/Library/Application Support/Alfred/Workflow Data/net.deanishe.alfred.video-conferences/settings.json
deanishe Posted September 26, 2021 Posted September 26, 2021 That doesn’t tell me anything, I'm afraid. That looks like the debugger output. Look in the log file (type .vc workflow:openlog into Alfred). Calendar events are fetched by a background job, so there’s no output in the debugger. Use .vc reload to force the workflow to reload your events from Calendar.app. If there's no info in there, then please post details of one of your events that the workflow isn't finding.
kvn Posted October 26, 2022 Posted October 26, 2022 Great workflow, thanks! One feedback on my side: it would be great to be able to filter the conferences shown by selecting the calendar - as I am using separate calendars for work, private, events, etc., I wish to be able to select only the work one for the workflow.
ronaldgevern Posted January 5, 2023 Posted January 5, 2023 On 11/26/2020 at 3:56 AM, JuanDz said: TypeError: unhashable type: 'list' TypeError: unhashable type: 'list' usually means that you are trying to use a list as an hash argument. This means that when you try to hash an unhashable object it will result an error. For ex. when you use a list as a key in the dictionary , this cannot be done because lists can't be hashed. The standard way to solve this issue is to cast a list to a tuple . So, in order to fix unhashable type: 'list', you'll have to change your list into tuples if you want to put them as keys in your dictionary . my_dict = {'name': 'John', tuple([1,2,3]):'values'} print(my_dict) The hash() is a built-in python method, used to return a unique number . This can be applied to any user-defined object which won’t get changed once initialized. This property is used mainly in dictionary keys .
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now