c.l.b.l.ProxiedLibraryFileAlias : class documentation

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

A `LibraryFileAlias` decorator for use in URL generation.

The URL's output by this decorator will always point at the webapp. This is
useful when:
 - we are proxying files via the webapp (as we do at the moment)
 - when the webapp has to be contacted to get access to a file (the case
   for restricted files in the future)
 - files might change from public to private and thus not work even if the
   user has access to the once its private, unless they go via the webapp.

This should be used anywhere we are outputting URL's to LibraryFileAliases
other than directly in rendered pages. For rendered pages, using a
LibraryFileAlias directly is OK as at that point the status of the file
is know.

Overrides `ILibraryFileAlias.http_url` to always point to the webapp URL,
even when called from the webservice domain.
Method __init__ Undocumented
Method http_url Return the webapp URL for the context LibraryFileAlias.
def __init__(self, context, parent):
Undocumented
@property
def http_url(self):
Return the webapp URL for the context LibraryFileAlias.

Preserve the LibraryFileAlias.http_url behavior for deleted files, returning None.

Mask webservice requests if it's the case, so the returned URL will be always relative to the parent webapp URL.

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