~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/librarian/doc/librarian.txt

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-30 10:09:30 UTC
  • mfrom: (14606.2.8 apocalibrarian)
  • Revision ID: launchpad@pqm.canonical.com-20111230100930-kp3e0l6wakissewm
[r=wgrant][no-qa] Move canonical.librarian to
        lp.services.librarian(server).

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
We can also use the ILibrarianClient Utility directly to store and
217
217
access files in the Librarian.
218
218
 
219
 
    >>> from canonical.librarian.interfaces import ILibrarianClient
 
219
    >>> from lp.services.librarian.interfaces.client import ILibrarianClient
220
220
    >>> client = getUtility(ILibrarianClient)
221
221
    >>> aid = client.addFile(
222
222
    ...     'text.txt', len(data), StringIO(data), 'text/plain', NEVER_EXPIRES
317
317
librarian.
318
318
 
319
319
    >>> from zope.interface.verify import verifyObject
320
 
    >>> from canonical.librarian.interfaces import IRestrictedLibrarianClient
 
320
    >>> from lp.services.librarian.interfaces.client import IRestrictedLibrarianClient
321
321
    >>> restricted_client = getUtility(IRestrictedLibrarianClient)
322
322
    >>> verifyObject(IRestrictedLibrarianClient, restricted_client)
323
323
    True
393
393
But using the restricted librarian will work:
394
394
 
395
395
    >>> restricted_client.getFileByAlias(private_file_id)
396
 
    <canonical.librarian.client._File...>
 
396
    <lp.services.librarian.client._File...>
397
397
 
398
398
    >>> file_url = restricted_client.getURLForAlias(private_file_id)
399
399
    >>> print file_url