1
# Copyright 2010 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Browser code for the Vostok root."""
9
'VostokLayerToMainTemplateAdapter',
14
from zope.component import (
18
from zope.interface import implements
20
from canonical.launchpad.webapp import LaunchpadView
21
from lp.app.browser.tales import IMainTemplateFile
22
from lp.registry.interfaces.distribution import IDistributionSet
23
from lp.vostok.publisher import VostokLayer
26
class VostokRootView(LaunchpadView):
27
"""The view for the Vostok root object."""
32
def distributions(self):
33
"""An iterable of all registered distributions."""
34
return getUtility(IDistributionSet)
37
class VostokLayerToMainTemplateAdapter:
39
implements(IMainTemplateFile)
41
def __init__(self, context):
42
here = os.path.dirname(os.path.realpath(__file__))
43
self.path = os.path.join(here, '../templates/main-template.pt')