~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/doc/distribution.txt

[r=sinzui][no-qa] Drop Distribution.getFileByName in favour of the
 one on Archive.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
    >>> from lp.registry.model.sourcepackagename import (
72
72
    ...                                          SourcePackageName)
73
 
    >>> from lp.registry.interfaces.distributionsourcepackage import IDistributionSourcePackage
74
 
    >>> from lp.soyuz.interfaces.distributionsourcepackagerelease import IDistributionSourcePackageRelease
 
73
    >>> from lp.registry.interfaces.distributionsourcepackage import (
 
74
    ...     IDistributionSourcePackage)
 
75
    >>> from lp.soyuz.interfaces.distributionsourcepackagerelease import (
 
76
    ...     IDistributionSourcePackageRelease)
75
77
 
76
78
    >>> evo = SourcePackageName.byName("evolution")
77
79
    >>> evo_ubuntu = ubuntu.getSourcePackage(evo)
359
361
    partner
360
362
    Canonical Partner Developers
361
363
 
362
 
When processing an upload we may want to find a file (E.g. if an
363
 
incomplete source is uploaded).
364
 
 
365
 
    >>> ubuntu.getFileByName('mozilla-firefox_0.9_i386.deb').getURL()
366
 
    'http://localhost:58000/40/mozilla-firefox_0.9_i386.deb'
367
 
    >>> ubuntu.getFileByName(
368
 
    ...     'mozilla-firefox_0.9_i386.deb', source=False).getURL()
369
 
    'http://localhost:58000/40/mozilla-firefox_0.9_i386.deb'
370
 
    >>> ubuntu.getFileByName('mozilla-firefox_0.9_i386.deb', binary=False)
371
 
    Traceback (most recent call last):
372
 
    ...
373
 
    NotFoundError: 'mozilla-firefox_0.9_i386.deb'
374
 
    >>> ubuntu.getFileByName('', source=False, binary=False)
375
 
    Traceback (most recent call last):
376
 
    ...
377
 
    AssertionError: searching in an explicitly empty space is pointless
378
 
 
379
364
 
380
365
Launchpad Usage
381
366
...............
575
560
    ...     # raised.
576
561
    ...     owner = spec.owner
577
562
    ...     if spec.name in ['cluster-installation', 'revu']:
578
 
    ...         spec.definition_status = SpecificationDefinitionStatus.OBSOLETE
 
563
    ...         spec.definition_status = (
 
564
    ...             SpecificationDefinitionStatus.OBSOLETE)
579
565
    ...     if spec.name in ['krunch-desktop-plan']:
580
 
    ...         spec.definition_status = SpecificationDefinitionStatus.SUPERSEDED
 
566
    ...         spec.definition_status = (
 
567
    ...             SpecificationDefinitionStatus.SUPERSEDED)
581
568
    ...     shim = spec.updateLifecycleStatus(owner)
582
569
    >>> for spec in kubuntu.valid_specifications:
583
570
    ...     print spec.name