caleb531 19 Posted November 22, 2020 Share 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 Link to post
deanishe 1,366 Posted November 23, 2020 Share 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. Link to post
JuanDz 0 Posted November 25, 2020 Share 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' Link to post
deanishe 1,366 Posted November 26, 2020 Share 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 Link to post
JuanDz 0 Posted December 15, 2020 Share Posted December 15, 2020 It worked flawlessly! 😍 Link to post
ashishb 0 Posted December 30, 2020 Share Posted December 30, 2020 (edited) How do I fix this error? Found the answer: Edited December 30, 2020 by ashishb Adding the solution Link to post
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