~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/builder.py

  • Committer: Curtis Hovey
  • Date: 2011-08-18 20:56:37 UTC
  • mto: This revision was merged to the branch mainline in revision 13736.
  • Revision ID: curtis.hovey@canonical.com-20110818205637-ae0pf9aexdea2mlb
Cleaned up doctrings and hushed lint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import operator
22
22
 
23
 
from lazr.restful.utils import smartquote
24
23
from zope.app.form.browser import (
25
24
    TextAreaWidget,
26
25
    TextWidget,
30
29
from zope.lifecycleevent import ObjectCreatedEvent
31
30
 
32
31
from canonical.launchpad import _
33
 
from canonical.launchpad.components.decoratedresultset import (
34
 
    DecoratedResultSet,
35
 
    )
36
 
from canonical.launchpad.interfaces.lpstorm import IStore
37
32
from canonical.launchpad.webapp import (
38
33
    ApplicationMenu,
39
34
    canonical_url,
46
41
    stepthrough,
47
42
    )
48
43
from canonical.launchpad.webapp.breadcrumb import Breadcrumb
 
44
from canonical.lazr.utils import smartquote
49
45
from lp.app.browser.launchpadform import (
50
46
    action,
51
47
    custom_widget,
57
53
    IBuilder,
58
54
    IBuilderSet,
59
55
    )
60
 
from lp.buildmaster.model.buildqueue import BuildQueue
61
 
from lp.services.propertycache import (
62
 
    cachedproperty,
63
 
    )
 
56
from lp.services.propertycache import cachedproperty
64
57
from lp.soyuz.browser.build import (
65
58
    BuildNavigationMixin,
66
59
    BuildRecordsView,
151
144
    @cachedproperty
152
145
    def builders(self):
153
146
        """All active builders"""
154
 
        def do_eager_load(builders):
155
 
            # Prefetch the jobs' data.
156
 
            queues = IStore(BuildQueue).find(
157
 
                BuildQueue,
158
 
                BuildQueue.builderID.is_in(
159
 
                    builder.id for builder in builders))
160
 
            BuildQueue.preloadSpecificJobData(queues)
161
 
 
162
 
        return list(DecoratedResultSet(
163
 
            list(self.context.getBuilders()), pre_iter_hook=do_eager_load))
 
147
        return list(self.context.getBuilders())
164
148
 
165
149
    @property
166
150
    def number_of_registered_builders(self):