Hello all
I apologize in advance if this is too basic - I haven't written much
code in a while. I am trying to write a program that will text query
all (14) calendars for events that happen in a particular room of a
community art center. The problem I am having is getting the ids of
the calendars dynamically (so I don't have to hard-code in each
calendar). My code so far is:
feed = self.cal_client.GetAllCalendarsFeed()
for i, a_calendar in zip(xrange(len(feed.entry)), feed.entry):
#print a_calendar.id.text
calId = a_calendar.id.text
visibility = 'private'
projection = 'full'
user = 'monroestreetfinearts'
query = gdata.calendar.service.CalendarEventQuery(calId,
visibility,
projection, text_query)
feed2 = self.cal_client.CalendarQuery(query)
for i, an_event in enumerate(feed.entry):
print '\tEvent: %s. %s' % (i, an_event.title.text,)
(Note that this has been hacked together from the examples and other
posts on this forum, so there may be unnecessary/confusing bits in
here.)
When I run this, I am getting the following "Bad Request" error:
Traceback (most recent call last):
File "E:\Python25\calendar.py", line 243, in -toplevel-
main()
File "E:\Python25\calendar.py", line 239, in main
print sample.EventGrabber()
File "E:\Python25\calendar.py", line 187, in EventGrabber
queryData = self._FullTextQuery(rooms)
File "E:\Python25\calendar.py", line 122, in _FullTextQuery
feed2 = self.cal_client.CalendarQuery(query)
File "E:\Python23\Lib\site-packages\gdata\calendar\service.py", line
121, in CalendarQuery
converter=gdata.calendar.CalendarEventFeedFromString)
File "E:\Python23\Lib\site-packages\gdata\calendar\service.py", line
113, in Query
result = self.Get(uri, converter=converter)
File "E:\Python23\Lib\site-packages\gdata\service.py", line 513, in
Get
raise RequestError, {'status': server_response.status,
RequestError: {'status': 400, 'body': 'Invalid request URI.',
'reason': 'Bad Request'}
I don't fully understand what I am doing, so please make any questions
thorough. Let me know if you need any other information.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---