c.l.d.Library : class documentation

Part of canonical.librarian.db View In Hierarchy

Class that encapsulates the database interface for the librarian.
Method __init__ Create a new database access object.
Method lookupBySHA1 Undocumented
Method getAlias Returns a LibraryFileAlias, or raises LookupError.
Method getAliases Undocumented
Method add Undocumented
Method addAlias Add an alias, and return its ID.
def __init__(self, restricted=False):
Create a new database access object.
ParametersrestrictedIf this is set to true, only restricted will be served. Otherwise only public files will be served. Files created in this library will marked as restricted.
def lookupBySHA1(self, digest):
Undocumented
def getAlias(self, aliasid, token, path):
Returns a LibraryFileAlias, or raises LookupError.

A LookupError is raised if no record with the given ID exists or if not related LibraryFileContent exists.

ParameterstokenThe token for the file. If None no token is present. When a token is supplied, it is looked up with path.
pathThe path the request is for, unused unless a token is supplied; when supplied it must match the token. The value of path is expected to be that from a twisted request.args e.g. /foo/bar.
def getAliases(self, fileid):
Undocumented
def add(self, digest, size, md5Digest):
Undocumented
def addAlias(self, fileid, filename, mimetype, expires=None):
Add an alias, and return its ID.

If a matching alias already exists, it will return that ID instead.

API Documentation for Launchpad, generated by pydoctor at 2010-09-27 00:00:11.