~launchpad-pqm/launchpad/devel

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).

# pylint: disable-msg=E0213

__metaclass__ = type

__all__ = [
    'ITranslationTemplatesBuildJobSource',
    ]

from zope.interface import Interface


class ITranslationTemplatesBuildJobSource(Interface):
    """Container for `TranslationTemplatesBuildJob`s."""

    def generatesTemplates(branch):
        """Can this branch usefully generate translation templates?

        If yes, then use `create` to schedule a build-farm job to
        generate the templates based on the source code in the branch.
        """

    def create(branch):
        """Create new `TranslationTemplatesBuildJob`.

        Also creates the matching `IBuildQueue` and `IJob`.

        :param branch: A `Branch` that this job will check out and
            generate templates for.
        :return: A new `TranslationTemplatesBuildJob`.
        """

    def scheduleTranslationTemplatesBuild(branch):
        """Schedule a translation templates build job, if appropriate."""

    def getByBranch(branch):
        """Find `TranslationTemplatesBuildJob` for given `Branch`."""