| | |
- __builtin__.object
-
- Collection
- Context
- Entry
- Service
class Collection(__builtin__.object) |
| | |
Methods defined here:
- __init__(self, context_or_uri)
- Create a Collection from either the URI of the
collection, or from a Context object.
- context(self)
- The Context associated with this Collection.
- create(self, headers=None, body=None)
- Create a new member in the collection.
Can be used to create members of regular
and media collections. Be sure to set the
'content-type' header appropriately.
Returns a tuple of the HTTP response headers
and the body.
- entry_create(self, headers=None, body=None)
- Convenience method that returns an Entry object
if the create has succeeded, or None if it fails.
- etree(self)
- Returns an ElementTree representation of the
current page of the collection.
- get(self, headers=None, body=None)
- Retrieves the first feed in a paged series of
collection documents.
Returns a tuple of the HTTP response headers
and the body.
- get_next(self, headers=None, body=None)
- Collections can be paged across many
Atom feeds. Get's the next feed in the
paging.
Returns a tuple of the HTTP response headers
and the body.
- has_next(self)
- Collections can be paged across many
Atom feeds. Returns True if there is a
'next' feed we can get.
- iter(self)
- Returns in iterable that produces a Context
object for every Entry in the collection.
- iter_entry(self)
- Returns in iterable that produces an elementtree
Entry for every Entry in the collection. Note that this
Entry is the possibly incomplete Entry in the collection
feed.
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Collection' objects>
- list of weak references to the object (if defined)
|
class Context(__builtin__.object) |
| |
Encapsulates the current service documents,
the current collection and the current
entry. Can be picked and un-pickled to
achieve persistence of context. |
| |
Methods defined here:
- __init__(self, http=None, service=None, collection=None, entry=None)
- http is either an instance of httplib2.Http() or something that
acts like it. For this module the only tow functions that need to
be implemented are request() and add_credentials().
- collpop(self)
- See collpush.
- collpush(self, uri)
- The collpush and collpop members are similar to the
command line 'pushd' and 'popd' commands. They let you
change to a different collection and then pop back
to the older collection when you are done.
- restore(self, service_type, collection_type, entry_type)
- Restore the state from a Context. The types of the objects
to be instantiated for the service, collection and entry
are passed in. If no URI is set for a specific level
then None is returned for that instance.
Properties defined here:
- collection
- The URI of the collection. None if not set yet.
- get = _get_collection(self)
- set = _set_collection(self, collection)
- entry
- The URI of the entry. None if not set yet.
- get = _get_entry(self)
- set = _set_entry(self, entry)
- service
- The URI of the Service Document. None if not set yet.
- get = _get_service(self)
- set = _set_service(self, service)
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Context' objects>
- list of weak references to the object (if defined)
- http = None
|
class Entry(__builtin__.object) |
| | |
Methods defined here:
- __init__(self, context_or_uri)
- Create an Entry from either the URI of the
entry edit URI, or from a Context object.
- context(self)
- delete(self, headers=None, body=None)
- Delete the entry from the server.
- etree(self)
- Returns an ElementTree representation of the Entry.
- get(self, headers=None, body=None)
- Retrieve the representation for this entry.
- get_media(self, headers=None, body=None)
- If this entry is a Media Link Entry, then retrieve
the associated media.
- has_media(self)
- Returns True if this is a Media Link Entry.
- put(self, headers=None, body=None)
- Update the entry on the server. If the body to send
is not supplied then the internal elementtree element
will be serialized and sent to the server.
- put_media(self, headers=None, body=None)
- If this entry is a Media Link Entry, then update
the associated media.
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Entry' objects>
- list of weak references to the object (if defined)
|
class Service(__builtin__.object) |
| |
An Atom Publishing Protocol Service Document. |
| |
Methods defined here:
- __init__(self, context_or_uri)
- context(self)
- Get the curent Context associated with this Service Document.
- etree(self)
- Returns an ElementTree representation of the Service Document.
- get(self, headers=None, body=None)
- Retrieve the current Service Document from the server.
Returns a tuple of the HTTP response headers
and the body.
- iter(self)
- Returns a generator that iterates over all
the collections in the service document.
- iter_match(self, mimerange)
- Returns a generator that iterates over
the collections in the service document
that accept the given mimerange. The mimerange
can be a specific mimetype - "image/png" - or
a range - "image/*".
Data and other attributes defined here:
- __dict__ = <dictproxy object>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Service' objects>
- list of weak references to the object (if defined)
| |