Jump to content

Today View for Google Calendar and Microsoft Exchange


Recommended Posts

So I'm using the Google Calendar API which uses OAuth.  It appears to create a local mini-webserver and use that to connect whit eh Google API to download the credentials.  I'm currently working on setting up 3 thigns

 

1) MUCH better logging so that you can see in the logs if there is an error with oAuth stuff (aka can't bind to a socket)

 

2) The ability to kill the server task if its left running somehow.  In my testing it appears sometimes it doesn't auth correctly and then blocks further auth request until you issue a

 

pkill -f python

3) I'll add directions on how to manually authenticate.  

 

Right now you might  be able to 

* Right click on Alfred Today and select 'Open in Terminal'

* Then type  python authorize_google.py but i'm not sure if its setup correctly in the current build.  I was hoping to make a much "cleaner" way for people to do this.  

 

 

Link to comment

Thanks a lot for your hard work on this issue.

 

Solution 3 in your previous post didn't work for me. Here is what Terminal showed during the process if this may help :

 

If your browser is on a different machine then exit and re-run this
application with the command-line parameter 

  --noauth_local_webserver

Traceback (most recent call last):
  File "authorize_google.py", line 64, in <module>
    main()
  File "authorize_google.py", line 60, in main
    credentials = get_credentials()
  File "authorize_google.py", line 53, in get_credentials
    credentials = tools.run_flow(flow, store, flags, http=HTTP_INSTANCE)
  File "lib/oauth2client/util.py", line 135, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "lib/oauth2client/tools.py", line 235, in run_flow
    credential = flow.step2_exchange(code, http=http)
  File "lib/oauth2client/util.py", line 135, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "lib/oauth2client/client.py", line 2117, in step2_exchange
    headers=headers)
  File "lib/httplib2/__init__.py", line 1609, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "lib/httplib2/__init__.py", line 1351, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "lib/httplib2/__init__.py", line 1272, in _conn_request
    conn.connect()
  File "lib/httplib2/__init__.py", line 1036, in connect
    self.disable_ssl_certificate_validation, self.ca_certs)
  File "lib/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 911, in wrap_socket
    ciphers=ciphers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 520, in __init__
    self._context.load_verify_locations(ca_certs)
IOError: [Errno 2] No such file or directory

 

Link to comment
6 hours ago, MEs said:

Thanks a lot for your hard work on this issue.

 

Solution 3 in your previous post didn't work for me. Here is what Terminal showed during the process if this may help :

 


If your browser is on a different machine then exit and re-run this
application with the command-line parameter 

  --noauth_local_webserver

Traceback (most recent call last):
  File "authorize_google.py", line 64, in <module>
    main()
  File "authorize_google.py", line 60, in main
    credentials = get_credentials()
  File "authorize_google.py", line 53, in get_credentials
    credentials = tools.run_flow(flow, store, flags, http=HTTP_INSTANCE)
  File "lib/oauth2client/util.py", line 135, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "lib/oauth2client/tools.py", line 235, in run_flow
    credential = flow.step2_exchange(code, http=http)
  File "lib/oauth2client/util.py", line 135, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "lib/oauth2client/client.py", line 2117, in step2_exchange
    headers=headers)
  File "lib/httplib2/__init__.py", line 1609, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "lib/httplib2/__init__.py", line 1351, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "lib/httplib2/__init__.py", line 1272, in _conn_request
    conn.connect()
  File "lib/httplib2/__init__.py", line 1036, in connect
    self.disable_ssl_certificate_validation, self.ca_certs)
  File "lib/httplib2/__init__.py", line 80, in _ssl_wrap_socket
    cert_reqs=cert_reqs, ca_certs=ca_certs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 911, in wrap_socket
    ciphers=ciphers)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 520, in __init__
    self._context.load_verify_locations(ca_certs)
IOError: [Errno 2] No such file or directory

 

AHHA!!

 

I would say there is a 100% change the error is related to this call.

HTTP_INSTANCE = httplib2.Http(disable_ssl_certificate_validation=True, ca_certs="/usr/local/etc/openssl/cert.pem")

Where I work we use stupid SSL Inspection and self signed cert shenanigans.  

 

You could try changing the line to:

HTTP_INSTANCE = httplib2.Http(disable_ssl_certificate_validation=True)

Alternatively you could also try to just create a blank file at:

/usr/local/etc/openssl/cert.pem

but i'm not sure that would help.

 

I'd be curious to know which if either of these guys will fix your problem.  I'll look into sticking with no SSL verification only which "should" work (hopefully).

 

Or you could just try v3.9.1 out if you don't feel like editing anything :)

 

 

Edited by jeffsui
Link to comment

So the line is a little misleading because (and I'm not a networking master) 

 

The ca_certs file is a trust store of which SSL certificates to trust.  In my case because my office self-signs I had to add our custom certs into the trust store manually - I may have also had to create that file.  

 

The disable_ssl_certificate_validation in theory should say "who cares about the trust store just trust everything"  

 

Thus having both in there seems kind of dumb.  

 

I guess I could add some options in there to give you the choice of SSL but I think the risk of somebody spoofing either an exchange server or google to serve up fake calendar events is EXTREMELY un-likely.  But I would say its an acceptable risk.

 

My next goal is to improve the quick look view with some nice HTML templates per-chance and update the regex support to take a standard list of meeting providers at some point.  

 

Link to comment
1 hour ago, jeffsui said:

So the line is a little misleading because (and I'm not a networking master) 

 

The ca_certs file is a trust store of which SSL certificates to trust.  In my case because my office self-signs I had to add our custom certs into the trust store manually - I may have also had to create that file.  

 

The disable_ssl_certificate_validation in theory should say "who cares about the trust store just trust everything"  

 

Thus having both in there seems kind of dumb.  

 

 

I didn't read the line properly. It is pointless having both. And it's a really bad idea to disable SSL validation. By all means, do it on your own computer, but it's a rotten thing to do to your users. I actually can't understand how you think it was okay to do that. Certainly not without a big warning on the workflow.

 

It makes it possible for anyone on the same network (e.g. a public, unsecured WiFi) to intercept the traffic, and it's a piece of cake for whoever controls the router.

 

That you need to trust your employer's self-signed certificate to make the workflow work makes it sound an awful lot like that's what they're doing to you…

Link to comment

I made SSL toggle-able - but haven't figured out yet how to handle the CA_CERTS stuff yet.  I'm thinking if the file exists I'll include it in the HTTP Options... otherwise no-dice

 

New release: Toggle SSL

 

By default SSL is enabled - if you re running into issues you can turn it off i guess.

Edited by jeffsui
Link to comment

Add a CA_CERTS variable in the workflow configuration sheet and let people put a path in there if they need it?

client = httplib2.Http(ca_certs=os.getenv('CA_CERTS') or None)

AFAIK, this is the first time anyone has had an issue with CA certificates in a workflow. It's usually company proxies that are the problem.

 

Like I said, the only reason I can think of that your company would require you to trust their own self-signed cert in order for this workflow to work is so they can spy on you using the Lenovo/Superfish technique.

Link to comment
2 hours ago, deanishe said:

Add a CA_CERTS variable in the workflow configuration sheet and let people put a path in there if they need it?

 


client = httplib2.Http(ca_certs=os.getenv('CA_CERTS') or None)

 

AFAIK, this is the first time anyone has had an issue with CA certificates in a workflow. It's usually company proxies that are the problem.

 

Like I said, the only reason I can think of that your company would require you to trust their own self-signed cert in order for this workflow to work is so they can spy on you using the Lenovo/Superfish technique.

 

Yes - they perform a man-in-the-middle attack on all traffic in and out. :)

 

(new version being posted ... had a small bug in not passing the workflow variable around)

 

https://github.com/jeeftor/alfredToday/releases/tag/v3.9.3

 

Link to comment

Hi Jeffsui,

 

I have finally a new message when typing today or tomorrow. It says my calendar is empty, when in fact it is not.

I have 6 calendars in My Calendars, so I tried to add an event today for each. Still nothing to show.

 

Enabling agenda for an account usually gives access to all the agendas. And I can now see "Alfred Today Workflow" in the authorized applications.

 

15:55:04 workflow.py:2156 DEBUG    Workflow version : 3.9.7
15:55:04 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
15:55:04 workflow.py:2438 DEBUG    Update check not due
15:55:04 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
15:55:04 workflow.py:2368 DEBUG    update_data : {u'available': False}
15:55:04 workflow.py:1335 DEBUG    Opening workflow log file
15:55:04 workflow.py:2194 DEBUG    Workflow finished in 0.082 seconds.
15:55:06 today.py:280 INFO             ______          __
15:55:06 today.py:281 INFO            /_  __/___  ____/ /___ ___  __
15:55:06 today.py:282 INFO             / / / __ \/ __  / __ `/ / / /
15:55:06 today.py:283 INFO            / / / /_/ / /_/ / /_/ / /_/ /
15:55:06 today.py:284 INFO           /_/  \____/\__,_/\__,_/\__, /
15:55:06 today.py:285 INFO                                 /____/
15:55:06 workflow.py:2156 DEBUG    Workflow version : 3.9.7
15:55:06 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
15:55:06 workflow.py:2438 DEBUG    Update check not due
15:55:06 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
15:55:06 workflow.py:2368 DEBUG    update_data : {u'available': False}
15:55:06 today.py:41 DEBUG    query : u'1'
15:55:06 today.py:83 DEBUG    -- FG: CacheKey (Google)   google.Tomorrow
15:55:06 today.py:84 DEBUG    -- FG: CacheKey (Exchange) exchange.Tomorrow
15:55:06 today.py:99 DEBUG    Max Age: 10  Cache Age Google:  136   Exchange: 0
15:55:06 today.py:121 DEBUG    --FG:   Use Exchange:False
15:55:06 today.py:122 DEBUG    --FG: Exchange Fresh:False
15:55:06 query_google.py:13 INFO     BG: Querying Google Calendar
15:55:06 query_google.py:14 INFO     BG:     param: start_google = 2016-09-17T04:00:01.297339+00:00
15:55:06 query_google.py:15 INFO     BG:     param:   end_google = 2016-09-18T03:59:59.297386+00:00
15:55:06 query_google.py:16 INFO     BG:     param:   date_offset = 1
15:55:06 query_google.py:61 INFO     * Google returned 0 events
15:55:06 workflow.py:1834 DEBUG    Cached data saved at : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/google.Tomorrow.cpickle
15:55:06 today.py:242 INFO     Event Count   Google: 0
15:55:06 today.py:243 INFO     Event Count Exchange: 0
15:55:06 today.py:244 INFO     Event Count    Total: 0
15:55:06 workflow.py:2351 DEBUG    Set last run version : 3.9.7
15:55:06 workflow.py:2194 DEBUG    Workflow finished in 0.435 seconds.
15:55:07 today.py:280 INFO             ______          __
15:55:07 today.py:281 INFO            /_  __/___  ____/ /___ ___  __
15:55:07 today.py:282 INFO             / / / __ \/ __  / __ `/ / / /
15:55:07 today.py:283 INFO            / / / /_/ / /_/ / /_/ / /_/ /
15:55:07 today.py:284 INFO           /_/  \____/\__,_/\__,_/\__, /
15:55:07 today.py:285 INFO                                 /____/
15:55:07 workflow.py:2156 DEBUG    Workflow version : 3.9.7
15:55:07 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
15:55:07 workflow.py:2438 DEBUG    Update check not due
15:55:07 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
15:55:07 workflow.py:2368 DEBUG    update_data : {u'available': False}
15:55:07 today.py:41 DEBUG    query : u'0'
15:55:07 today.py:83 DEBUG    -- FG: CacheKey (Google)   google.Today
15:55:07 today.py:84 DEBUG    -- FG: CacheKey (Exchange) exchange.Today
15:55:07 today.py:99 DEBUG    Max Age: 10  Cache Age Google:  137   Exchange: 0
15:55:07 today.py:121 DEBUG    --FG:   Use Exchange:False
15:55:07 today.py:122 DEBUG    --FG: Exchange Fresh:False
15:55:07 query_google.py:13 INFO     BG: Querying Google Calendar
15:55:07 query_google.py:14 INFO     BG:     param: start_google = 2016-09-16T04:00:01.165240+00:00
15:55:07 query_google.py:15 INFO     BG:     param:   end_google = 2016-09-17T03:59:59.165285+00:00
15:55:07 query_google.py:16 INFO     BG:     param:   date_offset = 0
15:55:07 query_google.py:61 INFO     * Google returned 0 events
15:55:07 workflow.py:1834 DEBUG    Cached data saved at : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/google.Today.cpickle
15:55:07 today.py:242 INFO     Event Count   Google: 0
15:55:07 today.py:243 INFO     Event Count Exchange: 0
15:55:07 today.py:244 INFO     Event Count    Total: 0
15:55:07 workflow.py:2351 DEBUG    Set last run version : 3.9.7
15:55:07 workflow.py:2194 DEBUG    Workflow finished in 0.361 seconds.
15:55:21 today.py:280 INFO             ______          __
15:55:21 today.py:281 INFO            /_  __/___  ____/ /___ ___  __
15:55:21 today.py:282 INFO             / / / __ \/ __  / __ `/ / / /
15:55:21 today.py:283 INFO            / / / /_/ / /_/ / /_/ / /_/ /
15:55:21 today.py:284 INFO           /_/  \____/\__,_/\__,_/\__, /
15:55:21 today.py:285 INFO                                 /____/
15:55:21 workflow.py:2156 DEBUG    Workflow version : 3.9.7
15:55:21 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
15:55:21 workflow.py:2438 DEBUG    Update check not due
15:55:21 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
15:55:21 workflow.py:2368 DEBUG    update_data : {u'available': False}
15:55:21 today.py:41 DEBUG    query : u'1'
15:55:21 today.py:83 DEBUG    -- FG: CacheKey (Google)   google.Tomorrow
15:55:21 today.py:84 DEBUG    -- FG: CacheKey (Exchange) exchange.Tomorrow
15:55:21 today.py:99 DEBUG    Max Age: 10  Cache Age Google:  15   Exchange: 0
15:55:21 today.py:121 DEBUG    --FG:   Use Exchange:False
15:55:21 today.py:122 DEBUG    --FG: Exchange Fresh:False
15:55:21 query_google.py:13 INFO     BG: Querying Google Calendar
15:55:21 query_google.py:14 INFO     BG:     param: start_google = 2016-09-17T04:00:01.875515+00:00
15:55:21 query_google.py:15 INFO     BG:     param:   end_google = 2016-09-18T03:59:59.875562+00:00
15:55:21 query_google.py:16 INFO     BG:     param:   date_offset = 1
15:55:22 query_google.py:61 INFO     * Google returned 0 events
15:55:22 workflow.py:1834 DEBUG    Cached data saved at : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/google.Tomorrow.cpickle
15:55:22 today.py:242 INFO     Event Count   Google: 0
15:55:22 today.py:243 INFO     Event Count Exchange: 0
15:55:22 today.py:244 INFO     Event Count    Total: 0
15:55:22 workflow.py:2351 DEBUG    Set last run version : 3.9.7
15:55:22 workflow.py:2194 DEBUG    Workflow finished in 0.381 seconds.

Logs seems ok, or I missed something wrong here ?

Link to comment

MEs,

 

I just threw together a quick new build: Pre-Release: Updated quick start.py

 

I updated the quickstart.py script (which you have to run from hand) to print out each calendar your are subscribed to and a list of events on that calendar.  

 

You need to open a terminal to the workflow directory and type python quickstart.py.  Let me know what happens.  

 

Some sample output:

 

 

Quote


********************************************
Name: Contacts ACL: reader   Calendar ID: #contacts@group.v.calendar.google.com
2016-09-19 xxxx birthday
2016-09-29 xxxx birthday
2016-10-01 xxx birthday
2016-10-02 xxx  birthday
2016-10-04 xxx  birthday
2016-10-26 xxx birthday
2016-10-31 xxx  birthday
2016-11-08 xxx  birthday
2016-11-10 xxxx birthday

********************************************
Name: Holidays in United States ACL: reader   Calendar ID: en.usa#holiday@group.v.calendar.google.com
2016-10-10 Columbus Day (regional holiday)
2016-10-31 Halloween
2016-11-06 Daylight Saving Time ends
2016-11-08 Election Day

 

Hopefully this will answer some of the question as to why you aren't seeing anything.  I think the next logical step is to allow for customization of which calendars to load and which to not show - but at least lets see if you have any data we can pull down.

Link to comment

Thanks a lot for this release.

 

I updated the workflow with your release 3.9.8 and then launched the command you asked for. And it seems it is getting to my calendars. Here is what it shows in the terminal :

 

********************************************
Name: Pédiatrie ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-16 CB à NEF
2016-09-19T14:00:00+02:00 Resultats audition tournan
2016-09-19T18:30:00+02:00 Groupe psychomot (SG)
2016-09-21T17:00:00+02:00 Rappels parents - CC
2016-09-22T09:00:00+02:00 Jvr neonat CB
2016-09-22T14:00:00+02:00 Staff inter rea
2016-09-23T09:30:00+02:00 Médecine du travail CC
2016-09-26T09:30:00+02:00 GT PED reseau
2016-09-26T18:30:00+02:00 Groupe psychomot (SG + CC)
2016-09-27T10:00:00+02:00 Psychomot - Mme CHAURAND et Mme Bernard

********************************************
Name: VFF ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-19T06:00:00Z Céline NEF
2016-09-22T06:30:00Z Céline AG CDOSF 77 + Formation VFF à CDOSF77
2016-09-26T06:00:00Z Céline NEF
2016-10-03T06:00:00Z Céline NEF
2016-10-06T07:00:00Z Réunion VFF / CC + MD + CCa
2016-10-07T07:00:00Z Céline : Mise en place réseau violences intra-familiales
2016-10-10T06:00:00Z Céline NEF
2016-10-11T12:00:00Z Céline Formation VFF
2016-10-13T13:00:00Z Céline Formation VFF
2016-10-17T06:00:00Z Céline NEF

********************************************
Name: Transversal ACL: owner   Calendar ID: xxxxxx@gmail.com
2016-09-20T09:00:00+02:00 Rencontre réseau ACsanté93 -  CCa - EH
2016-09-20T18:30:00+02:00 Copil RMM
2016-09-22 Journée Dépression Périnatale
2016-09-26T19:00:00+02:00 Soirée Gala Maison des femmes à confirmer
2016-09-29T19:30:00+02:00 Soirée Débat Clinique Vauban
2016-10-03T12:00:00+02:00 Pot de départ Jessy
2016-10-03T18:30:00+02:00 Réunion Gradation des soins
2016-10-04T10:00:00+02:00 COPIL HYGIE
2016-10-04T14:00:00+02:00 Veille documentaire
2016-10-06T14:00:00+02:00 CLS Epinay-sur-Seine

********************************************
Name: D-E ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-19 MAIL RAPPEL 22/09
2016-09-19 PROPOSER DATE AMARENCO
2016-09-19 CLINIQUE TOURNAN AVEC CARO
2016-09-23 FAIRE MAIL VVF

********************************************
Name: CP / RTT ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-21 CP/RTT EH
2016-09-26 CP/RTT EH
2016-10-03 Retour Sonia
2016-11-04 CP/RTT EH
2016-11-07 CP/RTT EH

********************************************
Name: Obstétrique ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-23T09:30:00+02:00 Présentation RéMI + Réseau
2016-09-29T18:00:00+02:00 Rencontre SF CH delafontaine
2016-10-06T09:00:00+02:00 Réunion VFF /  CC + MD + CCa + DV
2016-10-07T13:30:00+02:00 Séminaire SF
2016-10-11T10:00:00+02:00 TIU - Club utilisateur
2016-10-13 46ème journées de le SFMP
2016-10-13T14:30:00+02:00 Réunion SF réseau de proximité CD 93
2016-10-17 CLS Tremblay à confirmer
2016-10-18 CLS Tremblay à confirmer
2016-11-07 FORMATION EPP

********************************************
Name: Coord Admin ACL: owner   Calendar ID: xxxxxx@group.calendar.google.com
2016-09-26T12:00:00+02:00 Dispo FFRSP
2016-09-27T12:00:00+02:00 Dispo FFRSP
2016-10-11T12:00:00+02:00 Dispo FFRSP
2016-10-18 Journée ReSIF

********************************************
Name: Site web ACL: owner   Calendar ID: myemail@gmail.com
2016-09-22T08:30:00+02:00 Journée Dépression Périnatale
2016-09-26 Journée de lutte contre la douleur
2016-09-26T20:30:00+02:00 Soirée : Ensemble pour la maison de la femme
2016-09-29T19:30:00+02:00 Soirée Débat Clinique Vauban
2016-10-06 Entretien Bichat
2016-10-12 46ème journées de le SFMP
2016-10-14T09:00:00+02:00 11ème Journée des Réseaux
2016-11-07T09:00:00+01:00 FORMATION EPP
2016-11-08T09:00:00+01:00 FORMATION EPP
2016-11-09T09:00:00+01:00 FORMATION EPP
Getting the upcoming 10 events
2016-09-22T08:30:00+02:00 Journée Dépression Périnatale
2016-09-26 Journée de lutte contre la douleur
2016-09-26T20:30:00+02:00 Soirée : Ensemble pour la maison de la femme
2016-09-29T19:30:00+02:00 Soirée Débat Clinique Vauban
2016-10-06 Entretien Bichat
2016-10-12 46ème journées de le SFMP
2016-10-14T09:00:00+02:00 11ème Journée des Réseaux
2016-11-07T09:00:00+01:00 FORMATION EPP
2016-11-08T09:00:00+01:00 FORMATION EPP
2016-11-09T09:00:00+01:00 FORMATION EPP

But it is still saying my calendar is empty on Alfred.

 

Sorry to bother you with all this... But I really don't know anything about python :/

 

EDIT : An event scheduled for today is missing from what the terminal pulled. It is an event from the calendar Transversal.

I also added an event and launched again the quickstart.py, the ne event was properly added (for tomorrow), but the "Tomorrow" in Alfred is also giving me back an empty hand.

Edited by MEs
Link to comment

This is very helpfu. I didn't change the main code yet so it should still not work for you but I have an idea what is maybe causing issue. 

 

What test shows if we pull the correct calendar Id we get events.  Currently it's hard coded to pull some default calendar that maybe doesn't exist for everybody. 

 

This weekend I'll try to add a feature to better access either the right calendars or give you a list of calendars. I think it's hard coded to something that perhaps doesn't work for everybody 

 

the other thing I need to check is time zone issues. 

 

Link to comment

I have a rough version of multi-calendar support up and running now.

 

https://github.com/jeeftor/alfredToday/releases/tag/v3.9.9

 

Things aren't super polished but I refactored all the google stuff into a single class that can query calendars and events.  Its a little slower than i like right now (2-3 seconds) to get a list of all the available calendars from google but its a good start. 

I was able to pull 3 different events from 3 different calendars down - so thats awesome.

 

I added a new command Alfred Today-Configure Google Calendars (tcgc).  This command will query google to get a calendar list and then you can enable/disable which ever you want.  By default all calendars will be disabled i think - so you may need to do this before anything else happens. 

 

In theory things "might" work but i'm expecting you'll run into some bug i missed because I wrote this in the middle of the night ... thank you insomnia :)

 

https://github.com/jeeftor/alfredToday/releases/tag/v3.9.9

 

 

 

Link to comment

It works !

And the tcgc command is an excellent idea !

 

I don't know what may not be polished. to me everything seems great. And since you used a Open URL action, I was able to trigger my "work" browser specifically for this action (since I use Google Calendar for work only, iCloud is my personal one)

 

One question, is there any configuration about what the workflow is pulling from an event appart it's title and time ?

 

I hope Google won't change how their Calendar works too often. The workflow "Google Translate" for example can not work anymore because of Google refusing access to some APIs :/ 

Link to comment

MEs you asked what fields i'm capturing - right now time, location, hangout URL, and meeting name (i think).

 

For exchange I actually pull the meeting body out and create a temp file that is connected to quick look.  I'm hoping to add this eventually as well as some other things like iCloud calendar, better meeting detection URLs and update the meeting QuickLook template.  

 

I made a 4.0:

4.0 IS READY FOR ACTION!

 

Each calendar has a unique event icon to match its color code.  In theory should be the same as the color it shows up in your cal i think.

 

 

 

Link to comment

Ok thanks for the field.

 

Unfortunately, seems like there is a bug. I am getting this message :

Error in org.jeef.today

Same error if I type Today, Tomorrow or tcgc commands :/

 

And even trying to downgrade to 3.9.9 is not helping so far. I tried to delete the org.jeef.today in my Library, but no more luck.

 

Here is the log :

04:33:39 workflow.py:2156 DEBUG    Workflow version : 3.9.9
04:33:39 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:33:39 workflow.py:2438 DEBUG    Update check not due
04:33:39 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
04:33:39 workflow.py:2368 DEBUG    update_data : {u'available': False}
04:33:39 workflow.py:1335 DEBUG    Opening workflow log file
04:33:39 workflow.py:2194 DEBUG    Workflow finished in 0.067 seconds.
04:33:40 today.py:280 INFO             ______          __
04:33:40 today.py:281 INFO            /_  __/___  ____/ /___ ___  __
04:33:40 today.py:282 INFO             / / / __ \/ __  / __ `/ / / /
04:33:40 today.py:283 INFO            / / / /_/ / /_/ / /_/ / /_/ /
04:33:40 today.py:284 INFO           /_/  \____/\__,_/\__,_/\__, /
04:33:40 today.py:285 INFO                                 /____/
04:33:40 workflow.py:2156 DEBUG    Workflow version : 3.9.9
04:33:40 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:33:40 workflow.py:2438 DEBUG    Update check not due
04:33:41 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
04:33:41 workflow.py:2368 DEBUG    update_data : {u'available': False}
04:33:41 today.py:41 DEBUG    query : u'0'
04:33:41 today.py:83 DEBUG    -- FG: CacheKey (Google)   google.Today
04:33:41 today.py:84 DEBUG    -- FG: CacheKey (Exchange) exchange.Today
04:33:41 today.py:99 DEBUG    Max Age: 9000  Cache Age Google:  0   Exchange: 0
04:33:41 today.py:121 DEBUG    --FG:   Use Exchange:False
04:33:41 today.py:122 DEBUG    --FG: Exchange Fresh:False
04:33:41 query_google.py:15 INFO     BG: Querying Google Calendar
04:33:41 query_google.py:16 INFO     BG:     param: start_google = 2016-09-18T04:00:01.099203+00:00
04:33:41 query_google.py:17 INFO     BG:     param:   end_google = 2016-09-19T03:59:59.099251+00:00
04:33:41 query_google.py:18 INFO     BG:     param:   date_offset = 0
04:33:41 workflow.py:2174 ERROR    
Traceback (most recent call last):
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/workflow/workflow.py", line 2167, in run
    func(self)
  File "today.py", line 190, in main
    google_events = wf.cached_data(google_cache_key, google_wrapper, max_age=cache_time)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/workflow/workflow.py", line 1805, in cached_data
    data = data_func()
  File "today.py", line 68, in google_wrapper
    return query_google_calendar(wf, start_google, stop_google, date_offset)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/query_google.py", line 20, in query_google_calendar
    g = GoogleInterface(wf)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/GoogleInterface.py", line 46, in __init__
    self._authorize_google()
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/GoogleInterface.py", line 61, in _authorize_google
    self.__check_auth_status()
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.C99E7FD4-A6BA-4BCD-93BD-8B8939AB286F/GoogleInterface.py", line 55, in __check_auth_status
    raise AuthorizationNeededException()
AuthorizationNeededException
04:33:41 workflow.py:2177 INFO     For assistance, see: https://github.com/jeeftor/alfredToday/blob/master/README.md
04:33:41 workflow.py:2194 DEBUG    Workflow finished in 0.124 seconds.

 

EDIT : Maybe a clue...

I tried to remove again org.jeef.today and the plugin, than re-install 3.9.8. There I noticed that enabling Google Calendar was again asking me to authorize access by loading the page in my browser.

After what, it was telling me there is no data to load.

I updated to 3.9.9, used tcgc to enable some of my calendars and everything is back on track !

 

So I tried to update to 4.0.0, and it was able to display the tomorrow events that has been cached. But if I change the cache time to anything lower than the default 9000 sec, the error message would be back, plus a "too many values to unpack" under it.

 

This time, I removed the plugin and the org.jeef.today and installed directly the 3.9.9

Had to re-enable Google Calendar (no browser loaded this time to authorize it), enable some calendars with tcgc, and everything is fine again (checked by adding an event to check if it will show up)

 

I hope this helps...

 

More logs in case it helps:

 

04:45:01 store_data.py:70 DEBUG          _______________  ____  ______  
04:45:01 store_data.py:71 DEBUG         / ___/_  __/ __ \/ __ \/ ____/  
04:45:01 store_data.py:72 DEBUG         \__ \ / / / / / / /_/ / __/  
04:45:01 store_data.py:73 DEBUG        ___/ // / / /_/ / _, _/ /___  
04:45:01 store_data.py:74 DEBUG       /____//_/  \____/_/ |_/_____/  DATA  
04:45:01 store_data.py:75 DEBUG         
04:45:01 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:01 store_data.py:19 DEBUG            Key: cache_time
04:45:01 store_data.py:20 DEBUG          Value: 9000
04:45:01 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:01 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:01 workflow.py:2194 DEBUG    Workflow finished in 0.153 seconds.
04:45:03 settings.py:289 DEBUG           _____ _______________________   _____________
04:45:03 settings.py:290 DEBUG          / ___// ____/_  __/_  __/  _/ | / / ____/ ___/
04:45:03 settings.py:291 DEBUG          \__ \/ __/   / /   / /  / //  |/ / / __ \__ \
04:45:03 settings.py:292 DEBUG         ___/ / /___  / /   / / _/ // /|  / /_/ /___/ /
04:45:03 settings.py:293 DEBUG        /____/_____/ /_/   /_/ /___/_/ |_/\____//____/
04:45:03 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:03 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:03 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:03 workflow.py:2194 DEBUG    Workflow finished in 0.001 seconds.
04:45:03 today.py:290 INFO             ______          __
04:45:03 today.py:291 INFO            /_  __/___  ____/ /___ ___  __
04:45:03 today.py:292 INFO             / / / __ \/ __  / __ `/ / / /
04:45:03 today.py:293 INFO            / / / /_/ / /_/ / /_/ / /_/ /
04:45:03 today.py:294 INFO           /_/  \____/\__,_/\__,_/\__, /
04:45:03 today.py:295 INFO                                 /____/
04:45:03 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:03 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:03 workflow.py:2438 DEBUG    Update check not due
04:45:04 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
04:45:04 workflow.py:2368 DEBUG    update_data : {u'available': False}
04:45:04 today.py:43 DEBUG    query : u'1'
04:45:04 today.py:67 INFO     2016-09-19T04:00:01.089443+00:00			2016-09-20T03:59:59.089491+00:00
04:45:04 today.py:86 DEBUG    -- FG: CacheKey (Google)   google.Tomorrow
04:45:04 today.py:87 DEBUG    -- FG: CacheKey (Exchange) exchange.Tomorrow
04:45:04 today.py:105 DEBUG    Max Age: 9000  Cache Age Google:  266   Exchange: 0
04:45:04 today.py:127 DEBUG    --FG:   Use Exchange:False
04:45:04 today.py:128 DEBUG    --FG: Exchange Fresh:False
04:45:04 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/google.Tomorrow.cpickle
04:45:04 background.py:188 DEBUG    Command arguments cached to `/Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/update_google.argcache`
04:45:04 background.py:192 DEBUG    Calling [u'/usr/bin/python', '/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/workflow/background.pyc', 'update_google'] ...
04:45:04 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:04 workflow.py:2194 DEBUG    Workflow finished in 0.019 seconds.
04:45:04 workflow.py:2194 DEBUG    Workflow finished in 0.020 seconds.
04:45:04 background.py:236 DEBUG    Task `update_google` running
04:45:04 background.py:237 DEBUG    cmd : ['/usr/bin/python', u'/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py', '2016-09-19T04:00:01.089443+00:00', '2016-09-20T03:59:59.089491+00:00', '1']
04:45:04 background.py:197 DEBUG    Executing task `update_google` in background...
04:45:04 today.py:231 DEBUG    **FG --- Google: 2016-09-19T14:00:00+02:00 Resultats audition tournan
04:45:04 today.py:231 DEBUG    **FG --- Google: 2016-09-19T18:30:00+02:00 Groupe psychomot (SG)
04:45:04 today.py:250 INFO     Event Count   Google: 2
04:45:04 today.py:251 INFO     Event Count Exchange: 0
04:45:04 today.py:252 INFO     Event Count    Total: 2
04:45:04 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:04 workflow.py:2194 DEBUG    Workflow finished in 0.192 seconds.
04:45:04 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:04 query_google.py:25 DEBUG    BG GOOGLE: STARTED
04:45:04 query_google.py:36 DEBUG    BG: query : u'2016-09-19T04:00:01.089443+00:00'
04:45:04 query_google.py:42 DEBUG    [u'2016-09-19T04:00:01.089443+00:00', u'2016-09-20T03:59:59.089491+00:00', u'1']
04:45:04 query_google.py:63 DEBUG    -- BG: CacheKey  (Google)   google.Tomorrow
04:45:04 query_google.py:64 DEBUG    -- BG: NotifyKey (Google)   Tomorrow
04:45:04 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/google.Tomorrow.cpickle
04:45:04 query_google.py:15 INFO     BG: Querying Google Calendar
04:45:04 query_google.py:16 INFO     BG:     param: start_google = 2016-09-19T04:00:01.089443+00:00
04:45:04 query_google.py:17 INFO     BG:     param:   end_google = 2016-09-20T03:59:59.089491+00:00
04:45:04 query_google.py:18 INFO     BG:     param:   date_offset = 1
04:45:04 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:04 workflow.py:2174 ERROR    need more than 1 value to unpack
Traceback (most recent call last):
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/workflow/workflow.py", line 2167, in run
    func(self)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py", line 69, in main
    new_events = wrapper()
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py", line 56, in wrapper
    return query_google_calendar(wf, start_google, stop_google, date_offset)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py", line 21, in query_google_calendar
    return g.get_events_for_enabled_calendars(start_search, end_search)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/GoogleInterface.py", line 140, in get_events_for_enabled_calendars
    enabled,color = self.wf.settings.get(key).get('value').split('\t')
ValueError: need more than 1 value to unpack
04:45:04 workflow.py:2194 DEBUG    Workflow finished in 0.056 seconds.
04:45:04 background.py:243 ERROR    Command failed with [1] : ['/usr/bin/python', u'/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py', '2016-09-19T04:00:01.089443+00:00', '2016-09-20T03:59:59.089491+00:00', '1']
04:45:04 background.py:248 DEBUG    Task `update_google` finished
04:45:04 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:04 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:04 workflow.py:2194 DEBUG    Workflow finished in 0.230 seconds.
04:45:16 settings.py:289 DEBUG           _____ _______________________   _____________
04:45:16 settings.py:290 DEBUG          / ___// ____/_  __/_  __/  _/ | / / ____/ ___/
04:45:16 settings.py:291 DEBUG          \__ \/ __/   / /   / /  / //  |/ / / __ \__ \
04:45:16 settings.py:292 DEBUG         ___/ / /___  / /   / / _/ // /|  / /_/ /___/ /
04:45:16 settings.py:293 DEBUG        /____/_____/ /_/   /_/ /___/_/ |_/\____//____/
04:45:16 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:16 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:16 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:16 workflow.py:2194 DEBUG    Workflow finished in 0.001 seconds.
04:45:18 store_data.py:70 DEBUG          _______________  ____  ______  
04:45:18 store_data.py:71 DEBUG         / ___/_  __/ __ \/ __ \/ ____/  
04:45:18 store_data.py:72 DEBUG         \__ \ / / / / / / /_/ / __/  
04:45:18 store_data.py:73 DEBUG        ___/ // / / /_/ / _, _/ /___  
04:45:18 store_data.py:74 DEBUG       /____//_/  \____/_/ |_/_____/  DATA  
04:45:18 store_data.py:75 DEBUG         
04:45:18 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:18 store_data.py:19 DEBUG            Key: cache_time
04:45:18 store_data.py:20 DEBUG          Value: 90
04:45:18 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:18 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:18 workflow.py:2194 DEBUG    Workflow finished in 0.155 seconds.
04:45:20 settings.py:289 DEBUG           _____ _______________________   _____________
04:45:20 settings.py:290 DEBUG          / ___// ____/_  __/_  __/  _/ | / / ____/ ___/
04:45:20 settings.py:291 DEBUG          \__ \/ __/   / /   / /  / //  |/ / / __ \__ \
04:45:20 settings.py:292 DEBUG         ___/ / /___  / /   / / _/ // /|  / /_/ /___/ /
04:45:20 settings.py:293 DEBUG        /____/_____/ /_/   /_/ /___/_/ |_/\____//____/
04:45:20 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:20 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:20 workflow.py:2351 DEBUG    Set last run version : 4.0.0
04:45:20 workflow.py:2194 DEBUG    Workflow finished in 0.001 seconds.
04:45:27 today.py:290 INFO             ______          __
04:45:27 today.py:291 INFO            /_  __/___  ____/ /___ ___  __
04:45:27 today.py:292 INFO             / / / __ \/ __  / __ `/ / / /
04:45:27 today.py:293 INFO            / / / /_/ / /_/ / /_/ / /_/ /
04:45:27 today.py:294 INFO           /_/  \____/\__,_/\__,_/\__, /
04:45:27 today.py:295 INFO                                 /____/
04:45:27 workflow.py:2156 DEBUG    Workflow version : 4.0.0
04:45:27 workflow.py:1568 DEBUG    Reading settings from `/Users/EH/Library/Application Support/Alfred 3/Workflow Data/org.jeef.today/settings.json` ...
04:45:27 workflow.py:2438 DEBUG    Update check not due
04:45:27 workflow.py:1799 DEBUG    Loading cached data from : /Users/EH/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/org.jeef.today/__workflow_update_status.cpickle
04:45:27 workflow.py:2368 DEBUG    update_data : {u'available': False}
04:45:27 today.py:43 DEBUG    query : u'1'
04:45:27 today.py:67 INFO     2016-09-19T04:00:01.889533+00:00			2016-09-20T03:59:59.889581+00:00
04:45:27 today.py:86 DEBUG    -- FG: CacheKey (Google)   google.Tomorrow
04:45:27 today.py:87 DEBUG    -- FG: CacheKey (Exchange) exchange.Tomorrow
04:45:27 today.py:105 DEBUG    Max Age: 90  Cache Age Google:  289   Exchange: 0
04:45:27 today.py:127 DEBUG    --FG:   Use Exchange:False
04:45:27 today.py:128 DEBUG    --FG: Exchange Fresh:False
04:45:27 query_google.py:15 INFO     BG: Querying Google Calendar
04:45:27 query_google.py:16 INFO     BG:     param: start_google = 2016-09-19T04:00:01.889533+00:00
04:45:27 query_google.py:17 INFO     BG:     param:   end_google = 2016-09-20T03:59:59.889581+00:00
04:45:27 query_google.py:18 INFO     BG:     param:   date_offset = 1
04:45:27 workflow.py:2174 ERROR    need more than 1 value to unpack
Traceback (most recent call last):
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/workflow/workflow.py", line 2167, in run
    func(self)
  File "today.py", line 204, in main
    google_events = wf.cached_data(google_cache_key, google_wrapper, max_age=cache_time)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/workflow/workflow.py", line 1805, in cached_data
    data = data_func()
  File "today.py", line 71, in google_wrapper
    return query_google_calendar(wf, start_google, stop_google, date_offset)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/query_google.py", line 21, in query_google_calendar
    return g.get_events_for_enabled_calendars(start_search, end_search)
  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/GoogleInterface.py", line 140, in get_events_for_enabled_calendars
    enabled,color = self.wf.settings.get(key).get('value').split('\t')
ValueError: need more than 1 value to unpack
04:45:27 workflow.py:2177 INFO     For assistance, see: https://github.com/jeeftor/alfredToday/blob/master/README.md
04:45:27 workflow.py:2194 DEBUG    Workflow finished in 0.128 seconds.

 

Edited by MEs
Link to comment

Looks like we are going to need a 4.1

 

I wonder if you could check your settings.json file which you can find with: 

dbgtoday workflow:opendata 

 

Here is an example settings file.

{
  "__workflow_last_version": "4.0.1", 
  "calendar:h0agblv8sf9c6ruvb6r16e7h80@group.calendar.google.com:2": {
    "value": "1\t2"
  }, 
  "regex": {
    "value": "(https:\\\\/\\\\/meet.xxxxx.org[^\\\"]*)"
  }, 
  "use_google": {
    "value": "1"
  }
}

In a previous release I was just storing a 1 or 0 for the value command, but in this release I add a second number which is the calendars color setting.  It looks to me like the code is trying to pull the color value out but its only getting a single item - hence "need more than 1 value to unpack"  I'll try to put some protection into what i'm doing and push a new release out

  File "/Users/EH/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.BAFE509C-7940-4733-A78C-1F1BEF02EDD3/GoogleInterface.py", line 140, in get_events_for_enabled_calendars
    enabled,color = self.wf.settings.get(key).get('value').split('\t')
ValueError: need more than 1 value to unpack

 

If you dont mind checking 1st - then could you run:

dbgworkflow workflow:reset

 

which will completely delete everything in the plugin - essentially making it (i hope) like its never been run before.

 

Also new version has a nicer looking QuickLook template for both google and exchange.  

 

 

https://github.com/jeeftor/alfredToday/releases/tag/v4.1.0

Edited by jeffsui
Link to comment

Hi,

 

So here is the settings.json when I have 3.9.9 running :

{
  "__workflow_last_version": "3.9.9", 
  "calendar:9c5fm2sp93jh69uglm3tqevn0s@group.calendar.google.com": {
    "value": "1"
  }, 
  "calendar:rrnb0pc7e8ans3qva0ql55d188@group.calendar.google.com": {
    "value": "1"
  }, 
  "use_google": {
    "value": "1"
  }
}

 

Than I updated to 4.1.0 and here the the settings.json with this version :

 

{
  "__workflow_last_version": "4.1.0", 
  "calendar:9c5fm2sp93jh69uglm3tqevn0s@group.calendar.google.com": {
    "value": "1"
  }, 
  "calendar:rrnb0pc7e8ans3qva0ql55d188@group.calendar.google.com": {
    "value": "1"
  }, 
  "use_google": {
    "value": "1"
  }
}

Seems to be the same, appart from the workflow version. No difference in color by the way between the events showed , no matter what calendar they are in.

 

Than I used the command to reset

dbgworkflow workflow:reset

(just changed workflow to today, I guess you mistyped it here)

 

And it seems to be working !

 

The settings.json file :

{
  "__workflow_last_version": "4.1.0", 
  "calendar:945l8upqsp7bimpijb9hr9hcko@group.calendar.google.com:22": {
    "value": "1\t22"
  }, 
  "calendar:9c5fm2sp93jh69uglm3tqevn0s@group.calendar.google.com:16": {
    "value": "1\t16"
  }, 
  "calendar:assonef@gmail.com:3": {
    "value": "1\t3"
  }, 
  "calendar:rrnb0pc7e8ans3qva0ql55d188@group.calendar.google.com:6": {
    "value": "1\t6"
  }, 
  "use_google": {
    "value": "1"
  }
}

And a capture regarding the color rendering : (which are the same as in my Google Calendar !)

 

Screen Shot 2016-09-18 at 21.39.01.png

 

I guess this version is the perfect one ? At least to me it looks like it !

 

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...