| |
- exceptions.Exception
-
- Error
-
- RequestError
- gdata.service.GDataService(atom.service.AtomService)
-
- CalendarService
- gdata.service.Query(__builtin__.dict)
-
- CalendarEventCommentQuery
- CalendarEventQuery
- CalendarListQuery
class CalendarEventCommentQuery(gdata.service.Query) |
|
Queries the Google Calendar event comments feed |
|
- Method resolution order:
- CalendarEventCommentQuery
- gdata.service.Query
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __init__(self, feed=None)
Methods inherited from gdata.service.Query:
- ToUri(self)
- __str__(self)
Properties inherited from gdata.service.Query:
- alt
- The feed query's alt parameter
- get = _GetAlt(self)
- set = _SetAlt(self, query)
- author
- The feed query's author parameter
- get = _GetAuthor(self)
- set = _SetAuthor(self, query)
- max_results
- The feed query's max-results parameter
- get = _GetMaxResults(self)
- set = _SetMaxResults(self, query)
- orderby
- The feed query's orderby parameter
- get = _GetOrderBy(self)
- set = _SetOrderBy(self, query)
- published_max
- The feed query's published-max parameter
- get = _GetPublishedMax(self)
- set = _SetPublishedMax(self, query)
- published_min
- The feed query's published-min parameter
- get = _GetPublishedMin(self)
- set = _SetPublishedMin(self, query)
- start_index
- The feed query's start-index parameter
- get = _GetStartIndex(self)
- set = _SetStartIndex(self, query)
- text_query
- The feed query's q parameter
- get = _GetTextQuery(self)
- set = _SetTextQuery(self, query)
- updated_max
- The feed query's updated-max parameter
- get = _GetUpdatedMax(self)
- set = _SetUpdatedMax(self, query)
- updated_min
- The feed query's updated-min parameter
- get = _GetUpdatedMin(self)
- set = _SetUpdatedMin(self, query)
Data and other attributes inherited from gdata.service.Query:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Query' objects>
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
Data and other attributes inherited from __builtin__.dict:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- fromkeys = <built-in method fromkeys of type object>
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
|
class CalendarEventQuery(gdata.service.Query) |
| |
- Method resolution order:
- CalendarEventQuery
- gdata.service.Query
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __init__(self, user='default', visibility='private', projection='full', text_query=None, params=None, categories=None)
Properties defined here:
- ctz
- The ctz query parameter which sets report time on the server.
- get = _GetTimezone(self)
- set = _SetTimezone(self, val)
- futureevents
- The futureevents query parameter
- get = _GetFutureEvents(self)
- set = _SetFutureEvents(self, val)
- orderby
- The orderby query parameter
- get = _GetOrderBy(self)
- set = _SetOrderBy(self, val)
- recurrence_expansion_end
- The recurrence-expansion-end query parameter
- get = _GetRecurrenceExpansionEnd(self)
- set = _SetRecurrenceExpansionEnd(self, val)
- recurrence_expansion_start
- The recurrence-expansion-start query parameter
- get = _GetRecurrenceExpansionStart(self)
- set = _SetRecurrenceExpansionStart(self, val)
- singleevents
- The singleevents query parameter
- get = _GetSingleEvents(self)
- set = _SetSingleEvents(self, val)
- sortorder
- The sortorder query parameter
- get = _GetSortOrder(self)
- set = _SetSortOrder(self, val)
- start_max
- The start-max query parameter
- get = _GetStartMax(self)
- set = _SetStartMax(self, val)
- start_min
- The start-min query parameter
- get = _GetStartMin(self)
- set = _SetStartMin(self, val)
Methods inherited from gdata.service.Query:
- ToUri(self)
- __str__(self)
Properties inherited from gdata.service.Query:
- alt
- The feed query's alt parameter
- get = _GetAlt(self)
- set = _SetAlt(self, query)
- author
- The feed query's author parameter
- get = _GetAuthor(self)
- set = _SetAuthor(self, query)
- max_results
- The feed query's max-results parameter
- get = _GetMaxResults(self)
- set = _SetMaxResults(self, query)
- published_max
- The feed query's published-max parameter
- get = _GetPublishedMax(self)
- set = _SetPublishedMax(self, query)
- published_min
- The feed query's published-min parameter
- get = _GetPublishedMin(self)
- set = _SetPublishedMin(self, query)
- start_index
- The feed query's start-index parameter
- get = _GetStartIndex(self)
- set = _SetStartIndex(self, query)
- text_query
- The feed query's q parameter
- get = _GetTextQuery(self)
- set = _SetTextQuery(self, query)
- updated_max
- The feed query's updated-max parameter
- get = _GetUpdatedMax(self)
- set = _SetUpdatedMax(self, query)
- updated_min
- The feed query's updated-min parameter
- get = _GetUpdatedMin(self)
- set = _SetUpdatedMin(self, query)
Data and other attributes inherited from gdata.service.Query:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Query' objects>
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
Data and other attributes inherited from __builtin__.dict:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- fromkeys = <built-in method fromkeys of type object>
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
|
class CalendarListQuery(gdata.service.Query) |
|
Queries the Google Calendar meta feed |
|
- Method resolution order:
- CalendarListQuery
- gdata.service.Query
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __init__(self, userId=None, text_query=None, params=None, categories=None)
Methods inherited from gdata.service.Query:
- ToUri(self)
- __str__(self)
Properties inherited from gdata.service.Query:
- alt
- The feed query's alt parameter
- get = _GetAlt(self)
- set = _SetAlt(self, query)
- author
- The feed query's author parameter
- get = _GetAuthor(self)
- set = _SetAuthor(self, query)
- max_results
- The feed query's max-results parameter
- get = _GetMaxResults(self)
- set = _SetMaxResults(self, query)
- orderby
- The feed query's orderby parameter
- get = _GetOrderBy(self)
- set = _SetOrderBy(self, query)
- published_max
- The feed query's published-max parameter
- get = _GetPublishedMax(self)
- set = _SetPublishedMax(self, query)
- published_min
- The feed query's published-min parameter
- get = _GetPublishedMin(self)
- set = _SetPublishedMin(self, query)
- start_index
- The feed query's start-index parameter
- get = _GetStartIndex(self)
- set = _SetStartIndex(self, query)
- text_query
- The feed query's q parameter
- get = _GetTextQuery(self)
- set = _SetTextQuery(self, query)
- updated_max
- The feed query's updated-max parameter
- get = _GetUpdatedMax(self)
- set = _SetUpdatedMax(self, query)
- updated_min
- The feed query's updated-min parameter
- get = _GetUpdatedMin(self)
- set = _SetUpdatedMin(self, query)
Data and other attributes inherited from gdata.service.Query:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Query' objects>
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __cmp__(...)
- x.__cmp__(y) <==> cmp(x,y)
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __gt__(...)
- x.__gt__(y) <==> x>y
- __hash__(...)
- x.__hash__() <==> hash(x)
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update(E, **F) -> None. Update D from E and F: for k in E: D[k] = E[k]
(if E has keys else: for (k, v) in E: D[k] = v) then: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
Data and other attributes inherited from __builtin__.dict:
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
- fromkeys = <built-in method fromkeys of type object>
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
|
class CalendarService(gdata.service.GDataService) |
|
Client for the Google Calendar service. |
|
- Method resolution order:
- CalendarService
- gdata.service.GDataService
- atom.service.AtomService
- __builtin__.object
Methods defined here:
- CalendarQuery(self, query)
- DeleteAclEntry(self, edit_uri, extra_headers=None, url_params=None, escape_params=True)
- Removes an ACL entry at the given edit_uri from Google Calendar.
Args:
edit_uri: string The edit URL of the entry to be deleted. Example:
'http://www.google.com/calendar/feeds/liz%40gmail.com/acl/full/default'
url_params: dict (optional) Additional URL parameters to be included
in the deletion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful delete, a httplib.HTTPResponse containing the server's
response to the DELETE request.
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- DeleteCalendarEntry(self, edit_uri, extra_headers=None, url_params=None, escape_params=True)
- Removes a calendar entry at the given edit_uri from Google Calendar.
Args:
edit_uri: string The edit URL of the entry to be deleted. Example:
'http://www.google.com/calendar/feeds/default/allcalendars/abcdef@group.calendar.google.com'
url_params: dict (optional) Additional URL parameters to be included
in the deletion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful delete, True is returned
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- DeleteEvent(self, edit_uri, extra_headers=None, url_params=None, escape_params=True)
- Removes an event with the specified ID from Google Calendar.
Args:
edit_uri: string The edit URL of the entry to be deleted. Example:
'http://www.google.com/calendar/feeds/default/private/full/abx'
url_params: dict (optional) Additional URL parameters to be included
in the deletion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful delete, a httplib.HTTPResponse containing the server's
response to the DELETE request.
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- ExecuteBatch(self, batch_feed, url, converter=<function CalendarEventFeedFromString>)
- Sends a batch request feed to the server.
The batch request needs to be sent to the batch URL for a particular
calendar. You can find the URL by calling GetBatchLink().href on the
CalendarEventFeed.
Args:
batch_feed: gdata.calendar.CalendarEventFeed A feed containing batch
request entries. Each entry contains the operation to be performed
on the data contained in the entry. For example an entry with an
operation type of insert will be used as if the individual entry
had been inserted.
url: str The batch URL for the Calendar to which these operations should
be applied.
converter: Function (optional) The function used to convert the server's
response to an object. The default value is
CalendarEventFeedFromString.
Returns:
The results of the batch request's execution on the server. If the
default converter is used, this is stored in a CalendarEventFeed.
- GetAllCalendarsFeed(self, uri='/calendar/feeds/default/allcalendars/full')
- GetCalendarAclEntry(self, uri)
- GetCalendarAclFeed(self, uri='/calendar/feeds/default/acl/full')
- GetCalendarEventCommentEntry(self, uri)
- GetCalendarEventCommentFeed(self, uri)
- GetCalendarEventEntry(self, uri)
- GetCalendarEventFeed(self, uri='/calendar/feeds/default/private/full')
- GetCalendarListEntry(self, uri)
- GetCalendarListFeed(self, uri='/calendar/feeds/default/allcalendars/full')
- GetOwnCalendarsFeed(self, uri='/calendar/feeds/default/owncalendars/full')
- InsertAclEntry(self, new_entry, insert_uri, url_params=None, escape_params=True)
- Adds an ACL entry (rule) to Google Calendar.
Args:
new_entry: ElementTree._Element A new ACL entry which is to be added to
Google Calendar.
insert_uri: the URL to post new entries to the ACL feed
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the ACL entry created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- InsertCalendar(self, new_calendar, url_params=None, escape_params=True)
- Creates a new calendar.
Args:
new_calendar: The calendar to be created
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the calendar created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- InsertCalendarSubscription(self, calendar, url_params=None, escape_params=True)
- Subscribes the authenticated user to the provided calendar.
Args:
calendar: The calendar to which the user should be subscribed.
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the subscription created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- InsertEvent(self, new_event, insert_uri, url_params=None, escape_params=True)
- Adds an event to Google Calendar.
Args:
new_event: ElementTree._Element A new event which is to be added to
Google Calendar.
insert_uri: the URL to post new events to the feed
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the event created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- InsertEventComment(self, new_entry, insert_uri, url_params=None, escape_params=True)
- Adds an entry to Google Calendar.
Args:
new_entry: ElementTree._Element A new entry which is to be added to
Google Calendar.
insert_uri: the URL to post new entrys to the feed
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the comment created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- Query(self, uri, converter=None)
- Performs a query and returns a resulting feed or entry.
Args:
feed: string The feed which is to be queried
Returns:
On success, a GDataFeed or Entry depending on which is sent from the
server.
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- UpdateAclEntry(self, edit_uri, updated_rule, url_params=None, escape_params=True)
- Updates an existing ACL rule.
Args:
edit_uri: string The edit link URI for the element being updated
updated_rule: string, ElementTree._Element, or ElementWrapper containing
the Atom Entry which will replace the event which is
stored at the edit_url
url_params: dict (optional) Additional URL parameters to be included
in the update request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful update, a httplib.HTTPResponse containing the server's
response to the PUT request.
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- UpdateCalendar(self, calendar, url_params=None, escape_params=True)
- Updates a calendar.
Args:
calendar: The calendar which should be updated
url_params: dict (optional) Additional URL parameters to be included
in the insertion request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful insert, an entry containing the calendar created
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- UpdateEvent(self, edit_uri, updated_event, url_params=None, escape_params=True)
- Updates an existing event.
Args:
edit_uri: string The edit link URI for the element being updated
updated_event: string, ElementTree._Element, or ElementWrapper containing
the Atom Entry which will replace the event which is
stored at the edit_url
url_params: dict (optional) Additional URL parameters to be included
in the update request.
escape_params: boolean (optional) If true, the url_parameters will be
escaped before they are included in the request.
Returns:
On successful update, a httplib.HTTPResponse containing the server's
response to the PUT request.
On failure, a RequestError is raised of the form:
{'status': HTTP status code from server,
'reason': HTTP reason from the server,
'body': HTTP body of the server's response}
- __init__(self, email=None, password=None, source=None, server='www.google.com', additional_headers=None)
Methods inherited from gdata.service.GDataService:
- ClientLogin(self, username, password, account_type=None, service=None, source=None, captcha_token=None, captcha_response=None)
- Convenience method for authenticating using ProgrammaticLogin.
Sets values for email, password, and other optional members.
Args:
username:
password:
account_type: string (optional)
service: string (optional)
captcha_token: string (optional)
captcha_response: string (optional)
- Delete(self, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=4)
- Deletes the entry at the given URI.
Args:
uri: string The URI of the entry to be deleted. Example:
'/base/feeds/items/ITEM-ID'
extra_headers: dict (optional) HTTP headers which are to be included.
The client automatically sets the Content-Type and
Authorization headers.
url_params: dict (optional) Additional URL parameters to be included
in the URI. These are translated into query arguments
in the form '&dict_key=value&...'.
Example: {'max-results': '250'} becomes &max-results=250
escape_params: boolean (optional) If false, the calling code has already
ensured that the query will form a valid URL (all
reserved characters have been escaped). If true, this
method will escape the query and any URL parameters
provided.
Returns:
True if the entry was deleted.
- GenerateAuthSubURL(self, next, scope, secure=False, session=True)
- Generate a URL at which the user will login and be redirected back.
Users enter their credentials on a Google login page and a token is sent
to the URL specified in next. See documentation for AuthSub login at:
http://code.google.com/apis/accounts/AuthForWebApps.html
Args:
next: string The URL user will be sent to after logging in.
scope: string The URL of the service to be accessed.
secure: boolean (optional) Determines whether or not the issued token
is a secure token.
session: boolean (optional) Determines whether or not the issued token
can be upgraded to a session token.
- Get(self, uri, extra_headers=None, redirects_remaining=4, encoding='UTF-8', converter=None)
- Query the GData API with the given URI
The uri is the portion of the URI after the server value
(ex: www.google.com).
To perform a query against Google Base, set the server to
'base.google.com' and set the uri to '/base/feeds/...', where ... is
your query. For example, to find snippets for all digital cameras uri
should be set to: '/base/feeds/snippets?bq=digital+camera'
Args:
uri: string The query in the form of a URI. Example:
'/base/feeds/snippets?bq=digital+camera'.
extra_headers: dictionary (optional) Extra HTTP headers to be included
in the GET request. These headers are in addition to
those stored in the client's additional_headers property.
The client automatically sets the Content-Type and
Authorization headers.
redirects_remaining: int (optional) Tracks the number of additional
redirects this method will allow. If the service object receives
a redirect and remaining is 0, it will not follow the redirect.
This was added to avoid infinite redirect loops.
encoding: string (optional) The character encoding for the server's
response. Default is UTF-8
converter: func (optional) A function which will transform
the server's results before it is returned. Example: use
GDataFeedFromString to parse the server response as if it
were a GDataFeed.
Returns:
If there is no ResultsTransformer specified in the call, a GDataFeed
or GDataEntry depending on which is sent from the server. If the
response is niether a feed or entry and there is no ResultsTransformer,
return a string. If there is a ResultsTransformer, the returned value
will be that of the ResultsTransformer function.
- GetAuthSubToken(self)
- GetClientLoginToken(self)
- GetEntry(self, uri, extra_headers=None)
- Query the GData API with the given URI and receive an Entry.
See also documentation for gdata.service.Get
Args:
uri: string The query in the form of a URI. Example:
'/base/feeds/snippets?bq=digital+camera'.
extra_headers: dictionary (optional) Extra HTTP headers to be included
in the GET request. These headers are in addition to
those stored in the client's additional_headers property.
The client automatically sets the Content-Type and
Authorization headers.
Returns:
A GDataEntry built from the XML in the server's response.
- GetFeed(self, uri, extra_headers=None, converter=<function GDataFeedFromString>)
- Query the GData API with the given URI and receive a Feed.
See also documentation for gdata.service.Get
Args:
uri: string The query in the form of a URI. Example:
'/base/feeds/snippets?bq=digital+camera'.
extra_headers: dictionary (optional) Extra HTTP headers to be included
in the GET request. These headers are in addition to
those stored in the client's additional_headers property.
The client automatically sets the Content-Type and
Authorization headers.
Returns:
A GDataFeed built from the XML in the server's response.
- GetMedia(self, uri, extra_headers=None)
- Returns a MediaSource containing media and its metadata from the given
URI string.
- GetNext(self, feed)
- Requests the next 'page' of results in the feed.
This method uses the feed's next link to request an additional feed
and uses the class of the feed to convert the results of the GET request.
Args:
feed: atom.Feed or a subclass. The feed should contain a next link and
the type of the feed will be applied to the results from the
server. The new feed which is returned will be of the same class
as this feed which was passed in.
Returns:
A new feed representing the next set of results in the server's feed.
The type of this feed will match that of the feed argument.
- Post(self, data, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=4, media_source=None, converter=None)
- Insert or update data into a GData service at the given URI.
Args:
data: string, ElementTree._Element, atom.Entry, or gdata.GDataEntry The
XML to be sent to the uri.
uri: string The location (feed) to which the data should be inserted.
Example: '/base/feeds/items'.
extra_headers: dict (optional) HTTP headers which are to be included.
The client automatically sets the Content-Type,
Authorization, and Content-Length headers.
url_params: dict (optional) Additional URL parameters to be included
in the URI. These are translated into query arguments
in the form '&dict_key=value&...'.
Example: {'max-results': '250'} becomes &max-results=250
escape_params: boolean (optional) If false, the calling code has already
ensured that the query will form a valid URL (all
reserved characters have been escaped). If true, this
method will escape the query and any URL parameters
provided.
media_source: MediaSource (optional) Container for the media to be sent
along with the entry, if provided.
converter: func (optional) A function which will be executed on the
server's response. Often this is a function like
GDataEntryFromString which will parse the body of the server's
response and return a GDataEntry.
Returns:
If the post succeeded, this method will return a GDataFeed, GDataEntry,
or the results of running converter on the server's result body (if
converter was specified).
- PostOrPut(self, verb, data, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=4, media_source=None, converter=None)
- Insert data into a GData service at the given URI.
Args:
verb: string, either 'POST' or 'PUT'
data: string, ElementTree._Element, atom.Entry, or gdata.GDataEntry The
XML to be sent to the uri.
uri: string The location (feed) to which the data should be inserted.
Example: '/base/feeds/items'.
extra_headers: dict (optional) HTTP headers which are to be included.
The client automatically sets the Content-Type,
Authorization, and Content-Length headers.
url_params: dict (optional) Additional URL parameters to be included
in the URI. These are translated into query arguments
in the form '&dict_key=value&...'.
Example: {'max-results': '250'} becomes &max-results=250
escape_params: boolean (optional) If false, the calling code has already
ensured that the query will form a valid URL (all
reserved characters have been escaped). If true, this
method will escape the query and any URL parameters
provided.
media_source: MediaSource (optional) Container for the media to be sent
along with the entry, if provided.
converter: func (optional) A function which will be executed on the
server's response. Often this is a function like
GDataEntryFromString which will parse the body of the server's
response and return a GDataEntry.
Returns:
If the post succeeded, this method will return a GDataFeed, GDataEntry,
or the results of running converter on the server's result body (if
converter was specified).
- ProgrammaticLogin(self, captcha_token=None, captcha_response=None)
- Authenticates the user and sets the GData Auth token.
Login retreives a temporary auth token which must be used with all
requests to GData services. The auth token is stored in the GData client
object.
Login is also used to respond to a captcha challenge. If the user's login
attempt failed with a CaptchaRequired error, the user can respond by
calling Login with the captcha token and the answer to the challenge.
Args:
captcha_token: string (optional) The identifier for the captcha challenge
which was presented to the user.
captcha_response: string (optional) The user's answer to the captch
challenge.
Raises:
CaptchaRequired if the login service will require a captcha response
BadAuthentication if the login service rejected the username or password
Error if the login service responded with a 403 different from the above
- Put(self, data, uri, extra_headers=None, url_params=None, escape_params=True, redirects_remaining=3, media_source=None, converter=None)
- Updates an entry at the given URI.
Args:
data: string, ElementTree._Element, or xml_wrapper.ElementWrapper The
XML containing the updated data.
uri: string A URI indicating entry to which the update will be applied.
Example: '/base/feeds/items/ITEM-ID'
extra_headers: dict (optional) HTTP headers which are to be included.
The client automatically sets the Content-Type,
Authorization, and Content-Length headers.
url_params: dict (optional) Additional URL parameters to be included
in the URI. These are translated into query arguments
in the form '&dict_key=value&...'.
Example: {'max-results': '250'} becomes &max-results=250
escape_params: boolean (optional) If false, the calling code has already
ensured that the query will form a valid URL (all
reserved characters have been escaped). If true, this
method will escape the query and any URL parameters
provided.
converter: func (optional) A function which will be executed on the
server's response. Often this is a function like
GDataEntryFromString which will parse the body of the server's
response and return a GDataEntry.
Returns:
If the put succeeded, this method will return a GDataFeed, GDataEntry,
or the results of running converter on the server's result body (if
converter was specified).
- RevokeAuthSubToken(self)
- Revokes an existing AuthSub token.
Raises:
NonAuthSubToken if the user's auth token is not an AuthSub token
- SetAuthSubToken(self, token)
- SetClientLoginToken(self, token)
- UpgradeToSessionToken(self)
- Upgrades a single use AuthSub token to a session token.
Raises:
NonAuthSubToken if the user's auth token is not an AuthSub token
Properties inherited from gdata.service.GDataService:
- auth_token
- Get or set the token used for authentication.
- get = __GetAuthToken(self)
- set = __SetAuthSubToken(self, auth_token)
- captcha_token
- Get the captcha token for a login request.
- get = __GetCaptchaToken(self)
- captcha_url
- Get the captcha URL for a login request.
- get = __GetCaptchaURL(self)
- source
- The source is the name of the application making the request.
It should be in the form company_id-app_name-app_version
- get = __GetSource(self)
- # Private methods to create the source property.
- set = __SetSource(self, new_source)
Methods inherited from atom.service.AtomService:
- PrepareConnection(self, full_uri)
- Opens a connection to the server based on the full URI.
Examines the target URI and the proxy settings, which are set as
environment variables, to open a connection with the server. This
connection is used to make an HTTP request.
Args:
full_uri: str Which is the target relative (lacks protocol and host) or
absolute URL to be opened. Example:
'https://www.google.com/accounts/ClientLogin' or
'base/feeds/snippets' where the server is set to www.google.com.
Returns:
A tuple containing the httplib.HTTPConnection and the full_uri for the
request.
- UseBasicAuth(self, username, password, for_proxy=False)
- Sets an Authenticaiton: Basic HTTP header containing plaintext.
The username and password are base64 encoded and added to an HTTP header
which will be included in each request. Note that your username and
password are sent in plaintext.
Args:
username: str
password: str
Data and other attributes inherited from atom.service.AtomService:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'AtomService' objects>
- list of weak references to the object (if defined)
- debug = False
- port = 80
- ssl = False
|
|