c.l.i.l.ILibraryFileAlias(Interface) : interface documentation

Part of canonical.launchpad.interfaces.librarian View In Hierarchy

Known subclasses: canonical.launchpad.interfaces.librarian.ILibraryFileAliasWithParent

Known implementations: canonical.launchpad.database.librarian.LibraryFileAlias, lp.code.browser.codereviewcomment.DiffAttachment

No interface docstring
Int id Undocumented
Datetime date_created Undocumented
Attribute content Library file content
TextLine filename Undocumented
TextLine mimetype Undocumented
Datetime last_accessed Undocumented
Datetime expires When file can be removed. Set to None if the file
Int hits Undocumented
Datetime last_downloaded Undocumented
Bool restricted If the file is restricted, it can only be retrieved through the restricted librarian.
Attribute deleted Is this file deleted.
Attribute http_url The http URL to this file
Attribute https_url The https URL to this file
Attribute private_url The secure URL to this file (private files)
Method getURL Return this file's http or https URL.
Method open Open this file for reading.
Method read Read up to chunksize bytes from the file.
Method close Close this file.
Method updateDownloadCount Update this file's download count for the given country and day.
id =
Undocumented
date_created =
Undocumented
content =
Library file content
filename =
Undocumented
mimetype =
Undocumented
last_accessed =
Undocumented
expires =
When file can be removed. Set to None if the file should only be removed when it is no longer referenced in the database. Set it to NEVER_EXPIRES to keep it in the Librarian permanently.
hits =
Undocumented
last_downloaded =
Undocumented
restricted =
If the file is restricted, it can only be retrieved through the restricted librarian.
deleted =
Is this file deleted.
http_url =
The http URL to this file
https_url =
The https URL to this file
private_url =
The secure URL to this file (private files)
def getURL():
Return this file's http or https URL.

If the file is a restricted file, the private_url will be returned, which is on https and uses unique domains per file alias.

The generated URL will be https if the use_https config variable is set, in order to prevent warnings about insecure objects from happening in some browsers (this is used for, e.g., branding).

If config.launchpad.virtual_host.use_https is set, then return the https URL. Otherwise return the http URL.

def open(timeout=LIBRARIAN_SERVER_DEFAULT_TIMEOUT):
Open this file for reading.
ParameterstimeoutThe number of seconds the method retries to open a connection to the Librarian server. If the connection cannot be established in the given time, a LibrarianServerError is raised.
ReturnsNone
def read(chunksize=None, timeout=LIBRARIAN_SERVER_DEFAULT_TIMEOUT):
Read up to chunksize bytes from the file.
ParameterschunksizeThe maximum number of bytes to be read. Defaults to the entire file.
timeoutThe number of seconds the method retries to open a connection to the Librarian server. If the connection cannot be established in the given time, a LibrarianServerError is raised.
Returnsthe data read from the Librarian file.
def close():
Close this file.
def updateDownloadCount(day, country, count):
Update this file's download count for the given country and day.

If there's no ILibraryFileDownloadCount entry for this file, and the given day/country, we create one with the given count. Otherwise we just increase the count of the existing one by the given count.

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