1 | ## |
---|
2 | ## root.py |
---|
3 | ## Login : <uli@pu.smp.net> |
---|
4 | ## Started on Thu Jan 20 04:17:59 2011 Uli Fouquet |
---|
5 | ## $Id$ |
---|
6 | ## |
---|
7 | ## Copyright (C) 2011 Uli Fouquet |
---|
8 | ## This program is free software; you can redistribute it and/or modify |
---|
9 | ## it under the terms of the GNU General Public License as published by |
---|
10 | ## the Free Software Foundation; either version 2 of the License, or |
---|
11 | ## (at your option) any later version. |
---|
12 | ## |
---|
13 | ## This program is distributed in the hope that it will be useful, |
---|
14 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
15 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
16 | ## GNU General Public License for more details. |
---|
17 | ## |
---|
18 | ## You should have received a copy of the GNU General Public License |
---|
19 | ## along with this program; if not, write to the Free Software |
---|
20 | ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
---|
21 | ## |
---|
22 | """ |
---|
23 | The root for applications. |
---|
24 | """ |
---|
25 | import grok |
---|
26 | from waeup.sirp.applications.interfaces import IApplicationsRoot |
---|
27 | |
---|
28 | class ApplicationsRoot(grok.Container): |
---|
29 | """The root of student applications-related components. |
---|
30 | """ |
---|
31 | grok.implements(IApplicationsRoot) |
---|
32 | |
---|
33 | def addApplicationContainer(self, container, name=None): |
---|
34 | """Add an application container. |
---|
35 | |
---|
36 | Adds an application container that implements `interface` |
---|
37 | under the name `name`. |
---|
38 | |
---|
39 | `container` the container instance to be added. Should |
---|
40 | implement :class:`IApplicationContainer`. |
---|
41 | |
---|
42 | `name` |
---|
43 | the name under which the container will be accessible. We |
---|
44 | usually use names like ``pume_2011`` to indicate, that the |
---|
45 | new container will contain student applications for a |
---|
46 | certain screening type (``pume``) and of the year 2011. |
---|
47 | |
---|
48 | """ |
---|
49 | self[name] = container |
---|
50 | return |
---|