~replaceafill/ubuntu/trusty/schooltool/2.8_custom-css

« back to all changes in this revision

Viewing changes to src/schooltool/app/catalog.py

  • Committer: Gediminas Paulauskas
  • Date: 2014-04-18 16:25:33 UTC
  • mfrom: (1.1.33)
  • Revision ID: menesis@pov.lt-20140418162533-noklnc6b89w2epee
Tags: 1:2.7.0-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from zope.interface import implementer, implements, implementsOnly
22
22
from zope.intid.interfaces import IIntIds, IIntIdAddedEvent, IIntIdRemovedEvent
23
23
from zope.component import adapter, queryUtility, getUtility
 
24
from zope.component.hooks import getSite
24
25
from zope.container import btree
25
26
from zope.container.contained import Contained
26
27
from zope.lifecycleevent import IObjectModifiedEvent
104
105
 
105
106
    @classmethod
106
107
    def get(cls, ignored=None):
107
 
        app = ISchoolToolApplication(None)
108
 
        catalogs = ICatalogs(app)
109
 
        entry = catalogs.get(cls.key())
110
 
        if entry is None:
111
 
            return None
112
 
        return entry.catalog
 
108
        app = getSite()
 
109
        catalogs = app[APP_CATALOGS_KEY]
 
110
        versioned = catalogs[cls.key()]
 
111
        return versioned.catalog
113
112
 
114
113
    def getVersion(self):
115
114
        return unicode(self.version)
241
240
            # insert text inside quotes verbatim
242
241
            terms.append('"%s"' % part)
243
242
    return ' '.join(terms)
 
243
 
 
244
 
 
245
def getRequestIntIds(request=None):
 
246
    return getUtility(IIntIds)