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
40
41
|
# Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Interface and utility for `TranslationTemplatesBuild`."""
__metaclass__ = type
__all__ = [
'ITranslationTemplatesBuild',
'ITranslationTemplatesBuildSource',
]
from lazr.restful.fields import Reference
from lp import _
from lp.buildmaster.interfaces.buildfarmjob import (
IBuildFarmJob,
ISpecificBuildFarmJobSource,
)
from lp.code.interfaces.branch import IBranch
class ITranslationTemplatesBuild(IBuildFarmJob):
"""The build information for translation templates builds."""
build_farm_job = Reference(
title=_("The build farm job that this extends."),
required=True, readonly=True, schema=IBuildFarmJob)
branch = Reference(
title=_("The branch that this build operates on."),
required=True, readonly=True, schema=IBranch)
class ITranslationTemplatesBuildSource(ISpecificBuildFarmJobSource):
"""Utility for `ITranslationTemplatesBuild`."""
def create(build_farm_job, branch):
"""Create a new `ITranslationTemplatesBuild`."""
def findByBranch(branch, store=None):
"""Find `ITranslationTemplatesBuild`s for `branch`."""
|