Commits

Felix Geller committed 2389731

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

For example:

gcal2org.py steve@gmail.com download x.org "http://www.google.com/calendar/feeds/mike@gmail.com/private/full/";

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(date.today() - timedelta(30)), 
                      end_date = str(date.today() + 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)