/usr/share/pyshared/schooltool/app/interfaces.py is in python-schooltool 1:2.1.0-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 | #
# SchoolTool - common information systems platform for school administration
# Copyright (c) 2005 Shuttleworth Foundation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
SchoolTool application interfaces
"""
import zope.schema
from zope.component.interfaces import ObjectEvent, IObjectEvent
from zope.container.interfaces import IContainer
from zope.container.interfaces import IReadContainer
from zope.container.constraints import contains
from zope.interface import implements
from zope.interface import Interface, Attribute
from zope.location.interfaces import IContained
from zope.authentication.interfaces import IAuthentication, ILogout
from schooltool.common import SchoolToolMessage as _
from schooltool.person.interfaces import ICalendarDisplayPreferences
# XXX: misplaced calendar integration
from schooltool.calendar.interfaces import ICalendarEvent
from schooltool.calendar.interfaces import ISchoolToolCalendarEvent
from schooltool.calendar.interfaces import ISchoolToolCalendar
from schooltool.calendar.interfaces import IWriteCalendar
from schooltool.calendar.interfaces import IHaveCalendar
import zope.formlib.textwidgets
zope.formlib.textwidgets._ = _
# Here we do a particulary evil thing: we override the translation (_) function
# in the textwidgets module. This means that all the messages in that module
# are now in the 'schooltool' domain. This is the list of the messages
# (don't remove the list, it is used in localizable string extraction).
textwidgets_strings=[_('Form input is not a file object'),
_("Invalid integer data"),
_("Invalid text data"),
_("Invalid textual data"),
_("Invalid unicode data"),
_("Invalid integer data"),
_("Invalid floating point data"),
_("Invalid datetime data")]
# Events
class IApplicationInitializationEvent(IObjectEvent):
"""The SchoolTool application is being initialized.
Usually subscribers add something to the initialization process.
"""
class ApplicationInitializationEvent(ObjectEvent):
implements(IApplicationInitializationEvent)
class IApplicationStartUpEvent(IObjectEvent):
"""The SchoolTool application has started up.
A hook for plugin initialization.
"""
class ApplicationStartUpEvent(ObjectEvent):
implements(IApplicationStartUpEvent)
class ICatalogSetUpEvent(IObjectEvent):
"""Old style notification that the SchoolTool catalogs are being initialized.
Subject to deprecation. Subscribers should no longer use this to set up their
catalogs.
"""
class CatalogSetUpEvent(ObjectEvent):
implements(ICatalogSetUpEvent)
class ICatalogStartUpEvent(IObjectEvent):
"""The SchoolTool catalogs has started up.
A hook for catalog initialization.
"""
class CatalogStartUpEvent(ObjectEvent):
implements(ICatalogStartUpEvent)
class ISchoolToolApplication(IReadContainer):
"""The main SchoolTool application object.
The application is a read-only container with the following items:
'persons' - IPersonContainer
'groups' - IGroupContainer
'resources' - IResourceContainer
This object can be added as a regular content object to a folder, or
it can be used as the application root object.
"""
title = zope.schema.TextLine(
title=_("Title"),
required=True,
description=_("""The name for the school or organization running
this server. This will be displayed on the public calendar, the
bottom of all pages and in the page title."""))
class IApplicationPreferences(ICalendarDisplayPreferences):
"""Preferences stored in an annotation on the SchoolToolApplication."""
title = zope.schema.TextLine(
title=_("Title"),
required=True,
description=_("""The name for the school or organization running
this server. This will be displayed on the public calendar, the
bottom of all pages and in the page title."""))
frontPageCalendar = zope.schema.Bool(
title=_("Front Page Calendar"),
description=_("""Display site-wide calendar as the front page of the
site."""),
required=False,
default=True)
class IApplicationTabs(Interface):
"""Tab visible settings stored in an annotation on SchoolToolApplication."""
class ISchoolToolAuthentication(IAuthentication, ILogout):
"""A local authentication utility for SchoolTool"""
def setCredentials(request, username, password):
"""Save the username and password in the session.
If the credentials passed are invalid, ValueError is raised.
"""
def clearCredentials(request):
"""Forget the username and password stored in a session"""
class ICalendarParentCrowd(Interface):
"""A crowd object that is used on a calendar's parent.
This is just a marker interface.
"""
def contains(principal):
"""Return True if principal is in the crowd."""
class IAsset(Interface):
"""An asset of a leader."""
leaders = Attribute("Leaders of this asset")
class ICookieLanguageSelector(Interface):
def getLanguageList():
"""Return the list of available languages."""
def getSelectedLanguage():
"""Return the language that is currently selected."""
def setSelectedLanguage():
"""Set the selected language into a cookie."""
class ISchoolToolInitializationUtility(Interface):
def initializeApplication(app):
"""Perform school specific initialization. """
class IPluginAction(Interface):
after = Attribute(
"""A list of action adapter names.
This action must be executed after them.""")
before = Attribute(
"""A list of action adapter names.
This action must be executed before them.""")
def __call__():
"""Perform plugin specific set up."""
class ICatalogStartUp(IPluginAction):
"""Set up SchoolTool catalogs."""
class IPluginInit(IPluginAction):
"""Perform plugin initialization when setting up the SchoolTool
application."""
class IPluginStartUp(IPluginAction):
"""Execute plugin specific code on application startup."""
class ISchoolToolAuthenticationPlugin(ISchoolToolAuthentication):
"""A plugin for local schooltool authentication utility. """
class IVersionedCatalog(IContained):
"""Versioned catalog entry."""
version = zope.schema.TextLine(
title=u"Version",
description=u"Current version of the catalog.")
expired = zope.schema.Bool(
title=u"Expired",
description=u"Expired catalogs should be removed.")
catalog = Attribute("""The catalog object.""")
class ICatalogs(IContainer):
"""Container of versioned catalogs."""
contains(IVersionedCatalog)
|