Changeset 7819 for main/waeup.kofa/trunk/src/waeup/kofa/app.txt
- Timestamp:
- 8 Mar 2012, 22:28:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/app.txt
r7811 r7819 1 :mod:`waeup.kofa.app` -- central components for K OFA1 :mod:`waeup.kofa.app` -- central components for Kofa 2 2 **************************************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer5 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 6 6 7 7 .. module:: waeup.kofa.app … … 9 9 .. class:: University 10 10 11 The main K OFAapplication object is given with11 The main Kofa application object is given with 12 12 :class:`University`. It provides the main containers as faculties, 13 13 hostels, etc. … … 76 76 first:: 77 77 78 >>> from waeup.kofa.interfaces import IK OFAExporter79 >>> exporter = IK OFAExporter(myuniversity)78 >>> from waeup.kofa.interfaces import IKofaExporter 79 >>> exporter = IKofaExporter(myuniversity) 80 80 >>> exporter 81 81 <waeup.kofa.utils.importexport.Exporter object at 0x...> … … 90 90 memory file:: 91 91 92 >>> from waeup.kofa.interfaces import IK OFAXMLExporter93 >>> exporter = IK OFAXMLExporter(myuniversity)92 >>> from waeup.kofa.interfaces import IKofaXMLExporter 93 >>> exporter = IKofaXMLExporter(myuniversity) 94 94 >>> f = exporter.export() 95 95 >>> f … … 103 103 </pickle> 104 104 105 K OFAplugins105 Kofa plugins 106 106 ============ 107 107 108 108 waeup.kofa provides an API to 'plugin' components. Things that should 109 be setup at creation time of a K OFAapplication can indicate110 that by providing a utility providing IK OFAPlugin.109 be setup at creation time of a Kofa application can indicate 110 that by providing a utility providing IKofaPlugin. 111 111 112 112 The plugins are looked up by an created app, which then will call the 113 113 ``setup()`` method of each plugin. 114 114 115 >>> from waeup.kofa.interfaces import IK OFAPluggable115 >>> from waeup.kofa.interfaces import IKofaPluggable 116 116 >>> from zope.component import getAdapters, getUtilitiesFor 117 >>> sorted(list(getUtilitiesFor(IK OFAPluggable)))117 >>> sorted(list(getUtilitiesFor(IKofaPluggable))) 118 118 [(u'accesscodes', <waeup.kofa.accesscodes...AccessCodePlugin ...)] 119 119 … … 122 122 123 123 >>> import grok 124 >>> from waeup.kofa.interfaces import IK OFAPluggable124 >>> from waeup.kofa.interfaces import IKofaPluggable 125 125 >>> class MyPlugin(grok.GlobalUtility): 126 ... grok.implements(IK OFAPluggable)126 ... grok.implements(IKofaPluggable) 127 127 ... def setup(self, site, name, logger): 128 128 ... print "Setup was called for" … … 136 136 True 137 137 138 and setup a new K OFAinstance, we will get a message:138 and setup a new Kofa instance, we will get a message: 139 139 140 140 >>> from waeup.kofa.app import University
Note: See TracChangeset for help on using the changeset viewer.