Felix Geller committed 2389731

Support for specifying another calendar URI. Kudos to Rasmus for this feature.

For example: download "";

Downloads mike's calendar entries, rather than steve's. Requires
access to mike's calendar...

TODO: Still need to add documentation on usage.

Comments (0)

Files changed (1)

 def date_range_query(cal_client,
+                     cal_uri,
                      max_results = 333, 
                      start_date = str( - timedelta(30)), 
                      end_date = str( + timedelta(30))):
   query.start_min = start_date
   query.start_max = end_date
   query.max_results = max_results
-  feed = cal_client.GetCalendarEventFeed(q=query)
+  feed = cal_client.GetCalendarEventFeed(q=query, uri=cal_uri)
   return feed.entry
 def date_range(start_time, end_time):
         update_event(client, event_id, fields)
       elif op == 'download':
         filename = sys.argv[3]
-        events = date_range_query(client)
+        cal_uri = sys.argv[4] if (5 == len(sys.argv)) else None
+        events = date_range_query(client, cal_uri)
         create_org_file(filename, events)
       else: raise Usage('Operation "%s" not supported.' % op)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.