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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
# Copyright 2010-2011 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Interfaces for the Launchpad application.
Note that these are not interfaces to application content objects.
"""
__metaclass__ = type
__all__ = [
'ILaunchpadUsage',
'IServiceUsage',
]
from lazr.restful.declarations import exported
from zope.interface import Interface
from zope.schema import (
Bool,
Choice,
)
from canonical.launchpad import _
from lp.app.enums import ServiceUsage
class IServiceUsage(Interface):
"""Pillar service usages."""
# XXX: BradCrittenden 2010-08-06 bug=n/a: I hate using the term 'pillar'
# but cannot use 'project' or 'distribution'. The phrase 'Where does'
# implies an actual location not an answer of "Launchpad, externally, or
# neither."
answers_usage = Choice(
title=_('Type of service for answers application'),
description=_("Where does this pillar have an Answers forum?"),
default=ServiceUsage.UNKNOWN,
vocabulary=ServiceUsage)
blueprints_usage = Choice(
title=_('Type of service for blueprints application'),
description=_("Where does this pillar host blueprints?"),
default=ServiceUsage.UNKNOWN,
vocabulary=ServiceUsage)
codehosting_usage = Choice(
title=_('Type of service for hosting code'),
description=_("Where does this pillar host code?"),
default=ServiceUsage.UNKNOWN,
vocabulary=ServiceUsage)
translations_usage = exported(Choice(
title=_('Type of service for translations application'),
description=_("Where does this pillar do translations?"),
default=ServiceUsage.UNKNOWN,
vocabulary=ServiceUsage), as_of="devel")
bug_tracking_usage = Choice(
title=_('Type of service for tracking bugs'),
description=_("Where does this pillar track bugs?"),
default=ServiceUsage.UNKNOWN,
vocabulary=ServiceUsage)
uses_launchpad = Bool(
title=_('Uses Launchpad for something.'))
class ILaunchpadUsage(Interface):
"""How the project uses Launchpad."""
official_answers = Bool(
title=_('People can ask questions in Launchpad Answers'),
required=True)
official_blueprints = Bool(
title=_('This project uses blueprints'), required=True)
official_codehosting = Bool(
title=_('Code for this project is published in Bazaar branches on'
' Launchpad'),
required=True)
official_malone = Bool(
title=_('Bugs in this project are tracked in Launchpad'),
required=True)
official_rosetta = Bool(
title=_('Translations for this project are done in Launchpad'),
required=True)
official_anything = Bool(
title=_('Uses Launchpad for something'))
enable_bug_expiration = Bool(
title=_('Expire "Incomplete" bug reports when they become inactive'),
required=True)
|