~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/interfaces/distribution.py

  • Committer: Steve Kowalik
  • Date: 2011-08-07 04:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 13626.
  • Revision ID: stevenk@ubuntu.com-20110807040552-mwnxo0flmhvl35e8
Correct the notification based on review comments, and remove request{,ed}
from the function names, switching to create{,d}.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
    TextLine,
56
56
    )
57
57
 
58
 
from lp import _
 
58
from canonical.launchpad import _
59
59
from lp.answers.interfaces.questiontarget import IQuestionTarget
60
60
from lp.app.errors import NameLookupFailed
61
61
from lp.app.interfaces.headings import IRootContext
83
83
    ICanGetMilestonesDirectly,
84
84
    IHasMilestones,
85
85
    )
86
 
from lp.registry.interfaces.oopsreferences import IHasOOPSReferences
87
86
from lp.registry.interfaces.pillar import IPillar
88
87
from lp.registry.interfaces.role import (
89
88
    IHasAppointedDriver,
135
134
class IDistributionPublic(
136
135
    IBugTarget, ICanGetMilestonesDirectly, IHasAppointedDriver,
137
136
    IHasBuildRecords, IHasDrivers, IHasMilestones,
138
 
    IHasOOPSReferences, IHasOwner, IHasSecurityContact, IHasSprints,
139
 
    IHasTranslationImports, ITranslationPolicy, IKarmaContext,
140
 
    ILaunchpadUsage, IMakesAnnouncements, IOfficialBugTagTargetPublic,
141
 
    IPillar, IServiceUsage, ISpecificationTarget):
 
137
    IHasOwner, IHasSecurityContact, IHasSprints, IHasTranslationImports,
 
138
    ITranslationPolicy, IKarmaContext, ILaunchpadUsage, IMakesAnnouncements,
 
139
    IOfficialBugTagTargetPublic, IPillar, IServiceUsage,
 
140
    ISpecificationTarget):
142
141
    """Public IDistribution properties."""
143
142
 
144
143
    id = Attribute("The distro's unique number.")
212
211
        exported_as='domain_name')
213
212
    owner = exported(
214
213
        PublicPersonChoice(
215
 
            title=_("Owner"),
216
 
            required=True,
217
 
            vocabulary='ValidPillarOwner',
218
 
            description=_("The restricted team, moderated team, or person "
219
 
                          "who maintains the distribution information in "
220
 
                          "Launchpad.")))
 
214
            title=_("Owner"), vocabulary='ValidOwner',
 
215
            description=_("The distro's owner."), required=True))
221
216
    registrant = exported(
222
217
        PublicPersonChoice(
223
218
            title=_("Registrant"), vocabulary='ValidPersonOrTeam',
287
282
    uploaders = Attribute(_(
288
283
        "ArchivePermission records for uploaders with rights to upload to "
289
284
        "this distribution."))
290
 
    package_derivatives_email = TextLine(
291
 
        title=_("Package Derivatives Email Address"),
292
 
        description=_(
293
 
            "The email address to send information about updates to packages "
294
 
            "that are derived from another distribution. The sequence "
295
 
            "{package_name} is replaced with the actual package name."),
296
 
        required=False)
297
285
 
298
286
    # properties
299
287
    currentseries = exported(
503
491
        :return: list of `IDistroSeries`
504
492
        """
505
493
 
 
494
    def getSourcePackageCaches(archive=None):
 
495
        """The set of all source package info caches for this distribution.
 
496
 
 
497
        If 'archive' is not given it will return all caches stored for the
 
498
        distribution main archives (PRIMARY and PARTNER).
 
499
        """
 
500
 
 
501
    def removeOldCacheItems(archive, log):
 
502
        """Delete any cache records for removed packages.
 
503
 
 
504
        Also purges all existing cache records for disabled archives.
 
505
 
 
506
        :param archive: target `IArchive`.
 
507
        :param log: the context logger object able to print DEBUG level
 
508
            messages.
 
509
        """
 
510
 
 
511
    def updateCompleteSourcePackageCache(archive, log, ztm, commit_chunk=500):
 
512
        """Update the source package cache.
 
513
 
 
514
        Consider every non-REMOVED sourcepackage and entirely skips updates
 
515
        for disabled archives.
 
516
 
 
517
        :param archive: target `IArchive`;
 
518
        :param log: logger object for printing debug level information;
 
519
        :param ztm:  transaction used for partial commits, every chunk of
 
520
            'commit_chunk' updates is committed;
 
521
        :param commit_chunk: number of updates before commit, defaults to 500.
 
522
 
 
523
        :return the number packages updated done
 
524
        """
 
525
 
 
526
    def updateSourcePackageCache(sourcepackagename, archive, log):
 
527
        """Update cached source package details.
 
528
 
 
529
        Update cache details for a given ISourcePackageName, including
 
530
        generated binarypackage names, summary and description fti.
 
531
        'log' is required and only prints debug level information.
 
532
        """
 
533
 
506
534
    @rename_parameters_as(text="source_match")
507
535
    @operation_parameters(
508
536
        text=TextLine(title=_("Source package name substring match"),
550
578
        (a substring of) their binary package names.
551
579
        """
552
580
 
 
581
    def searchBinaryPackagesFTI(package_name):
 
582
        """Do an FTI search on binary packages.
 
583
 
 
584
        :param package_name: The binary package name to search for.
 
585
        :return: A result set containing DistributionSourcePackageCache
 
586
            objects for the matching binaries found via an FTI search on
 
587
            DistroSeriesPackageCache.
 
588
        """
 
589
 
 
590
    def getFileByName(filename, archive=None, source=True, binary=True):
 
591
        """Find and return a LibraryFileAlias for the filename supplied.
 
592
 
 
593
        The file returned will be one of those published in the distribution.
 
594
 
 
595
        If searching both source and binary, and the file is found in the
 
596
        binary packages it'll return that over a file for a source package.
 
597
 
 
598
        If 'archive' is not passed the distribution.main_archive is assumed.
 
599
 
 
600
        At least one of source and binary must be true.
 
601
 
 
602
        Raises NotFoundError if it fails to find the named file.
 
603
        """
 
604
 
553
605
    def guessPublishedSourcePackageName(pkgname):
554
606
        """Return the "published" SourcePackageName related to pkgname.
555
607