示例#1
0
            u"they want to report. This can happen for example for hardware "
            u"related bugs where the one symptom can be caused by "
            u"completely different hardware and drivers."),
        required=False)

    def createBug(bug_params):
        """Create a new bug on this target.

        bug_params is an instance of `CreateBugParams`.
        """


# We assign the schema for an `IBugTask` attribute here
# in order to avoid circular dependencies.
patch_reference_property(IBugTask, 'target', IBugTarget)
patch_plain_parameter_type(IBugTask, 'transitionToTarget', 'target',
                           IBugTarget)


class IHasOfficialBugTags(Interface):
    """An entity that exposes a set of official bug tags."""

    official_bug_tags = exported(
        List(title=_("Official Bug Tags"),
             description=_("The list of bug tags defined as official."),
             value_type=Tag(),
             readonly=True))

    def getUsedBugTagsWithOpenCounts(user, tag_limit=0, include_tags=None):
        """Return name and bug count of tags having open bugs.

        :param user: The user who wants the report.
示例#2
0
    @operation_for_version('devel')
    def getTags():
        """Return the milestone tags in alphabetical order.

        See above the IMilestone.setTags docstring for an explanation of
        why this is not a property.
        """

    def userCanView(user):
        """True if the given user has access to this product."""


# Avoid circular imports
IBugTask['milestone'].schema = IMilestone
IBugTaskSearchBase['milestone'].value_type.schema = IMilestone
patch_plain_parameter_type(
    IBugTask, 'transitionToMilestone', 'new_milestone', IMilestone)


class IMilestoneSet(Interface):
    """An set provides access `IMilestone`s."""

    def __iter__():
        """Return an iterator over all the milestones for a thing."""

    def get(milestoneid):
        """Get a milestone by its id.

        If the milestone with that ID is not found, a
        NotFoundError will be raised.
        """
示例#3
0
    @operation_for_version('devel')
    def getTags():
        """Return the milestone tags in alphabetical order.

        See above the IMilestone.setTags docstring for an explanation of
        why this is not a property.
        """

    def userCanView(user):
        """True if the given user has access to this product."""


# Avoid circular imports
IBugTask['milestone'].schema = IMilestone
IBugTaskSearchBase['milestone'].value_type.schema = IMilestone
patch_plain_parameter_type(IBugTask, 'transitionToMilestone', 'new_milestone',
                           IMilestone)


class IMilestoneSet(Interface):
    """An set provides access `IMilestone`s."""
    def __iter__():
        """Return an iterator over all the milestones for a thing."""

    def get(milestoneid):
        """Get a milestone by its id.

        If the milestone with that ID is not found, a
        NotFoundError will be raised.
        """

    def getByIds(milestoneids):

IBranch['bug_branches'].value_type.schema = IBugBranch
IBranch['linked_bugs'].value_type.schema = IBug
IBranch['dependent_branches'].value_type.schema = IBranchMergeProposal
IBranch['getSubscription'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['landing_candidates'].value_type.schema = IBranchMergeProposal
IBranch['landing_targets'].value_type.schema = IBranchMergeProposal
IBranch['linkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['linkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification
IBranch['product'].schema = IProduct

patch_plain_parameter_type(
    IBranch, 'setTarget', 'project', IProduct)
patch_plain_parameter_type(
    IBranch, 'setTarget', 'source_package', ISourcePackage)
patch_reference_property(IBranch, 'sourcepackage', ISourcePackage)
patch_reference_property(IBranch, 'code_import', ICodeImport)

IBranch['spec_links'].value_type.schema = ISpecificationBranch
IBranch['subscribe'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['subscriptions'].value_type.schema = IBranchSubscription
IBranch['unlinkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['unlinkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification

patch_entry_return_type(IBranch, '_createMergeProposal', IBranchMergeProposal)
示例#5
0
        :param overlay_pockets: The list of pockets names to use for overlay
            relationships.
        :param overlay_components: The list of components names to use for
            overlay relationships.
        """


class IDistroSeries(IDistroSeriesEditRestricted, IDistroSeriesPublic,
                    IStructuralSubscriptionTarget):
    """A series of an operating system distribution."""
    export_as_webservice_entry()


# We assign the schema for an `IHasBugs` method argument here
# in order to avoid circular dependencies.
patch_plain_parameter_type(IHasBugs, 'searchTasks', 'nominated_for',
                           IDistroSeries)


class IDistroSeriesSet(Interface):
    """The set of distro seriess."""
    def get(distroseriesid):
        """Retrieve the distro series with the given distroseriesid."""

    def translatables():
        """Return a set of distroseriess that can be translated in
        rosetta."""

    def queryByName(distribution, name, follow_aliases=False):
        """Query a DistroSeries by name.

        :distribution: An IDistribution.
)

IBranch['bug_branches'].value_type.schema = IBugBranch
IBranch['linked_bugs'].value_type.schema = IBug
IBranch['dependent_branches'].value_type.schema = IBranchMergeProposal
IBranch['getSubscription'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['landing_candidates'].value_type.schema = IBranchMergeProposal
IBranch['landing_targets'].value_type.schema = IBranchMergeProposal
IBranch['linkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['linkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification
IBranch['product'].schema = IProduct

patch_plain_parameter_type(IBranch, 'setTarget', 'project', IProduct)
patch_plain_parameter_type(IBranch, 'setTarget', 'source_package',
                           ISourcePackage)
patch_reference_property(IBranch, 'sourcepackage', ISourcePackage)
patch_reference_property(IBranch, 'code_import', ICodeImport)

IBranch['spec_links'].value_type.schema = ISpecificationBranch
IBranch['subscribe'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['return_type'].schema = IBranchSubscription
IBranch['subscriptions'].value_type.schema = IBranchSubscription
IBranch['unlinkBug'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['bug'].schema = IBug
IBranch['unlinkSpecification'].queryTaggedValue(
    LAZR_WEBSERVICE_EXPORTED)['params']['spec'].schema = ISpecification

patch_entry_return_type(IBranch, '_createMergeProposal', IBranchMergeProposal)
from lp.translations.interfaces.translationgroup import ITranslationGroup
from lp.translations.interfaces.translationimportqueue import (
    ITranslationImportQueue,
    ITranslationImportQueueEntry,
    )


patch_collection_property(IBranch, 'bug_branches', IBugBranch)
patch_collection_property(IBranch, 'linked_bugs', IBug)
patch_collection_property(IBranch, 'dependent_branches', IBranchMergeProposal)
patch_entry_return_type(IBranch, 'getSubscription', IBranchSubscription)
patch_collection_property(
    IBranch, '_api_landing_candidates', IBranchMergeProposal)
patch_collection_property(
    IBranch, '_api_landing_targets', IBranchMergeProposal)
patch_plain_parameter_type(IBranch, 'linkBug', 'bug', IBug)
patch_plain_parameter_type(
    IBranch, 'linkSpecification', 'spec', ISpecification)
patch_reference_property(IBranch, 'product', IProduct)

patch_plain_parameter_type(IBranch, 'setTarget', 'project', IProduct)
patch_plain_parameter_type(
    IBranch, 'setTarget', 'source_package', ISourcePackage)
patch_reference_property(IBranch, 'sourcepackage', ISourcePackage)
patch_reference_property(IBranch, 'code_import', ICodeImport)

patch_collection_property(IBranch, 'spec_links', ISpecificationBranch)
patch_entry_return_type(IBranch, 'subscribe', IBranchSubscription)
patch_collection_property(IBranch, 'subscriptions', IBranchSubscription)
patch_plain_parameter_type(IBranch, 'unlinkBug', 'bug', IBug)
patch_plain_parameter_type(