- Timestamp:
- 8 Mar 2012, 19:00:51 (13 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 260 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/__init__.py
r7670 r7811 1 1 import grok 2 from waeup. sirp.interfaces import ISIRPObject2 from waeup.kofa.interfaces import IKOFAObject 3 3 from zope.annotation.attribute import AttributeAnnotations 4 4 from zope.annotation.interfaces import IAnnotations 5 5 6 class SIRPAttributeAnnotations(AttributeAnnotations, grok.Adapter):7 """An adapter to IAnnotations for any SIRPObject.6 class KOFAAttributeAnnotations(AttributeAnnotations, grok.Adapter): 7 """An adapter to IAnnotations for any KOFAObject. 8 8 9 Providing this adapter, each SIRPobject becomes (attribute)9 Providing this adapter, each KOFA object becomes (attribute) 10 10 annotatable. 11 11 """ 12 12 grok.provides(IAnnotations) 13 grok.context(I SIRPObject)13 grok.context(IKOFAObject) -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/__init__.py
r7137 r7811 4 4 5 5 Main content components are defined in 6 :mod:`waeup. sirp.accesscodes.accesscode`. This subpackage also6 :mod:`waeup.kofa.accesscodes.accesscode`. This subpackage also 7 7 provides a _catalog_ to lookup any access code quickly and a 8 8 _workflow_ to guarantee consistent states and transitions when dealing … … 11 11 We also provide UI components to generate, archive, import and 12 12 reimport access codes or batches thereof. These parts are defined in 13 :mod:`waeup. sirp.accesscodes.browser`.13 :mod:`waeup.kofa.accesscodes.browser`. 14 14 15 15 The interfaces of this subpackage are defined in 16 :mod:`waeup. sirp.accesscodes.interfaces`.16 :mod:`waeup.kofa.accesscodes.interfaces`. 17 17 """ 18 from waeup. sirp.accesscodes.accesscode import (18 from waeup.kofa.accesscodes.accesscode import ( 19 19 get_access_code, invalidate_accesscode, disable_accesscode, 20 20 reenable_accesscode, create_accesscode, -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/accesscode.py
r7747 r7811 31 31 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 32 32 from random import SystemRandom as random 33 from waeup. sirp.interfaces import ISIRPPluggable, IObjectHistory34 from waeup. sirp.utils.logger import Logger35 from waeup. sirp.accesscodes.interfaces import (33 from waeup.kofa.interfaces import IKOFAPluggable, IObjectHistory 34 from waeup.kofa.utils.logger import Logger 35 from waeup.kofa.accesscodes.interfaces import ( 36 36 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer 37 37 ) 38 from waeup. sirp.accesscodes.workflow import DISABLED, USED, ac_states_dict38 from waeup.kofa.accesscodes.workflow import DISABLED, USED, ac_states_dict 39 39 40 40 class AccessCode(grok.Model): … … 42 42 43 43 Implements 44 :class:`waeup. sirp.accesscodes.interfaces.IAccessCode`. :class:`AccessCode`44 :class:`waeup.kofa.accesscodes.interfaces.IAccessCode`. :class:`AccessCode` 45 45 instances are normally part of an :class:`AccessCodeBatch` so 46 46 their representation (or code) is built with the containing batch … … 68 68 The state of an access code is something like 'used', 'disabled', 69 69 etc. and determined by the workflow defined in 70 :mod:`waeup. sirp.accesscodes.workflow`. This also means that70 :mod:`waeup.kofa.accesscodes.workflow`. This also means that 71 71 instead of setting the status of an access code directly (you 72 72 can't do that easily, and yes, that's intentionally), you have to 73 73 trigger a transition (that might fail, if the transition is not 74 74 allowed in terms of logic or permissions). See 75 :mod:`waeup. sirp.accesscodes.workflow` for details.75 :mod:`waeup.kofa.accesscodes.workflow` for details. 76 76 77 77 """ … … 139 139 @property 140 140 def history(self): 141 """A :class:`waeup. sirp.objecthistory.ObjectHistory` instance.141 """A :class:`waeup.kofa.objecthistory.ObjectHistory` instance. 142 142 """ 143 143 history = IObjectHistory(self) … … 285 285 If the path does not exist yet, it is created. The path is 286 286 normally ``accesscodes/imports`` below the datacenter storage 287 path (see :data:`waeup. sirp.accesscodes.Datacenter.storage`).287 path (see :data:`waeup.kofa.accesscodes.Datacenter.storage`). 288 288 """ 289 289 site = grok.getSite() … … 403 403 return 404 404 405 logger_name = 'waeup. sirp.${sitename}.accesscodes'405 logger_name = 'waeup.kofa.${sitename}.accesscodes' 406 406 logger_filename = 'accesscodes.log' 407 407 … … 415 415 class AccessCodePlugin(grok.GlobalUtility): 416 416 grok.name('accesscodes') 417 grok.implements(I SIRPPluggable)417 grok.implements(IKOFAPluggable) 418 418 419 419 def setup(self, site, name, logger): … … 481 481 `arg` tells what kind of transition to trigger. This will be a 482 482 transition id like ``'use'`` or ``'init'``, or some transition 483 target like :data:`waeup. sirp.accesscodes.workflow.INITIALIZED`.483 target like :data:`waeup.kofa.accesscodes.workflow.INITIALIZED`. 484 484 485 485 If `toward` is ``False`` (the default) you have to pass a -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/accesscode.txt
r7321 r7811 1 :mod:`waeup. sirp.accesscodes.accesscode` -- access codes (aka PINs)1 :mod:`waeup.kofa.accesscodes.accesscode` -- access codes (aka PINs) 2 2 ******************************************************************* 3 3 4 .. module:: waeup. sirp.accesscodes.accesscode4 .. module:: waeup.kofa.accesscodes.accesscode 5 5 6 6 Components that represent access codes and related. 7 7 8 8 .. :NOdoctest: 9 .. :NOlayer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :NOlayer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 About access-codes … … 28 28 unique random number of 10 digits. 29 29 30 For the generation of the random number :mod:`waeup. sirp` requires a30 For the generation of the random number :mod:`waeup.kofa` requires a 31 31 'urandom' entropy provider which is available with most standard 32 32 Unix/Linux systems. This makes the generated numbers relatively … … 57 57 58 58 The class implements 59 :mod:`waeup. sirp.accesscodes.interfaces.IAccessCode`:60 61 >>> from waeup. sirp.accesscodes.interfaces import IAccessCode62 >>> from waeup. sirp.accesscodes.accesscodes import AccessCode59 :mod:`waeup.kofa.accesscodes.interfaces.IAccessCode`: 60 61 >>> from waeup.kofa.accesscodes.interfaces import IAccessCode 62 >>> from waeup.kofa.accesscodes.accesscodes import AccessCode 63 63 >>> from zope.interface.verify import verifyClass 64 64 >>> verifyClass(IAccessCode, AccessCode) … … 150 150 151 151 A persistent :class:`grok.Model`. It implements 152 :class:`waeup. sirp.accesscodes.interfaces.IAccessCodeBatch`.152 :class:`waeup.kofa.accesscodes.interfaces.IAccessCodeBatch`. 153 153 154 154 When creating a batch, all entries (access-codes) are generated as … … 306 306 :class:`AccessCodeBatch` implements :class:`IAccessCodeBatch`: 307 307 308 >>> from waeup. sirp.accesscodes.interfaces import IAccessCodeBatch309 >>> from waeup. sirp.accesscodes.accesscodes import AccessCodeBatch308 >>> from waeup.kofa.accesscodes.interfaces import IAccessCodeBatch 309 >>> from waeup.kofa.accesscodes.accesscodes import AccessCodeBatch 310 310 >>> from zope.interface.verify import verifyClass 311 311 >>> verifyClass(IAccessCodeBatch, AccessCodeBatch) … … 317 317 318 318 >>> import datetime 319 >>> from waeup. sirp.accesscodes.accesscodes import AccessCodeBatch319 >>> from waeup.kofa.accesscodes.accesscodes import AccessCodeBatch 320 320 >>> batch = AccessCodeBatch( 321 321 ... datetime.datetime(2009, 12, 23), 'Fred','APP', 12.12, 3, num=10) … … 331 331 332 332 >>> [x for x in batch.entries()] 333 [<waeup. sirp...AccessCode object at 0x...>, ...]333 [<waeup.kofa...AccessCode object at 0x...>, ...] 334 334 335 335 Getting a single entry from the batch: … … 338 338 >>> ac = batch.getAccessCode(ac_id) 339 339 >>> ac 340 <waeup. sirp...AccessCode object at 0x...>340 <waeup.kofa...AccessCode object at 0x...> 341 341 342 342 >>> ac is list(batch.entries())[0] … … 374 374 # 375 375 # >>> batch.getAccessCodeForStudentId('some_user_id') 376 # <waeup. sirp...AccessCode object at 0x...>376 # <waeup.kofa...AccessCode object at 0x...> 377 377 # 378 378 #Non-existent values will cause a :exc:`KeyError`: … … 440 440 >>> result = batch.search(0, 'serial') 441 441 >>> result 442 [<waeup. sirp...AccessCode object at 0x...>]442 [<waeup.kofa...AccessCode object at 0x...>] 443 443 444 444 >>> result[0].batch_serial … … 545 545 Creating a batch container: 546 546 547 >>> from waeup. sirp.accesscodes.accesscodes import (547 >>> from waeup.kofa.accesscodes.accesscodes import ( 548 548 ... AccessCodeBatchContainer) 549 549 >>> container = AccessCodeBatchContainer() … … 561 561 562 562 >>> container.search(1, 'serial') 563 [<waeup. sirp...AccessCode object at 0x...>,564 <waeup. sirp...AccessCode object at 0x...>]563 [<waeup.kofa...AccessCode object at 0x...>, 564 <waeup.kofa...AccessCode object at 0x...>] 565 565 566 566 >>> container.search('not-a-number', 'serial') … … 569 569 >>> result = container.search('1', 'serial') 570 570 >>> result 571 [<waeup. sirp...AccessCode object at 0x...>,572 <waeup. sirp...AccessCode object at 0x...>]571 [<waeup.kofa...AccessCode object at 0x...>, 572 <waeup.kofa...AccessCode object at 0x...>] 573 573 574 574 Searching for ACs: … … 576 576 >>> ac = result[0] 577 577 >>> container.search(ac.representation, 'pin') 578 [<waeup. sirp...AccessCode object at 0x...>]578 [<waeup.kofa...AccessCode object at 0x...>] 579 579 580 580 Searching for student IDs: … … 583 583 # ... ac.representation, 'some_user') 584 584 # >>> container.search('some_user', 'stud_id') 585 # [<waeup. sirp...AccessCode object at 0x...>]585 # [<waeup.kofa...AccessCode object at 0x...>] 586 586 587 587 … … 591 591 .. class:: AccessCodePlugin 592 592 593 A `waeup. sirp` plugin that updates existing SIRPuniversity593 A `waeup.kofa` plugin that updates existing KOFA university 594 594 instances so that they provide support for access-codes. 595 595 596 .. attribute:: grok.implements(I SIRPPluggable)596 .. attribute:: grok.implements(IKOFAPluggable) 597 597 .. attribute:: grok.name('accesscodes') 598 598 … … 608 608 609 609 The AccessCodePlugin is available as a global named utility for the 610 I SIRPPluggable interface named ``accesscodes``.610 IKOFAPluggable interface named ``accesscodes``. 611 611 612 612 It is looked up by a university instance when created, so that this … … 615 615 616 616 >>> from zope.component import getUtility 617 >>> from waeup. sirp.interfaces import ISIRPPluggable618 >>> plugin = getUtility(I SIRPPluggable, name='accesscodes')617 >>> from waeup.kofa.interfaces import IKOFAPluggable 618 >>> plugin = getUtility(IKOFAPluggable, name='accesscodes') 619 619 >>> plugin 620 <waeup. sirp.accesscodes.accesscodes.AccessCodePlugin object at 0x...>620 <waeup.kofa.accesscodes.accesscodes.AccessCodePlugin object at 0x...> 621 621 622 622 It provides a `setup()` and an `update()` method. Both have to be -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/api.txt
r6408 r7811 1 :mod:`waeup. sirp.accesscodes` -- Access Codes1 :mod:`waeup.kofa.accesscodes` -- Access Codes 2 2 ********************************************* 3 3 4 .. module:: waeup. sirp.accesscodes4 .. module:: waeup.kofa.accesscodes 5 5 6 6 Components that represent access codes and related components. … … 9 9 ========== 10 10 11 The :mod:`waeup. sirp.accesscodes` module provides the following submodules:11 The :mod:`waeup.kofa.accesscodes` module provides the following submodules: 12 12 13 13 .. toctree:: -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.py
r7747 r7811 21 21 from datetime import datetime 22 22 from hurry.workflow.interfaces import InvalidTransitionError 23 from waeup. sirp.browser.resources import datatable24 from waeup. sirp.browser import SIRPPage, SIRPAddFormPage, NullValidator25 from waeup. sirp.browser.breadcrumbs import Breadcrumb26 from waeup. sirp.browser.viewlets import (23 from waeup.kofa.browser.resources import datatable 24 from waeup.kofa.browser import KOFAPage, KOFAAddFormPage, NullValidator 25 from waeup.kofa.browser.breadcrumbs import Breadcrumb 26 from waeup.kofa.browser.viewlets import ( 27 27 AdminTask, AddActionButton, SearchActionButton, BatchOpButton, ManageLink) 28 from waeup. sirp.interfaces import ISIRPObject29 from waeup. sirp.interfaces import MessageFactory as _30 from waeup. sirp.accesscodes.interfaces import (28 from waeup.kofa.interfaces import IKOFAObject 29 from waeup.kofa.interfaces import MessageFactory as _ 30 from waeup.kofa.accesscodes.interfaces import ( 31 31 IAccessCodeBatchContainer, IAccessCodeBatch, 32 32 ) 33 from waeup. sirp.accesscodes.catalog import search34 from waeup. sirp.browser.layout import action35 36 grok.context(I SIRPObject)37 38 class BatchContainerPage( SIRPPage):33 from waeup.kofa.accesscodes.catalog import search 34 from waeup.kofa.browser.layout import action 35 36 grok.context(IKOFAObject) 37 38 class BatchContainerPage(KOFAPage): 39 39 grok.name('index') 40 40 grok.context(IAccessCodeBatchContainer) … … 55 55 if isinstance(batches, basestring): 56 56 batches = [batches] 57 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')57 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 58 58 for name in batches: 59 59 batch = self.context[name] … … 70 70 self.context.logger_info(ob_class, message) 71 71 72 class AddBatchPage( SIRPAddFormPage):72 class AddBatchPage(KOFAAddFormPage): 73 73 grok.name('add') 74 74 grok.context(IAccessCodeBatchContainer) … … 92 92 mapping = {'a':data['entry_num']})) 93 93 self.flash(_('Data written to ${a}', mapping = {'a':csv_file})) 94 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')94 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 95 95 message = 'created: %s (%d, %f)' % ( 96 96 csv_file, data['entry_num'], data['cost']) … … 103 103 self.redirect(self.url(self.context)) 104 104 105 class ReimportBatchPage( SIRPPage):105 class ReimportBatchPage(KOFAPage): 106 106 """Screen for reimporting AC batches. 107 107 """ … … 139 139 self.flash(_('Successfully reimported: ${a}', 140 140 mapping = {'a':filename})) 141 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')141 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 142 142 message = 'reimported: %s' % filename 143 143 self.context.logger_info(ob_class, message) 144 144 self.redirect(self.url(self.context)) 145 145 146 class BatchContainerSearchPage( SIRPPage):146 class BatchContainerSearchPage(KOFAPage): 147 147 grok.name('search') 148 148 grok.context(IAccessCodeBatchContainer) … … 174 174 if isinstance(entries, basestring): 175 175 entries = [entries] 176 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')176 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 177 177 for entry in entries: 178 178 if 'disable' in form: -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.txt
r7748 r7811 1 :mod:`waeup. sirp.accesscodes.browser` -- UI components for access-codes1 :mod:`waeup.kofa.accesscodes.browser` -- UI components for access-codes 2 2 *********************************************************************** 3 3 4 .. module:: waeup. sirp.accesscodes.browser5 6 Here we visit the access-code related parts of a SIRPsite using4 .. module:: waeup.kofa.accesscodes.browser 5 6 Here we visit the access-code related parts of a KOFA site using 7 7 a virtual browser. 8 8 … … 20 20 >>> root = getRootFolder() 21 21 22 >>> from waeup. sirp.app import University22 >>> from waeup.kofa.app import University 23 23 >>> u = University() 24 24 >>> root['myuniversity'] = u -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser_templates/batchcontainer.pt
r7719 r7811 1 <form i18n:domain="waeup. sirp" method="POST">1 <form i18n:domain="waeup.kofa" method="POST"> 2 2 <p i18n:translate=""> 3 3 The following batches are available: -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser_templates/reimportbatchpage.pt
r7719 r7811 1 <p i18n:domain="waeup. sirp">1 <p i18n:domain="waeup.kofa"> 2 2 Please select the files to reimport. Please note, that batches with 3 3 same name have to be deleted before. 4 4 </p> 5 <form method="POST" i18n:domain="waeup. sirp">5 <form method="POST" i18n:domain="waeup.kofa"> 6 6 <table> 7 7 <thead> -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser_templates/searchpage.pt
r7754 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <br /> 3 3 <input type="submit" class="btn primary" name="search" -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/catalog.py
r7754 r7811 23 23 from hurry.query.query import Query 24 24 from zope.index.text.parsetree import ParseError 25 from waeup. sirp.interfaces import IUniversity, IQueryResultItem26 from waeup. sirp.accesscodes.interfaces import IAccessCode25 from waeup.kofa.interfaces import IUniversity, IQueryResultItem 26 from waeup.kofa.accesscodes.interfaces import IAccessCode 27 27 28 28 class AccessCodeIndexes(grok.Indexes): -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/interfaces.py
r7745 r7811 20 20 from zope import schema 21 21 from zope.interface import Interface 22 from waeup. sirp.interfaces import ISIRPObject23 from waeup. sirp.interfaces import MessageFactory as _22 from waeup.kofa.interfaces import IKOFAObject 23 from waeup.kofa.interfaces import MessageFactory as _ 24 24 25 class IAccessCode(I SIRPObject):25 class IAccessCode(IKOFAObject): 26 26 """An access code. 27 27 """ … … 92 92 ) 93 93 94 class IAccessCodeBatchContainer(I SIRPObject):94 class IAccessCodeBatchContainer(IKOFAObject): 95 95 """A container for access code batches. 96 96 """ -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_accesscode.py
r7719 r7811 28 28 from zope.interface.verify import verifyObject, verifyClass 29 29 from zope.testing import renormalizing 30 from waeup. sirp.app import University31 from waeup. sirp.interfaces import IObjectHistory, ISIRPPluggable32 from waeup. sirp.testing import (30 from waeup.kofa.app import University 31 from waeup.kofa.interfaces import IObjectHistory, IKOFAPluggable 32 from waeup.kofa.testing import ( 33 33 FunctionalLayer, FunctionalTestCase, setUp, tearDown, getRootFolder) 34 from waeup. sirp.accesscodes.accesscode import (34 from waeup.kofa.accesscodes.accesscode import ( 35 35 AccessCodeBatch, get_access_code, invalidate_accesscode, AccessCode, 36 36 disable_accesscode, reenable_accesscode, fire_transition, 37 37 AccessCodeBatchContainer, AccessCodePlugin) 38 from waeup. sirp.accesscodes.interfaces import (38 from waeup.kofa.accesscodes.interfaces import ( 39 39 IAccessCode, IAccessCodeBatch, IAccessCodeBatchContainer,) 40 from waeup. sirp.accesscodes.workflow import INITIALIZED, USED, DISABLED40 from waeup.kofa.accesscodes.workflow import INITIALIZED, USED, DISABLED 41 41 42 42 … … 412 412 def test_iface(self): 413 413 plugin = AccessCodePlugin() 414 assert verifyObject(I SIRPPluggable, plugin)415 assert verifyClass(I SIRPPluggable, AccessCodePlugin)414 assert verifyObject(IKOFAPluggable, plugin) 415 assert verifyClass(IKOFAPluggable, AccessCodePlugin) 416 416 417 417 def test_update_w_ac_container(self): -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_catalog.py
r7195 r7811 22 22 from zope.component.hooks import setSite 23 23 from zope.interface.verify import verifyClass, verifyObject 24 from waeup. sirp.app import University25 from waeup. sirp.interfaces import IQueryResultItem26 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase27 from waeup. sirp.accesscodes.accesscode import (24 from waeup.kofa.app import University 25 from waeup.kofa.interfaces import IQueryResultItem 26 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 27 from waeup.kofa.accesscodes.accesscode import ( 28 28 AccessCodeBatch, invalidate_accesscode, disable_accesscode) 29 from waeup. sirp.accesscodes.workflow import INITIALIZED, USED, DISABLED30 from waeup. sirp.accesscodes.catalog import AccessCodeQueryResultItem, search29 from waeup.kofa.accesscodes.workflow import INITIALIZED, USED, DISABLED 30 from waeup.kofa.accesscodes.catalog import AccessCodeQueryResultItem, search 31 31 32 32 class CatalogTestSetup(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/tests/test_workflow.py
r7195 r7811 18 18 import shutil 19 19 import tempfile 20 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase21 from waeup. sirp.accesscodes.workflow import (20 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 21 from waeup.kofa.accesscodes.workflow import ( 22 22 invalidate_action, disable_used_action, disable_unused_action, 23 23 reenable_action, -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/workflow.py
r7723 r7811 25 25 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 26 26 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 27 from waeup. sirp.accesscodes.interfaces import IAccessCode28 from waeup. sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo29 from waeup. sirp.interfaces import MessageFactory as _30 from waeup. sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo27 from waeup.kofa.accesscodes.interfaces import IAccessCode 28 from waeup.kofa.interfaces import IObjectHistory, IKOFAWorkflowInfo 29 from waeup.kofa.interfaces import MessageFactory as _ 30 from waeup.kofa.workflow import KOFAWorkflow, KOFAWorkflowInfo 31 31 32 32 INITIALIZED = 'initialized' … … 113 113 ) 114 114 115 accesscode_workflow = SIRPWorkflow(ACCESSCODE_TRANSITIONS)115 accesscode_workflow = KOFAWorkflow(ACCESSCODE_TRANSITIONS) 116 116 117 117 class AccessCodeWorkflowState(WorkflowState, grok.Adapter): … … 122 122 state_id = 'wf.accesscode.id' 123 123 124 class AccessCodeWorkflowInfo( SIRPWorkflowInfo, grok.Adapter):124 class AccessCodeWorkflowInfo(KOFAWorkflowInfo, grok.Adapter): 125 125 grok.context(IAccessCode) 126 grok.provides(I SIRPWorkflowInfo)126 grok.provides(IKOFAWorkflowInfo) 127 127 128 128 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/app.py
r7321 r7811 21 21 from zope.component.interfaces import ObjectEvent 22 22 from zope.pluggableauth import PluggableAuthentication 23 from waeup. sirp.authentication import setup_authentication24 from waeup. sirp.datacenter import DataCenter25 from waeup. sirp.students.container import StudentsContainer26 from waeup. sirp.hostels.container import HostelsContainer27 from waeup. sirp.interfaces import (28 IUniversity, I SIRPPluggable, IObjectUpgradeEvent, )29 from waeup. sirp.userscontainer import UsersContainer30 from waeup. sirp.utils.logger import Logger31 from waeup. sirp.utils.helpers import attrs_to_fields32 from waeup. sirp.configuration import ConfigurationContainer23 from waeup.kofa.authentication import setup_authentication 24 from waeup.kofa.datacenter import DataCenter 25 from waeup.kofa.students.container import StudentsContainer 26 from waeup.kofa.hostels.container import HostelsContainer 27 from waeup.kofa.interfaces import ( 28 IUniversity, IKOFAPluggable, IObjectUpgradeEvent, ) 29 from waeup.kofa.userscontainer import UsersContainer 30 from waeup.kofa.utils.logger import Logger 31 from waeup.kofa.utils.helpers import attrs_to_fields 32 from waeup.kofa.configuration import ConfigurationContainer 33 33 34 34 class University(grok.Application, grok.Container, Logger): … … 64 64 """Create instances of all plugins defined somewhere. 65 65 """ 66 for name, plugin in getUtilitiesFor(I SIRPPluggable):66 for name, plugin in getUtilitiesFor(IKOFAPluggable): 67 67 plugin.setup(self, name, self.logger) 68 68 return … … 76 76 self.logger.info('Done.') 77 77 self.logger.info('Now upgrading any plugins.') 78 for name, plugin in getUtilitiesFor(I SIRPPluggable):78 for name, plugin in getUtilitiesFor(IKOFAPluggable): 79 79 plugin.update(self, name, self.logger) 80 80 self.logger.info('Plugin update finished.') -
main/waeup.kofa/trunk/src/waeup/kofa/app.txt
r7333 r7811 1 :mod:`waeup. sirp.app` -- central components for SIRP1 :mod:`waeup.kofa.app` -- central components for KOFA 2 2 **************************************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer5 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 6 6 7 .. module:: waeup. sirp.app7 .. module:: waeup.kofa.app 8 8 9 9 .. class:: University 10 10 11 The main SIRPapplication 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. … … 21 21 An arbitrary object containing "faculties". In the case of 22 22 `University` it is a container of type 23 `waeup. sirp.interfaces.IFacultiesContainer`.23 `waeup.kofa.interfaces.IFacultiesContainer`. 24 24 25 25 … … 37 37 instance: 38 38 39 >>> from waeup. sirp.app import University39 >>> from waeup.kofa.app import University 40 40 >>> myuniversity = University() 41 41 >>> myuniversity 42 <waeup. sirp.app.University object at 0x...>42 <waeup.kofa.app.University object at 0x...> 43 43 44 44 Instances of `University` comply with the interface 45 `waeup. sirp.interfaces.IUniversity`:45 `waeup.kofa.interfaces.IUniversity`: 46 46 47 47 >>> from zope.interface.verify import verifyClass 48 >>> from waeup. sirp.interfaces import IUniversity48 >>> from waeup.kofa.interfaces import IUniversity 49 49 >>> verifyClass(IUniversity, University) 50 50 True … … 53 53 interface: 54 54 55 >>> from waeup. sirp.app import University55 >>> from waeup.kofa.app import University 56 56 >>> myuniversity = University() 57 57 >>> myuniversity['configuration'].name … … 59 59 60 60 >>> myuniversity['faculties'] 61 <waeup. sirp.university.facultiescontainer.FacultiesContainer object at 0x...>61 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 62 62 63 63 >>> myuniversity['students'] 64 <waeup. sirp.students.container.StudentsContainer object at 0x...>64 <waeup.kofa.students.container.StudentsContainer object at 0x...> 65 65 66 66 >>> myuniversity['users'] 67 <waeup. sirp.userscontainer.UsersContainer object at 0x...>67 <waeup.kofa.userscontainer.UsersContainer object at 0x...> 68 68 69 69 >>> myuniversity['datacenter'] 70 <waeup. sirp.datacenter.DataCenter object at 0x...>70 <waeup.kofa.datacenter.DataCenter object at 0x...> 71 71 72 72 >>> myuniversity['configuration'] 73 <waeup. sirp.configuration.ConfigurationContainer object at 0x...>73 <waeup.kofa.configuration.ConfigurationContainer object at 0x...> 74 74 75 75 We can export universities. For this we lookup an appropriate exporter 76 76 first:: 77 77 78 >>> from waeup. sirp.interfaces import ISIRPExporter79 >>> exporter = I SIRPExporter(myuniversity)78 >>> from waeup.kofa.interfaces import IKOFAExporter 79 >>> exporter = IKOFAExporter(myuniversity) 80 80 >>> exporter 81 <waeup. sirp.utils.importexport.Exporter object at 0x...>81 <waeup.kofa.utils.importexport.Exporter object at 0x...> 82 82 83 83 Now we can trigger the export:: … … 90 90 memory file:: 91 91 92 >>> from waeup. sirp.interfaces import ISIRPXMLExporter93 >>> exporter = I SIRPXMLExporter(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 SIRPplugins105 KOFA plugins 106 106 ============ 107 107 108 waeup. sirpprovides an API to 'plugin' components. Things that should109 be setup at creation time of a SIRPapplication can indicate110 that by providing a utility providing I SIRPPlugin.108 waeup.kofa provides an API to 'plugin' components. Things that should 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. sirp.interfaces import ISIRPPluggable115 >>> from waeup.kofa.interfaces import IKOFAPluggable 116 116 >>> from zope.component import getAdapters, getUtilitiesFor 117 >>> sorted(list(getUtilitiesFor(I SIRPPluggable)))118 [(u'accesscodes', <waeup. sirp.accesscodes...AccessCodePlugin ...)]117 >>> sorted(list(getUtilitiesFor(IKOFAPluggable))) 118 [(u'accesscodes', <waeup.kofa.accesscodes...AccessCodePlugin ...)] 119 119 120 120 … … 122 122 123 123 >>> import grok 124 >>> from waeup. sirp.interfaces import ISIRPPluggable124 >>> from waeup.kofa.interfaces import IKOFAPluggable 125 125 >>> class MyPlugin(grok.GlobalUtility): 126 ... grok.implements(I SIRPPluggable)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 SIRPinstance, we will get a message:138 and setup a new KOFA instance, we will get a message: 139 139 140 >>> from waeup. sirp.app import University140 >>> from waeup.kofa.app import University 141 141 >>> site = University() 142 142 Setup was called for 143 <waeup. sirp.app.University object at 0x...>143 <waeup.kofa.app.University object at 0x...> 144 144 145 145 Apparently the plugin can do with the University object whatever it -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/__init__.py
r7377 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.applicants.applicant import (4 from waeup.kofa.applicants.applicant import ( 5 5 Applicant, ApplicantFactory, ApplicantImageStoreHandler, 6 6 ApplicantImageNameChooser, 7 7 ) 8 from waeup. sirp.applicants.container import ApplicantsContainer9 from waeup. sirp.applicants.root import ApplicantsRoot10 from waeup. sirp.applicants.dynamicroles import (8 from waeup.kofa.applicants.container import ApplicantsContainer 9 from waeup.kofa.applicants.root import ApplicantsRoot 10 from waeup.kofa.applicants.dynamicroles import ( 11 11 ApplicantPrincipalRoleManager,) 12 12 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r7686 r7811 26 26 from zope.interface import implementedBy 27 27 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 28 from waeup. sirp.app import University29 from waeup. sirp.image import SIRPImageFile30 from waeup. sirp.imagestorage import DefaultFileStoreHandler31 from waeup. sirp.interfaces import (32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, I SIRPUtils,28 from waeup.kofa.app import University 29 from waeup.kofa.image import KOFAImageFile 30 from waeup.kofa.imagestorage import DefaultFileStoreHandler 31 from waeup.kofa.interfaces import ( 32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IKOFAUtils, 33 33 IExtFileStore, IPDF, IUserAccount) 34 from waeup. sirp.students.vocabularies import RegNumNotInSource35 from waeup. sirp.utils.helpers import attrs_to_fields36 from waeup. sirp.applicants.interfaces import IApplicant, IApplicantEdit37 from waeup. sirp.applicants.workflow import application_states_dict34 from waeup.kofa.students.vocabularies import RegNumNotInSource 35 from waeup.kofa.utils.helpers import attrs_to_fields 36 from waeup.kofa.applicants.interfaces import IApplicant, IApplicantEdit 37 from waeup.kofa.applicants.workflow import application_states_dict 38 38 39 39 class Applicant(grok.Container): … … 76 76 def display_fullname(self): 77 77 middlename = getattr(self, 'middlename', None) 78 sirp_utils = getUtility(ISIRPUtils)79 return sirp_utils.fullname(self.firstname, self.lastname, middlename)78 kofa_utils = getUtility(IKOFAUtils) 79 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 80 80 81 81 def createStudent(self, view=None): … … 196 196 197 197 This chooser is registered as an adapter providing 198 :class:`waeup. sirp.interfaces.IFileStoreNameChooser`.198 :class:`waeup.kofa.interfaces.IFileStoreNameChooser`. 199 199 200 200 File store name choosers like this one are only convenience … … 203 203 manually setting up filenames for applicants. 204 204 205 .. seealso:: :mod:`waeup. sirp.imagestorage`205 .. seealso:: :mod:`waeup.kofa.imagestorage` 206 206 207 207 """ … … 291 291 ApplicantImageStoreHandler, self).createFile( 292 292 store, root, filename, file_id, file) 293 return file, path, SIRPImageFile(293 return file, path, KOFAImageFile( 294 294 file_obj.filename, file_obj.data) 295 295 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/authentication.py
r7364 r7811 21 21 import grok 22 22 from zope.pluggableauth.interfaces import IAuthenticatorPlugin 23 from waeup. sirp.interfaces import IAuthPluginUtility, IUserAccount24 from waeup. sirp.applicants.interfaces import IApplicant25 from waeup. sirp.students.authentication import (23 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount 24 from waeup.kofa.applicants.interfaces import IApplicant 25 from waeup.kofa.students.authentication import ( 26 26 StudentAccount, StudentsAuthenticatorPlugin) 27 27 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/batching.py
r7271 r7811 24 24 from zope.component import queryUtility 25 25 from zope.catalog.interfaces import ICatalog 26 from waeup. sirp.interfaces import (26 from waeup.kofa.interfaces import ( 27 27 IBatchProcessor, IObjectConverter, FatalCSVError) 28 from waeup. sirp.utils.batching import BatchProcessor29 from waeup. sirp.applicants.interfaces import (28 from waeup.kofa.utils.batching import BatchProcessor 29 from waeup.kofa.applicants.interfaces import ( 30 30 IApplicantsContainer, IApplicant, IApplicantUpdateByRegNo) 31 31 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r7741 r7811 28 28 from hurry.workflow.interfaces import ( 29 29 IWorkflowInfo, IWorkflowState, InvalidTransitionError) 30 from waeup. sirp.applicants.interfaces import (30 from waeup.kofa.applicants.interfaces import ( 31 31 IApplicant, IApplicantEdit, IApplicantsRoot, 32 32 IApplicantsContainer, IApplicantsContainerAdd, 33 33 MAX_UPLOAD_SIZE, IApplicantOnlinePayment, IApplicantsUtils 34 34 ) 35 from waeup. sirp.applicants.workflow import INITIALIZED, STARTED, PAID, SUBMITTED36 from waeup. sirp.browser import (37 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,35 from waeup.kofa.applicants.workflow import INITIALIZED, STARTED, PAID, SUBMITTED 36 from waeup.kofa.browser import ( 37 KOFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage, 38 38 DEFAULT_PASSPORT_IMAGE_PATH) 39 from waeup. sirp.browser.interfaces import ICaptchaManager40 from waeup. sirp.browser.breadcrumbs import Breadcrumb41 from waeup. sirp.browser.layout import (39 from waeup.kofa.browser.interfaces import ICaptchaManager 40 from waeup.kofa.browser.breadcrumbs import Breadcrumb 41 from waeup.kofa.browser.layout import ( 42 42 NullValidator, jsaction, action, UtilityView) 43 from waeup. sirp.browser.pages import add_local_role, del_local_roles44 from waeup. sirp.browser.resources import datepicker, tabs, datatable, warning45 from waeup. sirp.interfaces import (46 I SIRPObject, ILocalRolesAssignable, IExtFileStore, IPDF,47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, I SIRPUtils)48 from waeup. sirp.interfaces import MessageFactory as _49 from waeup. sirp.permissions import get_users_with_local_roles50 from waeup. sirp.students.interfaces import IStudentsUtils51 from waeup. sirp.utils.helpers import string_from_bytes, file_size52 from waeup. sirp.widgets.datewidget import (43 from waeup.kofa.browser.pages import add_local_role, del_local_roles 44 from waeup.kofa.browser.resources import datepicker, tabs, datatable, warning 45 from waeup.kofa.interfaces import ( 46 IKOFAObject, ILocalRolesAssignable, IExtFileStore, IPDF, 47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, IKOFAUtils) 48 from waeup.kofa.interfaces import MessageFactory as _ 49 from waeup.kofa.permissions import get_users_with_local_roles 50 from waeup.kofa.students.interfaces import IStudentsUtils 51 from waeup.kofa.utils.helpers import string_from_bytes, file_size 52 from waeup.kofa.widgets.datewidget import ( 53 53 FriendlyDateWidget, FriendlyDateDisplayWidget, 54 54 FriendlyDatetimeDisplayWidget) 55 from waeup. sirp.widgets.phonewidget import PhoneWidget56 from waeup. sirp.widgets.restwidget import ReSTDisplayWidget57 58 grok.context(I SIRPObject) # Make ISIRPObject the default context59 60 class ApplicantsRootPage( SIRPPage):55 from waeup.kofa.widgets.phonewidget import PhoneWidget 56 from waeup.kofa.widgets.restwidget import ReSTDisplayWidget 57 58 grok.context(IKOFAObject) # Make IKOFAObject the default context 59 60 class ApplicantsRootPage(KOFAPage): 61 61 grok.context(IApplicantsRoot) 62 62 grok.name('index') … … 70 70 return 71 71 72 class ApplicantsRootManageFormPage( SIRPEditFormPage):72 class ApplicantsRootManageFormPage(KOFAEditFormPage): 73 73 grok.context(IApplicantsRoot) 74 74 grok.name('manage') … … 141 141 return del_local_roles(self,3,**data) 142 142 143 class ApplicantsContainerAddFormPage( SIRPAddFormPage):143 class ApplicantsContainerAddFormPage(KOFAAddFormPage): 144 144 grok.context(IApplicantsRoot) 145 145 grok.require('waeup.manageApplication') … … 215 215 return self.context.p_id 216 216 217 class ApplicantsContainerPage( SIRPDisplayFormPage):217 class ApplicantsContainerPage(KOFADisplayFormPage): 218 218 """The standard view for regular applicant containers. 219 219 """ … … 232 232 @property 233 233 def introduction(self): 234 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE235 lang = self.request.cookies.get(' sirp.language', portal_language)234 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 235 lang = self.request.cookies.get('kofa.language', portal_language) 236 236 html = self.context.description_dict.get(lang,'') 237 237 if html =='': … … 246 246 return "%s" % self.context.title 247 247 248 class ApplicantsContainerManageFormPage( SIRPEditFormPage):248 class ApplicantsContainerManageFormPage(KOFAEditFormPage): 249 249 grok.context(IApplicantsContainer) 250 250 grok.name('manage') … … 349 349 return del_local_roles(self,3,**data) 350 350 351 class ApplicantAddFormPage( SIRPAddFormPage):351 class ApplicantAddFormPage(KOFAAddFormPage): 352 352 """Add-form to add an applicant. 353 353 """ … … 372 372 return 373 373 374 class ApplicantDisplayFormPage( SIRPDisplayFormPage):374 class ApplicantDisplayFormPage(KOFADisplayFormPage): 375 375 grok.context(IApplicant) 376 376 grok.name('index') … … 484 484 485 485 486 class OnlinePaymentDisplayFormPage( SIRPDisplayFormPage):486 class OnlinePaymentDisplayFormPage(KOFADisplayFormPage): 487 487 """ Page to view an online payment ticket 488 488 """ … … 524 524 self.context.p_state = 'paid' 525 525 self.context.payment_date = datetime.now() 526 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')526 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 527 527 self.context.__parent__.loggerInfo( 528 528 ob_class, 'valid callback: %s' % self.context.p_id) … … 547 547 @property 548 548 def title(self): 549 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE550 return translate(_('Payment Data'), 'waeup. sirp',549 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 550 return translate(_('Payment Data'), 'waeup.kofa', 551 551 target_language=portal_language) 552 552 553 553 @property 554 554 def label(self): 555 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE555 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 556 556 return translate(_('Online Payment Receipt'), 557 'waeup. sirp', target_language=portal_language) \557 'waeup.kofa', target_language=portal_language) \ 558 558 + ' %s' % self.context.p_id 559 559 … … 582 582 #@property 583 583 #def label(self): 584 # portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE584 # portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 585 585 # container_title = self.context.__parent__.title 586 586 # label = translate('Application Record', 587 # 'waeup. sirp', target_language=portal_language)587 # 'waeup.kofa', target_language=portal_language) 588 588 # return container_title + label + self.context.application_number 589 589 … … 638 638 return True 639 639 640 class ApplicantManageFormPage( SIRPEditFormPage):640 class ApplicantManageFormPage(KOFAEditFormPage): 641 641 """A full edit view for applicant data. 642 642 """ … … 716 716 self.wf_info.fireTransition(trans_id) 717 717 self.flash(_('Form has been saved.')) 718 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')718 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 719 719 if fields_string: 720 720 self.context.loggerInfo(ob_class, 'saved: % s' % fields_string) … … 748 748 self.flash(_('Successfully removed: ${a}', 749 749 mapping = {'a':', '.join(deleted)})) 750 ob_class = self.__implemented__.__name__.replace('waeup. sirp.','')750 ob_class = self.__implemented__.__name__.replace('waeup.kofa.','') 751 751 self.context.loggerInfo( 752 752 ob_class, 'removed: % s' % ', '.join(deleted)) … … 883 883 return image 884 884 885 class ApplicantRegistrationPage( SIRPAddFormPage):885 class ApplicantRegistrationPage(KOFAAddFormPage): 886 886 """Captcha'd registration page for applicants. 887 887 """ … … 926 926 self.applyData(applicant, **data) 927 927 self.context.addApplicant(applicant) 928 sirp_utils = getUtility(ISIRPUtils)929 password = sirp_utils.genPassword()928 kofa_utils = getUtility(IKOFAUtils) 929 password = kofa_utils.genPassword() 930 930 IUserAccount(applicant).setPassword(password) 931 931 # Send email with credentials 932 932 login_url = self.url(grok.getSite(), 'login') 933 933 msg = _('You have successfully been registered for the') 934 if sirp_utils.sendCredentials(IUserAccount(applicant),934 if kofa_utils.sendCredentials(IUserAccount(applicant), 935 935 password, login_url, msg): 936 936 self.redirect(self.url(self.context, 'registration_complete', … … 941 941 return 942 942 943 class ApplicantRegistrationEmailSent( SIRPPage):943 class ApplicantRegistrationEmailSent(KOFAPage): 944 944 """Landing page after successful registration. 945 945 """ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantdisplaypage.pt
r7714 r7811 11 11 <img src="" tal:attributes="src view/passport_url" /> 12 12 13 <table i18n:domain="waeup. sirp" class="form-table">13 <table i18n:domain="waeup.kofa" class="form-table"> 14 14 <tbody> 15 15 <tal:block repeat="widget view/widgets"> … … 41 41 </tbody> 42 42 </table> 43 <h3 i18n:domain="waeup. sirp" i18n:translate="">43 <h3 i18n:domain="waeup.kofa" i18n:translate=""> 44 44 Acceptance Fee Payment Tickets 45 45 </h3> 46 <table i18n:domain="waeup. sirp">46 <table i18n:domain="waeup.kofa"> 47 47 <thead> 48 48 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicanteditpage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <h2> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregemailsent.pt
r7710 r7811 1 <div i18n:domain="waeup. sirp">1 <div i18n:domain="waeup.kofa"> 2 2 <p> 3 3 <span i18n:translate=""> An email with your user name and password … … 10 10 </p> 11 11 <p i18n:translate=""> 12 Thanks for using SIRP!12 Thanks for using Kofa! 13 13 </p> 14 14 </div> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantregister.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantscontainermanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" class="edit-form" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" class="edit-form" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantsrootmanagepage.pt
r7710 r7811 1 1 <form action="." tal:attributes="action request/URL" 2 i18n:domain="waeup. sirp" method="POST" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" method="POST" enctype="multipart/form-data"> 3 3 <ul class="tabs" data-tabs="tabs"> 4 4 <li class="active"> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/applicantsrootpage.pt
r7710 r7811 1 <table i18n:domain="waeup. sirp">1 <table i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 <tr> … … 11 11 <tr tal:repeat="entry context/values" class="gradeC"> 12 12 <td tal:content="entry/year">Year 13 </td> 13 </td> 14 14 <td tal:content="entry/__name__">CODE 15 15 </td> -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/container.py
r7800 r7811 23 23 from zope.component.factory import Factory 24 24 from zope.component.interfaces import IFactory 25 from waeup. sirp.applicants.interfaces import (25 from waeup.kofa.applicants.interfaces import ( 26 26 IApplicantsContainer, IApplicantsContainerAdd, 27 27 IApplicantsContainerProvider, IApplicant 28 28 ) 29 from waeup. sirp.utils.helpers import attrs_to_fields29 from waeup.kofa.utils.helpers import attrs_to_fields 30 30 31 31 def generate_applicant_id(container=None): … … 111 111 """ 112 112 grok.implements(IApplicantsContainerProvider) 113 grok.name('waeup. sirp.applicants.ApplicantsContainer')113 grok.name('waeup.kofa.applicants.ApplicantsContainer') 114 114 115 115 #: The applicants container type this provider provides: -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/dynamicroles.py
r7347 r7811 24 24 import grok 25 25 from zope.securitypolicy.interfaces import IPrincipalRoleManager 26 from waeup. sirp.applicants.interfaces import IApplicant27 from waeup. sirp.students.dynamicroles import StudentPrincipalRoleManager26 from waeup.kofa.applicants.interfaces import IApplicant 27 from waeup.kofa.students.dynamicroles import StudentPrincipalRoleManager 28 28 29 29 # All components in here have the same context: Applicant instances -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r7795 r7811 27 27 from zope.schema.interfaces import ( 28 28 ValidationError, ISource, IContextSourceBinder) 29 from waeup. sirp.schema import TextLineChoice30 from waeup. sirp.interfaces import (31 I SIRPObject, year_range, validate_email, academic_sessions_vocab)32 from waeup. sirp.interfaces import MessageFactory as _33 from waeup. sirp.payments.interfaces import IOnlinePayment34 from waeup. sirp.schoolgrades import ResultEntryField35 from waeup. sirp.students.vocabularies import (29 from waeup.kofa.schema import TextLineChoice 30 from waeup.kofa.interfaces import ( 31 IKOFAObject, year_range, validate_email, academic_sessions_vocab) 32 from waeup.kofa.interfaces import MessageFactory as _ 33 from waeup.kofa.payments.interfaces import IOnlinePayment 34 from waeup.kofa.schoolgrades import ResultEntryField 35 from waeup.kofa.students.vocabularies import ( 36 36 lgas_vocab, CertificateSource, GenderSource) 37 from waeup. sirp.university.vocabularies import (37 from waeup.kofa.university.vocabularies import ( 38 38 course_levels, AppCatSource) 39 39 … … 178 178 pass 179 179 180 class IApplicantsRoot(I SIRPObject, IContainer):180 class IApplicantsRoot(IKOFAObject, IContainer): 181 181 """A container for university applicants containers. 182 182 """ 183 183 pass 184 184 185 class IApplicantsContainer(I SIRPObject):185 class IApplicantsContainer(IKOFAObject): 186 186 """An applicants container contains university applicants. 187 187 … … 352 352 'provider'].order = IApplicantsContainer['provider'].order 353 353 354 class IApplicantBaseData(I SIRPObject):354 class IApplicantBaseData(IKOFAObject): 355 355 """The data for an applicant. 356 356 … … 361 361 362 362 This base interface is also implemented by the 363 :class:`waeup. sirp.students.StudentApplication` class in the363 :class:`waeup.kofa.students.StudentApplication` class in the 364 364 students package. Thus, these are the data which are saved after 365 365 admission. … … 589 589 590 590 import grok 591 from waeup. sirp.applicants.interfaces import IApplicantsContainerProvider591 from waeup.kofa.applicants.interfaces import IApplicantsContainerProvider 592 592 593 593 class MyContainerProvider(grok.GlobalUtility): … … 601 601 602 602 >>> from zope.component import getAllUtilitiesRegisteredFor 603 >>> from waeup. sirp.applicants.interfaces import (603 >>> from waeup.kofa.applicants.interfaces import ( 604 604 ... IApplicantsContainerProvider) 605 605 >>> all_providers = getAllUtilitiesRegisteredFor( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/payment.py
r7255 r7811 22 22 from zope.component.interfaces import IFactory 23 23 from zope.interface import implementedBy 24 from waeup. sirp.payments import OnlinePayment25 from waeup. sirp.applicants.interfaces import IApplicantOnlinePayment26 from waeup. sirp.utils.helpers import attrs_to_fields24 from waeup.kofa.payments import OnlinePayment 25 from waeup.kofa.applicants.interfaces import IApplicantOnlinePayment 26 from waeup.kofa.utils.helpers import attrs_to_fields 27 27 28 28 class ApplicantOnlinePayment(OnlinePayment): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py
r7804 r7811 32 32 from zope.formlib.form import setUpEditWidgets 33 33 from zope.publisher.browser import TestRequest 34 from waeup. sirp.applicants.interfaces import IApplicant35 from waeup. sirp.browser import DEFAULT_PASSPORT_IMAGE_PATH36 from waeup. sirp.interfaces import IExtFileStore, IPDF, ISIRPUtils37 from waeup. sirp.interfaces import MessageFactory as _34 from waeup.kofa.applicants.interfaces import IApplicant 35 from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH 36 from waeup.kofa.interfaces import IExtFileStore, IPDF, IKOFAUtils 37 from waeup.kofa.interfaces import MessageFactory as _ 38 38 39 39 SLIP_STYLE = TableStyle( … … 54 54 def title(self): 55 55 container_title = self.context.__parent__.title 56 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE56 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 57 57 ar_translation = translate(_('Application Record'), 58 'waeup. sirp', target_language=portal_language)58 'waeup.kofa', target_language=portal_language) 59 59 return '%s - %s %s' % (container_title, 60 60 ar_translation, self.context.application_number) … … 107 107 if dept is None: 108 108 return data 109 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE109 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 110 110 dp_translation = translate(_('Department:'), 111 'waeup. sirp', target_language=portal_language)111 'waeup.kofa', target_language=portal_language) 112 112 f_label = '<font size=12>%s</font>' % dp_translation 113 113 f_text = '<font size=12>%s</font>' % dept.longtitle() … … 120 120 return data 121 121 fc_translation = translate(_('Faculty:'), 122 'waeup. sirp', target_language=portal_language)122 'waeup.kofa', target_language=portal_language) 123 123 f_label = '<font size=12>%s</font>' % fc_translation 124 124 f_text = '<font size=12>%s</font>' % faculty.longtitle() … … 145 145 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 146 146 view.request.principal.id)) 147 pdf.setCreator(' SIRP')147 pdf.setCreator('KOFA') 148 148 width, height = A4 149 149 style = getSampleStyleSheet() … … 171 171 # Render widget fields 172 172 widgets = self._setUpWidgets() 173 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE173 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 174 174 for widget in widgets: # self.widgets: 175 175 f_label = '<font size=12>%s</font>:' % translate( 176 widget.label.strip(), 'waeup. sirp',176 widget.label.strip(), 'waeup.kofa', 177 177 target_language=portal_language) 178 178 f_label = Paragraph(f_label, style["Normal"]) … … 184 184 data.append([f_label,f_text]) 185 185 adm_translation = translate(_('Admitted Course of Study:'), 186 'waeup. sirp', target_language=portal_language)186 'waeup.kofa', target_language=portal_language) 187 187 f_label = '<font size=12>%s</font>' % adm_translation 188 188 f_text = '<font size=12>%s</font>' % ( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py
r7652 r7811 23 23 from hurry.query.interfaces import IQuery 24 24 from zope.component import getUtility 25 from waeup. sirp.interfaces import ISIRPPluggable26 from waeup. sirp.applicants.interfaces import IApplicantsRoot27 from waeup. sirp.utils.logger import Logger25 from waeup.kofa.interfaces import IKOFAPluggable 26 from waeup.kofa.applicants.interfaces import IApplicantsRoot 27 from waeup.kofa.utils.logger import Logger 28 28 29 29 class ApplicantsRoot(grok.Container, Logger): … … 35 35 local_roles = [] 36 36 37 logger_name = 'waeup. sirp.${sitename}.applicants'37 logger_name = 'waeup.kofa.${sitename}.applicants' 38 38 logger_filename = 'applicants.log' 39 39 … … 46 46 47 47 class ApplicantsPlugin(grok.GlobalUtility): 48 """A SIRPPlugin that creates an applicants root in portal.48 """A KOFAPlugin that creates an applicants root in portal. 49 49 50 50 This plugin should be called by a typical 51 `waeup. sirp.app.Universtiy` instance on creation time. The51 `waeup.kofa.app.Universtiy` instance on creation time. The 52 52 :meth:`update` method normally can also be triggered manually over 53 53 the main site configuration. 54 54 55 Implements :class:`waeup. sirp.interfaces.ISIRPPluggable`55 Implements :class:`waeup.kofa.interfaces.IKOFAPluggable` 56 56 """ 57 57 grok.name('applicants') 58 grok.implements(I SIRPPluggable)58 grok.implements(IKOFAPluggable) 59 59 log_prefix = 'ApplicantsPlugin' 60 60 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/sample_container_data.csv
r6281 r7811 1 1 code,ac_prefix,application_category,provider,prefix,year 2 CODE1,APP,basic,waeup. sirp.applicants.ApplicantsContainer,app,20133 CODE2,DPP,cest,waeup. sirp.applicants.ApplicantsContainer,app,20132 CODE1,APP,basic,waeup.kofa.applicants.ApplicantsContainer,app,2013 3 CODE2,DPP,cest,waeup.kofa.applicants.ApplicantsContainer,app,2013 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r7321 r7811 26 26 from zope.interface import verify, implements 27 27 from zope.location.interfaces import ILocation 28 from waeup. sirp.image.interfaces import ISIRPImageFile29 from waeup. sirp.imagestorage import DefaultStorage30 from waeup. sirp.interfaces import IFileStoreHandler, IFileStoreNameChooser31 from waeup. sirp.applicants import (28 from waeup.kofa.image.interfaces import IKOFAImageFile 29 from waeup.kofa.imagestorage import DefaultStorage 30 from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser 31 from waeup.kofa.applicants import ( 32 32 Applicant, ApplicantFactory, 33 33 ApplicantImageStoreHandler, ApplicantImageNameChooser, 34 34 ) 35 from waeup. sirp.applicants.interfaces import IApplicant36 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer35 from waeup.kofa.applicants.interfaces import IApplicant 36 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 37 37 38 38 class FakeImageLocation(object): 39 39 implements(ILocation) 40 adapts(I SIRPImageFile)40 adapts(IKOFAImageFile) 41 41 def __init__(self, context): 42 42 pass -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicantcopier.py
r7421 r7811 22 22 from hurry.workflow.interfaces import IWorkflowInfo 23 23 from zope.component import getUtility 24 from waeup. sirp.testing import FunctionalLayer25 from waeup. sirp.interfaces import IExtFileStore, IFileStoreNameChooser26 from waeup. sirp.applicants.tests.test_browser import ApplicantsFullSetup24 from waeup.kofa.testing import FunctionalLayer 25 from waeup.kofa.interfaces import IExtFileStore, IFileStoreNameChooser 26 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 27 27 28 28 class ApplicantCopierFunctionalTests(ApplicantsFullSetup): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_authentication.py
r7364 r7811 25 25 from zope.securitypolicy.role import Role 26 26 from zope.securitypolicy.interfaces import IRole, Allow 27 from waeup. sirp.authentication import get_principal_role_manager28 from waeup. sirp.interfaces import IAuthPluginUtility, IUserAccount29 from waeup. sirp.applicants.authentication import (27 from waeup.kofa.authentication import get_principal_role_manager 28 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount 29 from waeup.kofa.applicants.authentication import ( 30 30 ApplicantsAuthenticatorSetup, ApplicantAccount) 31 from waeup. sirp.applicants.tests.test_browser import ApplicantsFullSetup32 from waeup. sirp.testing import FunctionalLayer31 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 32 from waeup.kofa.testing import FunctionalLayer 33 33 34 34 class ApplicantsAuthenticatorSetupTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_batching.py
r7509 r7811 27 27 from zope.interface.verify import verifyClass, verifyObject 28 28 29 from waeup. sirp.app import University30 from waeup. sirp.applicants.batching import (29 from waeup.kofa.app import University 30 from waeup.kofa.applicants.batching import ( 31 31 ApplicantsContainerImporter, ApplicantImporter) 32 from waeup. sirp.applicants.container import ApplicantsContainer33 from waeup. sirp.applicants.applicant import Applicant34 from waeup. sirp.university.faculty import Faculty35 from waeup. sirp.university.department import Department36 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase37 from waeup. sirp.interfaces import IBatchProcessor32 from waeup.kofa.applicants.container import ApplicantsContainer 33 from waeup.kofa.applicants.applicant import Applicant 34 from waeup.kofa.university.faculty import Faculty 35 from waeup.kofa.university.department import Department 36 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 37 from waeup.kofa.interfaces import IBatchProcessor 38 38 39 39 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
r7795 r7811 29 29 from zope.testbrowser.testing import Browser 30 30 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 31 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase32 from waeup. sirp.app import University33 from waeup. sirp.configuration import SessionConfiguration34 from waeup. sirp.applicants.container import ApplicantsContainer35 from waeup. sirp.applicants.applicant import Applicant36 from waeup. sirp.interfaces import (31 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 32 from waeup.kofa.app import University 33 from waeup.kofa.configuration import SessionConfiguration 34 from waeup.kofa.applicants.container import ApplicantsContainer 35 from waeup.kofa.applicants.applicant import Applicant 36 from waeup.kofa.interfaces import ( 37 37 IExtFileStore, IFileStoreNameChooser, IUserAccount) 38 from waeup. sirp.university.faculty import Faculty39 from waeup. sirp.university.department import Department38 from waeup.kofa.university.faculty import Faculty 39 from waeup.kofa.university.department import Department 40 40 41 41 PH_LEN = 2059 # Length of placeholder file … … 247 247 self.browser.getControl(name="form.year").value = ['2010'] 248 248 self.browser.getControl(name="form.provider").value = [ 249 'waeup. sirp.applicants.ApplicantsContainer']249 'waeup.kofa.applicants.ApplicantsContainer'] 250 250 self.browser.getControl( 251 251 name="form.application_category").value = ['basic'] … … 262 262 self.browser.getControl(name="form.year").value = ['2010'] 263 263 self.browser.getControl(name="form.provider").value = [ 264 'waeup. sirp.applicants.ApplicantsContainer']264 'waeup.kofa.applicants.ApplicantsContainer'] 265 265 self.browser.getControl( 266 266 name="form.application_category").value = ['basic'] … … 277 277 self.browser.getControl(name="form.year").value = ['2010'] 278 278 self.browser.getControl(name="form.provider").value = [ 279 'waeup. sirp.applicants.ApplicantsContainer']279 'waeup.kofa.applicants.ApplicantsContainer'] 280 280 #self.browser.getControl(name="form.ac_prefix").value = ['APP'] 281 281 self.browser.getControl( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_catalog.py
r7260 r7811 28 28 from zope.component.interfaces import ComponentLookupError 29 29 from zope.testbrowser.testing import Browser 30 from waeup. sirp.app import University31 from waeup. sirp.applicants.container import ApplicantsContainer32 from waeup. sirp.applicants.applicant import Applicant33 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase30 from waeup.kofa.app import University 31 from waeup.kofa.applicants.container import ApplicantsContainer 32 from waeup.kofa.applicants.applicant import Applicant 33 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 34 34 35 35 class CatalogTests(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_container.py
r7193 r7811 21 21 import unittest 22 22 from zope.interface.verify import verifyClass, verifyObject 23 from waeup. sirp.applicants import interfaces24 from waeup. sirp.applicants.container import (23 from waeup.kofa.applicants import interfaces 24 from waeup.kofa.applicants.container import ( 25 25 ApplicantsContainer, 26 26 ) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_dynamicroles.py
r7347 r7811 24 24 from zope.securitypolicy.tests.test_annotationprincipalrolemanager import ( 25 25 Test as APRMTest, Manageable) 26 from waeup. sirp.testing import FunctionalLayer27 from waeup. sirp.applicants.tests.test_browser import ApplicantsFullSetup28 from waeup. sirp.applicants import ApplicantPrincipalRoleManager26 from waeup.kofa.testing import FunctionalLayer 27 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 28 from waeup.kofa.applicants import ApplicantPrincipalRoleManager 29 29 30 30 class ApplicantPrincipalRoleManagerTests(APRMTest): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_interfaces.py
r7683 r7811 22 22 from zc.sourcefactory.browser.source import FactoredTerms 23 23 from zope.publisher.browser import TestRequest 24 from waeup. sirp.applicants.interfaces import ApplicationTypeSource25 from waeup. sirp.students.vocabularies import GenderSource24 from waeup.kofa.applicants.interfaces import ApplicationTypeSource 25 from waeup.kofa.students.vocabularies import GenderSource 26 26 27 27 class InterfacesTest(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_payment.py
r7250 r7811 20 20 """ 21 21 22 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase23 from waeup. sirp.applicants.payment import (22 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 23 from waeup.kofa.applicants.payment import ( 24 24 ApplicantOnlinePayment, ApplicantOnlinePaymentFactory) 25 from waeup. sirp.payments.interfaces import IOnlinePayment25 from waeup.kofa.payments.interfaces import IOnlinePayment 26 26 27 27 class ApplicantOnlinePaymentFactoryTest(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_pdf.py
r7416 r7811 22 22 from zope.component import getAdapter 23 23 from zope.interface import verify 24 from waeup. sirp.applicants.pdf import IPDF, PDFApplicationSlip25 from waeup. sirp.applicants.tests.test_browser import ApplicantsFullSetup26 from waeup. sirp.interfaces import IPDF27 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer24 from waeup.kofa.applicants.pdf import IPDF, PDFApplicationSlip 25 from waeup.kofa.applicants.tests.test_browser import ApplicantsFullSetup 26 from waeup.kofa.interfaces import IPDF 27 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 28 28 29 29 class PDFApplicationSlipTests(ApplicantsFullSetup): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_root.py
r7375 r7811 26 26 from zope.component.hooks import setSite, clearSite 27 27 from zope.interface.verify import verifyClass, verifyObject 28 from waeup. sirp.app import University29 from waeup. sirp.applicants import (28 from waeup.kofa.app import University 29 from waeup.kofa.applicants import ( 30 30 interfaces, Applicant, ApplicantsContainer, 31 31 ) 32 from waeup. sirp.applicants.root import (32 from waeup.kofa.applicants.root import ( 33 33 ApplicantsRoot, ApplicantsPlugin, 34 34 ) 35 from waeup. sirp.testing import (35 from waeup.kofa.testing import ( 36 36 FunctionalLayer, FunctionalTestCase, remove_logger) 37 37 … … 45 45 46 46 def setUp(self): 47 remove_logger('waeup. sirp.app.applicants')47 remove_logger('waeup.kofa.app.applicants') 48 48 super(ApplicantsRootTestCase, self).setUp() 49 49 # Setup a sample site for each test … … 79 79 logger = self.app['applicants'].logger 80 80 assert logger is not None 81 assert logger.name == 'waeup. sirp.app.applicants'81 assert logger.name == 'waeup.kofa.app.applicants' 82 82 handlers = logger.handlers 83 83 assert len(handlers) == 1 … … 93 93 logger = self.app['applicants'].logger 94 94 assert logger is not None 95 assert logger.name == 'waeup. sirp.app.applicants'95 assert logger.name == 'waeup.kofa.app.applicants' 96 96 handlers = logger.handlers 97 97 assert len(handlers) == 1 … … 103 103 def create_logger(self): 104 104 # create a logger suitable for local tests. 105 test_logger = logging.getLogger('waeup. sirp.applicants.testlogger')105 test_logger = logging.getLogger('waeup.kofa.applicants.testlogger') 106 106 log = StringIO() 107 107 handler = logging.StreamHandler(log) -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/utils.py
r7682 r7811 20 20 21 21 import grok 22 from waeup. sirp.applicants.interfaces import IApplicantsUtils22 from waeup.kofa.applicants.interfaces import IApplicantsUtils 23 23 24 24 class ApplicantsUtils(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r7714 r7811 18 18 import grok 19 19 from hurry.workflow.interfaces import IWorkflowState 20 from waeup. sirp.interfaces import ISIRPObject21 from waeup. sirp.students.viewlets import PrimaryStudentNavTab22 from waeup. sirp.browser.viewlets import ManageActionButton, PrimaryNavTab23 from waeup. sirp.applicants.interfaces import (20 from waeup.kofa.interfaces import IKOFAObject 21 from waeup.kofa.students.viewlets import PrimaryStudentNavTab 22 from waeup.kofa.browser.viewlets import ManageActionButton, PrimaryNavTab 23 from waeup.kofa.applicants.interfaces import ( 24 24 IApplicant, IApplicantsRoot, IApplicantsContainer, 25 25 IApplicantOnlinePayment, 26 26 ) 27 from waeup. sirp.applicants.browser import (27 from waeup.kofa.applicants.browser import ( 28 28 ApplicantsRootPage, ApplicantsContainerPage, ApplicantManageFormPage, 29 29 ApplicantDisplayFormPage, OnlinePaymentDisplayFormPage 30 30 ) 31 31 32 from waeup. sirp.interfaces import MessageFactory as _32 from waeup.kofa.interfaces import MessageFactory as _ 33 33 34 grok.context(I SIRPObject) # Make ISIRPObject the default context34 grok.context(IKOFAObject) # Make IKOFAObject the default context 35 35 grok.templatedir('browser_templates') 36 36 … … 38 38 """Applicants tab in primary navigation. 39 39 """ 40 grok.context(I SIRPObject)40 grok.context(IKOFAObject) 41 41 grok.order(3) 42 42 grok.require('waeup.viewApplicantsTab') -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/workflow.py
r7690 r7811 21 21 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 22 22 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 23 from waeup. sirp.applicants.interfaces import IApplicantBaseData24 from waeup. sirp.interfaces import IObjectHistory, ISIRPWorkflowInfo, ISIRPUtils25 from waeup. sirp.interfaces import MessageFactory as _26 from waeup. sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo23 from waeup.kofa.applicants.interfaces import IApplicantBaseData 24 from waeup.kofa.interfaces import IObjectHistory, IKOFAWorkflowInfo, IKOFAUtils 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.workflow import KOFAWorkflow, KOFAWorkflowInfo 27 27 28 28 INITIALIZED = 'initialized' … … 137 137 ) 138 138 139 application_workflow = SIRPWorkflow(APPLICATION_TRANSITIONS)139 application_workflow = KOFAWorkflow(APPLICATION_TRANSITIONS) 140 140 141 141 class ApplicationWorkflowState(WorkflowState, grok.Adapter): … … 148 148 state_id = 'wf.application.id' 149 149 150 class ApplicationWorkflowInfo( SIRPWorkflowInfo, grok.Adapter):150 class ApplicationWorkflowInfo(KOFAWorkflowInfo, grok.Adapter): 151 151 """Adapter to adapt Applicant objects to workflow info objects. 152 152 """ 153 153 grok.context(IApplicantBaseData) 154 grok.provides(I SIRPWorkflowInfo)154 grok.provides(IKOFAWorkflowInfo) 155 155 156 156 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r7658 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Authentication for SIRP.18 """Authentication for KOFA. 19 19 """ 20 20 import grok … … 32 32 from zope.password.interfaces import IPasswordManager 33 33 from zope.securitypolicy.principalrole import principalRoleManager 34 from waeup. sirp.interfaces import (ILocalRoleSetEvent,34 from waeup.kofa.interfaces import (ILocalRoleSetEvent, 35 35 IUserAccount, IAuthPluginUtility, IPasswordValidator, 36 I SIRPPrincipal, ISIRPPrincipalInfo)36 IKOFAPrincipal, IKOFAPrincipalInfo) 37 37 38 38 def setup_authentication(pau): … … 63 63 return principalRoleManager 64 64 65 class SIRPSessionCredentialsPlugin(grok.GlobalUtility,65 class KOFASessionCredentialsPlugin(grok.GlobalUtility, 66 66 SessionCredentialsPlugin): 67 67 grok.provides(ICredentialsPlugin) … … 72 72 passwordfield = 'form.password' 73 73 74 class SIRPPrincipalInfo(object):75 """An implementation of I SIRPPrincipalInfo.76 77 A SIRPprincipal info is created with id, login, title, description,74 class KOFAPrincipalInfo(object): 75 """An implementation of IKOFAPrincipalInfo. 76 77 A KOFA principal info is created with id, login, title, description, 78 78 phone, email and user_type. 79 79 """ 80 grok.implements(I SIRPPrincipalInfo)80 grok.implements(IKOFAPrincipalInfo) 81 81 82 82 def __init__(self, id, title, description, email, phone, user_type): … … 90 90 self.authenticatorPlugin = None 91 91 92 class SIRPPrincipal(Principal):92 class KOFAPrincipal(Principal): 93 93 """A portal principal. 94 94 95 SIRPprincipals provide an extra `email`, `phone` and `user_type`95 KOFA principals provide an extra `email`, `phone` and `user_type` 96 96 attribute extending ordinary principals. 97 97 """ 98 98 99 grok.implements(I SIRPPrincipal)99 grok.implements(IKOFAPrincipal) 100 100 101 101 def __init__(self, id, title=u'', description=u'', email=u'', … … 112 112 113 113 def __repr__(self): 114 return ' SIRPPrincipal(%r)' % self.id115 116 class Authenticated SIRPPrincipalFactory(grok.MultiAdapter):117 """Creates 'authenticated' SIRPprincipals.118 119 Adapts (principal info, request) to a SIRPPrincipal instance.114 return 'KOFAPrincipal(%r)' % self.id 115 116 class AuthenticatedKOFAPrincipalFactory(grok.MultiAdapter): 117 """Creates 'authenticated' KOFA principals. 118 119 Adapts (principal info, request) to a KOFAPrincipal instance. 120 120 121 121 This adapter is used by the standard PAU to transform 122 SIRPPrincipalInfos into SIRPPrincipal instances.123 """ 124 grok.adapts(I SIRPPrincipalInfo, IRequest)122 KOFAPrincipalInfos into KOFAPrincipal instances. 123 """ 124 grok.adapts(IKOFAPrincipalInfo, IRequest) 125 125 grok.implements(IAuthenticatedPrincipalFactory) 126 126 … … 130 130 131 131 def __call__(self, authentication): 132 principal = SIRPPrincipal(132 principal = KOFAPrincipal( 133 133 self.info.id, 134 134 self.info.title, … … 224 224 if not account.checkPassword(credentials['password']): 225 225 return None 226 return SIRPPrincipalInfo(226 return KOFAPrincipalInfo( 227 227 id=account.name, 228 228 title=account.title, … … 236 236 if account is None: 237 237 return None 238 return SIRPPrincipalInfo(238 return KOFAPrincipalInfo( 239 239 id=account.name, 240 240 title=account.title, -
main/waeup.kofa/trunk/src/waeup/kofa/authentication.txt
r7636 r7811 1 SIRPauthentication1 KOFA authentication 2 2 ******************* 3 3 … … 11 11 12 12 >>> from zope.component.hooks import setSite # only needed in tests 13 >>> from waeup. sirp.app import University13 >>> from waeup.kofa.app import University 14 14 >>> root = getRootFolder() 15 15 >>> u = University() … … 36 36 user credentials and some metadata persistently: 37 37 38 >>> from waeup. sirp.authentication import Account38 >>> from waeup.kofa.authentication import Account 39 39 >>> alice = Account('alice', 'alicesecret',roles=['waeup.ManageDataCenter']) 40 40 >>> root['app']['users'].addAccount(alice) … … 49 49 50 50 >>> alice.getLocalRoles() 51 {'waeup.local.Owner': [<waeup. sirp.authentication.Account object at 0x...>]}51 {'waeup.local.Owner': [<waeup.kofa.authentication.Account object at 0x...>]} 52 52 53 53 User automatically get the global AcademicsOfficer role: … … 71 71 >>> alice.notifyLocalRoleChanged(chalet, 'BigBoss', granted=False) 72 72 >>> alice.getLocalRoles() 73 {'waeup.local.Owner': [<waeup. sirp.authentication.Account object at 0x...>]}73 {'waeup.local.Owner': [<waeup.kofa.authentication.Account object at 0x...>]} 74 74 75 75 We can also use events to trigger such actions. This is recommended 76 76 because we do not neccessarily know where Alice lives: 77 77 78 >>> from waeup. sirp.authentication import LocalRoleSetEvent78 >>> from waeup.kofa.authentication import LocalRoleSetEvent 79 79 >>> from zope.event import notify 80 80 >>> notify(LocalRoleSetEvent(chalet, 'BigBoss', 'alice', … … 92 92 93 93 >>> from zope.securitypolicy.interfaces import IPrincipalRoleManager 94 >>> from waeup. sirp.university.faculty import Faculty94 >>> from waeup.kofa.university.faculty import Faculty 95 95 >>> faculty = Faculty() 96 96 >>> root['app']['bobs_fac'] = faculty … … 105 105 >>> bob = root['app']['users']['bob'] 106 106 >>> bob.getLocalRoles() 107 {'waeup.PortalManager': [<waeup. sirp...Faculty object at 0x...>]}107 {'waeup.PortalManager': [<waeup.kofa...Faculty object at 0x...>]} 108 108 109 109 When we delete the faculty from ZODB, also Bobs roles are modified: … … 111 111 >>> del root['app']['bobs_fac'] 112 112 >>> bob.getLocalRoles() 113 {'waeup.local.Owner': [<waeup. sirp.authentication.Account object at 0x...>]}113 {'waeup.local.Owner': [<waeup.kofa.authentication.Account object at 0x...>]} 114 114 115 115 If one notifies the machinery of a local role removal for an object -
main/waeup.kofa/trunk/src/waeup/kofa/browser/__init__.py
r7321 r7811 1 1 import os 2 2 3 from waeup. sirp.browser.layout import (4 SIRPPage, SIRPForm, SIRPLayout, SIRPDisplayFormPage, SIRPEditFormPage,5 SIRPAddFormPage, NullValidator)6 from waeup. sirp.browser.pages import ContactAdminForm3 from waeup.kofa.browser.layout import ( 4 KOFAPage, KOFAForm, KOFALayout, KOFADisplayFormPage, KOFAEditFormPage, 5 KOFAAddFormPage, NullValidator) 6 from waeup.kofa.browser.pages import ContactAdminForm 7 7 8 8 IMAGE_PATH = os.path.join( -
main/waeup.kofa/trunk/src/waeup/kofa/browser/batchprocessing.txt
r7749 r7811 21 21 Create a site: 22 22 23 >>> from waeup. sirp.app import University23 >>> from waeup.kofa.app import University 24 24 >>> getRootFolder()['app'] = University() 25 25 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/breadcrumbs.py
r7700 r7811 23 23 from zope.publisher.browser import TestRequest 24 24 25 from waeup. sirp.interfaces import (25 from waeup.kofa.interfaces import ( 26 26 IConfigurationContainer, ISessionConfiguration) 27 from waeup. sirp.interfaces import MessageFactory as _28 from waeup. sirp.browser import interfaces29 from waeup. sirp.browser.interfaces import (IBreadcrumb,27 from waeup.kofa.interfaces import MessageFactory as _ 28 from waeup.kofa.browser import interfaces 29 from waeup.kofa.browser.interfaces import (IBreadcrumb, 30 30 IBreadcrumbIgnorable, IBreadcrumbContainer) 31 31 32 32 class Breadcrumb(grok.Adapter): 33 33 """A most general breadcrumb generator. 34 34 """ 35 35 grok.provides(IBreadcrumb) 36 grok.context(interfaces.I SIRPObject)36 grok.context(interfaces.IKOFAObject) 37 37 grok.name('index') 38 38 … … 42 42 parent_viewname = 'index' 43 43 viewname = 'index' 44 44 45 45 def __init__(self, context): 46 46 """Turn a context into a breadcrumb. … … 57 57 return self.context.title 58 58 if hasattr(self.context, 'name'): 59 return self.context.name 59 return self.context.name 60 60 return None 61 61 … … 151 151 class DataCenterBreadcrumb(Breadcrumb): 152 152 """A breadcrumb for data centers. 153 """ 153 """ 154 154 grok.context(interfaces.IDataCenter) 155 155 title = _(u'Data Center') … … 160 160 """ 161 161 grok.context(interfaces.IFaculty) 162 162 163 163 @property 164 164 def title(self): … … 169 169 """ 170 170 grok.context(interfaces.IDepartment) 171 171 172 172 class CourseBreadcrumb(FacultyBreadcrumb): 173 173 """A breadcrumb for courses. 174 174 """ 175 grok.context(interfaces.ICourse) 176 175 grok.context(interfaces.ICourse) 176 177 177 class CertificateBreadcrumb(FacultyBreadcrumb): 178 178 """A breadcrumb for certificates. 179 179 """ 180 grok.context(interfaces.ICertificate) 180 grok.context(interfaces.ICertificate) 181 181 182 182 class CoursesContainerBreadcrumb(Breadcrumb): … … 245 245 246 246 _breadcrumbs = None 247 247 248 248 def __init__(self, context): 249 249 self.context = context -
main/waeup.kofa/trunk/src/waeup/kofa/browser/breadcrumbs.txt
r7172 r7811 11 11 We create a university to check the breadcrumb functionality. 12 12 13 >>> from waeup. sirp.app import University13 >>> from waeup.kofa.app import University 14 14 >>> root = getRootFolder() 15 15 >>> root['app'] = University() … … 22 22 viewname: 23 23 24 >>> from waeup. sirp.browser.breadcrumbs import getBreadcrumbList24 >>> from waeup.kofa.browser.breadcrumbs import getBreadcrumbList 25 25 >>> blist1 = getBreadcrumbList(app, 'index') 26 26 >>> blist1 27 [<waeup. sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>]27 [<waeup.kofa.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>] 28 28 29 29 A slightly more extensive list for the datacenter: … … 32 32 >>> from pprint import pprint 33 33 >>> pprint(blist2) 34 [<waeup. sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>,35 <waeup. sirp.browser.breadcrumbs.AdministrationBreadcrumb object at 0x...>,36 <waeup. sirp.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>]34 [<waeup.kofa.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>, 35 <waeup.kofa.browser.breadcrumbs.AdministrationBreadcrumb object at 0x...>, 36 <waeup.kofa.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>] 37 37 38 38 We get a breadcrumb for university, administration area and data … … 47 47 48 48 >>> pprint([(x.context, x.viewname) for x in blist2]) 49 [(<waeup. sirp.app.University object at 0x...>, 'index'),50 (<waeup. sirp.app.University object at 0x...>, 'administration'),51 (<waeup. sirp.datacenter.DataCenter object at 0x...>, 'index')]49 [(<waeup.kofa.app.University object at 0x...>, 'index'), 50 (<waeup.kofa.app.University object at 0x...>, 'administration'), 51 (<waeup.kofa.datacenter.DataCenter object at 0x...>, 'index')] 52 52 53 53 The administration area breadcrumb might be a surprise, as there is no … … 89 89 Now we can get the breadcrumbs for this view: 90 90 91 >>> from waeup. sirp.browser.breadcrumbs import getBreadcrumbListForView91 >>> from waeup.kofa.browser.breadcrumbs import getBreadcrumbListForView 92 92 >>> blist3 = getBreadcrumbListForView(page) 93 93 >>> [x.title for x in blist3] … … 109 109 The returned breadcrumb container supports iteration: 110 110 111 >>> from waeup. sirp.browser.interfaces import IBreadcrumbContainer111 >>> from waeup.kofa.browser.interfaces import IBreadcrumbContainer 112 112 >>> mybccontainer = IBreadcrumbContainer(page) 113 113 >>> [x.title for x in mybccontainer] … … 131 131 132 132 >>> from zope.component import getAdapter 133 >>> from waeup. sirp.browser.interfaces import IBreadcrumb133 >>> from waeup.kofa.browser.interfaces import IBreadcrumb 134 134 >>> b1 = getAdapter(app, IBreadcrumb, 'index') 135 135 >>> b1 136 <waeup. sirp.browser.breadcrumbs.UniversityBreadcrumb object at 0x...>136 <waeup.kofa.browser.breadcrumbs.UniversityBreadcrumb object at 0x...> 137 137 138 138 Breadcrumb objects provide a title: … … 156 156 >>> b2 = getAdapter(app['datacenter'], IBreadcrumb, 'index') 157 157 >>> b2 158 <waeup. sirp.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...>158 <waeup.kofa.browser.breadcrumbs.DataCenterBreadcrumb object at 0x...> 159 159 160 160 >>> b2.title … … 168 168 169 169 >>> b2.parent 170 (<waeup. sirp.app.University object at 0x...>, 'administration')170 (<waeup.kofa.app.University object at 0x...>, 'administration') 171 171 172 172 This result denotes a new context object (the University instance we … … 184 184 >>> b3 = getAdapter(context, IBreadcrumb, viewname) 185 185 >>> b3 186 <waeup. sirp...breadcrumbs.AdministrationBreadcrumb object at 0x...>186 <waeup.kofa...breadcrumbs.AdministrationBreadcrumb object at 0x...> 187 187 188 188 As you can see, we get an AdministrationBreadcrumb, although the … … 197 197 >>> context, viewname = b3.parent 198 198 >>> context, viewname 199 (<waeup. sirp.app.University object at 0x...>, 'index')199 (<waeup.kofa.app.University object at 0x...>, 'index') 200 200 201 201 We create last breadcrumb: -
main/waeup.kofa/trunk/src/waeup/kofa/browser/browser.txt
r7707 r7811 1 Browsing SIRP1 Browsing KOFA 2 2 ************* 3 3 4 Here we visit all parts of a SIRPportal using a browser.4 Here we visit all parts of a KOFA portal using a browser. 5 5 6 6 University … … 15 15 [] 16 16 17 >>> from waeup. sirp.app import University17 >>> from waeup.kofa.app import University 18 18 >>> u = University() 19 19 >>> root['myuniversity'] = u … … 35 35 >>> print browser.contents 36 36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 37 ...Welcome to WAeUP. SIRP...37 ...Welcome to WAeUP.KOFA... 38 38 ... 39 39 … … 566 566 Courses are stored in :class:`ICoursesContainer` instances with their 567 567 code as key. CoursesContainers are normally availabe as `course` 568 attribute of :class:`waeup. sirp.university.department.Department`568 attribute of :class:`waeup.kofa.university.department.Department` 569 569 instances. 570 570 … … 769 769 with their code as key. CertificatesContainers are normally availabe as 770 770 `certificates` attribute of 771 :class:`waeup. sirp.university.department.Department` instances.771 :class:`waeup.kofa.university.department.Department` instances. 772 772 773 773 To ease the life of users we do not require to browse the -
main/waeup.kofa/trunk/src/waeup/kofa/browser/captcha.py
r7320 r7811 28 28 from zope.interface import Interface 29 29 from zope.publisher.interfaces.http import IHTTPRequest 30 from waeup. sirp.browser import SIRPPage31 from waeup. sirp.browser.interfaces import (30 from waeup.kofa.browser import KOFAPage 31 from waeup.kofa.browser.interfaces import ( 32 32 ICaptchaRequest, ICaptchaResponse, ICaptcha, ICaptchaConfig, 33 33 ICaptchaManager) 34 from waeup. sirp.interfaces import IUniversity34 from waeup.kofa.interfaces import IUniversity 35 35 36 36 # … … 171 171 """ReCaptcha - strong captchas with images, sound, etc. 172 172 173 This is the SIRPimplementation to support captchas as provided by173 This is the KOFA implementation to support captchas as provided by 174 174 http://www.google.com/recaptcha. 175 175 … … 266 266 headers = { 267 267 "Content-type": "application/x-www-form-urlencoded", 268 "User-agent": "reCAPTCHA Python SIRP",268 "User-agent": "reCAPTCHA Python KOFA", 269 269 } 270 270 ) … … 319 319 320 320 321 class CaptchaTestPage( SIRPPage):321 class CaptchaTestPage(KOFAPage): 322 322 # A test page to see a captcha in action 323 323 grok.name('captcha') -
main/waeup.kofa/trunk/src/waeup/kofa/browser/exceptions.py
r7321 r7811 22 22 from zope.publisher.interfaces import INotFound 23 23 from zope.security.interfaces import IUnauthorized 24 from waeup. sirp.browser.layout import SIRPPage24 from waeup.kofa.browser.layout import KOFAPage 25 25 26 26 grok.templatedir('templates') … … 61 61 62 62 63 class NotFoundPage( SIRPPage):63 class NotFoundPage(KOFAPage): 64 64 """A page rendered when an object cannot be found. 65 65 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/interfaces.py
r7333 r7811 20 20 from zope import schema 21 21 from zope.interface import Interface, Attribute 22 from waeup. sirp.interfaces import (23 I SIRPObject, IUniversity, IUsersContainer, IDataCenter)24 from waeup. sirp.university.interfaces import (22 from waeup.kofa.interfaces import ( 23 IKOFAObject, IUniversity, IUsersContainer, IDataCenter) 24 from waeup.kofa.university.interfaces import ( 25 25 IFacultiesContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd, 26 26 ICoursesContainer, ICourse, ICourseAdd, ICertificatesContainer, … … 63 63 Themes are basically collections of CSS- and/or JavaScript files 64 64 stored somewhere. In Grok-contexts these files can be registered 65 as 'resources' (see :mod:`waeup. sirp.browser.resources`).65 as 'resources' (see :mod:`waeup.kofa.browser.resources`). 66 66 67 67 Furthermore, to make themes selectable and distinctable from each -
main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py
r7700 r7811 33 33 from zope.interface import Interface 34 34 from zope.site.hooks import getSite 35 from waeup. sirp.interfaces import ISIRPObject, IUserAccount36 from waeup. sirp.browser.interfaces import ITheme37 from waeup. sirp.browser.theming import get_all_themes, SIRPThemeBase38 from waeup. sirp.students.interfaces import IStudentNavigation39 from waeup. sirp.applicants.interfaces import IApplicant40 from waeup. sirp.authentication import get_principal_role_manager35 from waeup.kofa.interfaces import IKOFAObject, IUserAccount 36 from waeup.kofa.browser.interfaces import ITheme 37 from waeup.kofa.browser.theming import get_all_themes, KOFAThemeBase 38 from waeup.kofa.students.interfaces import IStudentNavigation 39 from waeup.kofa.applicants.interfaces import IApplicant 40 from waeup.kofa.authentication import get_principal_role_manager 41 41 42 42 grok.templatedir('templates') … … 56 56 57 57 def __call__(self, success): 58 action = SIRPAction(self.label, success=success, **self.options)58 action = KOFAAction(self.label, success=success, **self.options) 59 59 self.actions.append(action) 60 60 return action 61 61 62 class SIRPAction(Action):62 class KOFAAction(Action): 63 63 64 64 def __init__(self, label, style='', **options): 65 super( SIRPAction, self).__init__(label, **options)65 super(KOFAAction, self).__init__(label, **options) 66 66 self.style = style 67 67 … … 150 150 return True 151 151 152 class SIRPLayout(UtilityView,Layout):152 class KOFALayout(UtilityView,Layout): 153 153 """A megrok.layout.Layout with additional methods. 154 154 """ 155 155 grok.baseclass() 156 156 157 class SIRPForm(UtilityView,Form):157 class KOFAForm(UtilityView,Form): 158 158 """A megrok.layout.Form with additional methods. 159 159 """ … … 161 161 162 162 def setUpWidgets(self,ignore_request=False): 163 super( SIRPForm,self).setUpWidgets(ignore_request)163 super(KOFAForm,self).setUpWidgets(ignore_request) 164 164 # Width parameters will be overridden by Bootstrap 165 165 # so we have to set the css class … … 171 171 self.widgets['body'].cssClass = 'span9' 172 172 173 class SIRPPage(UtilityView,Page):173 class KOFAPage(UtilityView,Page): 174 174 """A megrok.layout page with additional methods. 175 175 """ 176 176 grok.baseclass() 177 177 178 class SIRPDisplayFormPage(UtilityView,DisplayForm):178 class KOFADisplayFormPage(UtilityView,DisplayForm): 179 179 """A megrok.layout.DisplayForm with additional methods. 180 180 """ … … 182 182 template = default_waeup_display_template 183 183 184 class SIRPEditFormPage(UtilityView,EditForm):184 class KOFAEditFormPage(UtilityView,EditForm): 185 185 """A megrok.layout.EditForm with additional methods. 186 186 """ … … 189 189 190 190 def setUpWidgets(self,ignore_request=False): 191 super( SIRPEditFormPage,self).setUpWidgets(ignore_request)191 super(KOFAEditFormPage,self).setUpWidgets(ignore_request) 192 192 for widget in self.widgets: 193 193 if widget.__class__.__name__ == 'TextWidget': … … 207 207 self.widgets['perm_address'].height = 10 208 208 209 class SIRPAddFormPage(UtilityView,AddForm):209 class KOFAAddFormPage(UtilityView,AddForm): 210 210 """A megrok.layout.AddForm with additional methods. 211 211 """ … … 213 213 template = default_waeup_edit_template 214 214 215 class SiteLayout( SIRPLayout):215 class SiteLayout(KOFALayout): 216 216 """ The general site layout. 217 217 """ 218 grok.context(I SIRPObject)218 grok.context(IKOFAObject) 219 219 220 220 #: An instance of the default theme to use for the site layout 221 default_theme = SIRPThemeBase()221 default_theme = KOFAThemeBase() 222 222 stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt') 223 223 studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt') … … 297 297 hold the internal name of a theme. 298 298 299 A theme in the waeup. sirpsense consists of a list of299 A theme in the waeup.kofa sense consists of a list of 300 300 CSS/JavaScript resources defined in the 301 :mod:`waeup. sirp.browser.resources` module.301 :mod:`waeup.kofa.browser.resources` module. 302 302 303 303 If the context University object has no such attribute or the -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r7750 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ Viewing components for SIRPobjects.18 """ Viewing components for KOFA objects. 19 19 """ 20 20 import copy … … 37 37 from zope.event import notify 38 38 from zope.session.interfaces import ISession 39 from waeup. sirp.browser import (40 SIRPPage, SIRPForm, SIRPEditFormPage, SIRPAddFormPage,41 SIRPDisplayFormPage, NullValidator)42 from waeup. sirp.browser.interfaces import (39 from waeup.kofa.browser import ( 40 KOFAPage, KOFAForm, KOFAEditFormPage, KOFAAddFormPage, 41 KOFADisplayFormPage, NullValidator) 42 from waeup.kofa.browser.interfaces import ( 43 43 IUniversity, IFacultiesContainer, IFaculty, IFacultyAdd, 44 44 IDepartment, IDepartmentAdd, ICourse, ICourseAdd, ICertificate, 45 45 ICertificateAdd, ICertificateCourse, ICertificateCourseAdd) 46 from waeup. sirp.interfaces import MessageFactory as _47 from waeup. sirp.browser.resources import warning, datepicker, tabs, datatable48 from waeup. sirp.interfaces import(49 I SIRPObject, IUsersContainer, IUserAccount, IDataCenter,50 I SIRPXMLImporter, ISIRPXMLExporter, IBatchProcessor,46 from waeup.kofa.interfaces import MessageFactory as _ 47 from waeup.kofa.browser.resources import warning, datepicker, tabs, datatable 48 from waeup.kofa.interfaces import( 49 IKOFAObject, IUsersContainer, IUserAccount, IDataCenter, 50 IKOFAXMLImporter, IKOFAXMLExporter, IBatchProcessor, 51 51 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, 52 52 ISessionConfiguration, ISessionConfigurationAdd, 53 IPasswordValidator, IContactForm, I SIRPUtils)54 from waeup. sirp.permissions import get_users_with_local_roles, get_all_roles55 from waeup. sirp.students.catalog import search as searchstudents56 from waeup. sirp.university.catalog import search57 from waeup. sirp.university.vocabularies import course_levels58 from waeup. sirp.authentication import LocalRoleSetEvent59 from waeup. sirp.widgets.restwidget import ReSTDisplayWidget60 from waeup. sirp.authentication import get_principal_role_manager61 from waeup. sirp.utils.helpers import get_user_account62 from waeup. sirp.browser.layout import jsaction, action, UtilityView63 64 grok.context(I SIRPObject)53 IPasswordValidator, IContactForm, IKOFAUtils) 54 from waeup.kofa.permissions import get_users_with_local_roles, get_all_roles 55 from waeup.kofa.students.catalog import search as searchstudents 56 from waeup.kofa.university.catalog import search 57 from waeup.kofa.university.vocabularies import course_levels 58 from waeup.kofa.authentication import LocalRoleSetEvent 59 from waeup.kofa.widgets.restwidget import ReSTDisplayWidget 60 from waeup.kofa.authentication import get_principal_role_manager 61 from waeup.kofa.utils.helpers import get_user_account 62 from waeup.kofa.browser.layout import jsaction, action, UtilityView 63 64 grok.context(IKOFAObject) 65 65 grok.templatedir('templates') 66 66 … … 144 144 # 145 145 146 class LoginPage( SIRPPage):146 class LoginPage(KOFAPage): 147 147 """A login page, available for all objects. 148 148 """ 149 149 grok.name('login') 150 grok.context(I SIRPObject)150 grok.context(IKOFAObject) 151 151 grok.require('waeup.Public') 152 152 label = _(u'Login') … … 179 179 180 180 181 class LogoutPage( SIRPPage):181 class LogoutPage(KOFAPage): 182 182 """A logout page. Calling this page will log the current user out. 183 183 """ 184 grok.context(I SIRPObject)184 grok.context(IKOFAObject) 185 185 grok.require('waeup.Public') 186 186 grok.name('logout') … … 190 190 auth = getUtility(IAuthentication) 191 191 ILogout(auth).logout(self.request) 192 self.flash(_("You have been logged out. Thanks for using WAeUP SIRP!"))192 self.flash(_("You have been logged out. Thanks for using WAeUP KOFA!")) 193 193 self.redirect(self.application_url()) 194 194 195 195 196 class LanguageChangePage( SIRPPage):196 class LanguageChangePage(KOFAPage): 197 197 """ Language switch 198 198 """ 199 grok.context(I SIRPObject)199 grok.context(IKOFAObject) 200 200 grok.name('change_language') 201 201 grok.require('waeup.Public') 202 202 203 203 def update(self, lang='en', view_name='@@index'): 204 self.response.setCookie(' sirp.language', lang, path='/')204 self.response.setCookie('kofa.language', lang, path='/') 205 205 self.redirect(self.url(self.context, view_name)) 206 206 return … … 213 213 # 214 214 215 class ContactAdminForm( SIRPForm):215 class ContactAdminForm(KOFAForm): 216 216 grok.name('contactadmin') 217 217 #grok.context(IUniversity) … … 242 242 usertype = getattr(self.request.principal, 243 243 'user_type', 'system').title() 244 sirp_utils = getUtility(ISIRPUtils)245 success = sirp_utils.sendContactForm(244 kofa_utils = getUtility(IKOFAUtils) 245 success = kofa_utils.sendContactForm( 246 246 fullname,email, 247 247 self.config.name_admin,self.config.email_admin, … … 263 263 @action(_('Send now'), style='primary') 264 264 def send(self, *args, **data): 265 sirp_utils = getUtility(ISIRPUtils)266 success = sirp_utils.sendContactForm(265 kofa_utils = getUtility(IKOFAUtils) 266 success = kofa_utils.sendContactForm( 267 267 data['fullname'],data['email_from'], 268 268 self.config.name_admin,self.config.email_admin, … … 279 279 # 280 280 281 class UniversityPage( SIRPDisplayFormPage):281 class UniversityPage(KOFADisplayFormPage): 282 282 """ The main university page. 283 283 """ … … 290 290 @property 291 291 def frontpage(self): 292 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE293 lang = self.request.cookies.get(' sirp.language', portal_language)292 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 293 lang = self.request.cookies.get('kofa.language', portal_language) 294 294 html = self.context['configuration'].frontpage_dict.get(lang,'') 295 295 if html =='': … … 297 297 'configuration'].frontpage_dict.get(portal_language,'') 298 298 if html =='': 299 return _(u'<h1>Welcome to WAeUP. SIRP</h1>')299 return _(u'<h1>Welcome to WAeUP.KOFA</h1>') 300 300 else: 301 301 return html 302 302 303 class AdministrationPage( SIRPPage):303 class AdministrationPage(KOFAPage): 304 304 """ The administration overview page. 305 305 """ … … 319 319 320 320 name = 'General news feed' 321 description = 'waeup. sirpnow supports RSS 2.0 feeds :-)'321 description = 'waeup.kofa now supports RSS 2.0 feeds :-)' 322 322 language = None 323 323 date = None … … 378 378 # 379 379 380 class UsersContainerPage( SIRPPage):380 class UsersContainerPage(KOFAPage): 381 381 """Overview page for all local users. 382 382 """ … … 418 418 return site_roles_string 419 419 420 class AddUserFormPage( SIRPAddFormPage):420 class AddUserFormPage(KOFAAddFormPage): 421 421 grok.require('waeup.manageUsers') 422 422 grok.context(IUsersContainer) … … 456 456 self.redirect(self.url(self.context)) 457 457 458 class UserManageFormPage( SIRPEditFormPage):458 class UserManageFormPage(KOFAEditFormPage): 459 459 """Manage a user account. 460 460 """ … … 525 525 usertype = getattr(self.request.principal, 526 526 'user_type', 'system').title() 527 sirp_utils = getUtility(ISIRPUtils)528 success = sirp_utils.sendContactForm(527 kofa_utils = getUtility(IKOFAUtils) 528 success = kofa_utils.sendContactForm( 529 529 self.request.principal.title,email, 530 530 self.context.title,self.context.email, … … 550 550 self.widgets['title'].displayWidth = 30 551 551 552 class MyRolesPage( SIRPPage):552 class MyRolesPage(KOFAPage): 553 553 """Display site roles and local roles assigned to officers. 554 554 """ … … 581 581 # 582 582 583 class SearchPage( SIRPPage):583 class SearchPage(KOFAPage): 584 584 """General search page for the academics section. 585 585 """ … … 608 608 # 609 609 610 class ConfigurationContainerDisplayFormPage( SIRPDisplayFormPage):610 class ConfigurationContainerDisplayFormPage(KOFADisplayFormPage): 611 611 """View page of the configuration container. 612 612 """ … … 619 619 form_fields['frontpage'].custom_widget = ReSTDisplayWidget 620 620 621 class ConfigurationContainerManageFormPage( SIRPEditFormPage):621 class ConfigurationContainerManageFormPage(KOFAEditFormPage): 622 622 """Manage page of the configuration container. We always use the 623 623 manage page in the UI not the view page, thus we use the index name here. … … 684 684 return 685 685 686 class SessionConfigurationAddFormPage( SIRPAddFormPage):686 class SessionConfigurationAddFormPage(KOFAAddFormPage): 687 687 """Add a session configuration object to configuration container. 688 688 """ … … 711 711 return 712 712 713 class SessionConfigurationManageFormPage( SIRPEditFormPage):713 class SessionConfigurationManageFormPage(KOFAEditFormPage): 714 714 """Manage session configuration object. 715 715 """ … … 742 742 # 743 743 744 class DatacenterPage( SIRPPage):744 class DatacenterPage(KOFAPage): 745 745 grok.context(IDataCenter) 746 746 grok.name('index') … … 749 749 pnav = 0 750 750 751 class DatacenterUploadPage( SIRPPage):751 class DatacenterUploadPage(KOFAPage): 752 752 grok.context(IDataCenter) 753 753 grok.name('upload') … … 794 794 return '%s_%s%s' % (base, filtered_username, ext.lower()) 795 795 796 class DatacenterImportStep1( SIRPPage):796 class DatacenterImportStep1(KOFAPage): 797 797 """Manual import step 1: choose file 798 798 """ … … 820 820 if select is not None: 821 821 # A filename was selected 822 session = ISession(self.request)['waeup. sirp']822 session = ISession(self.request)['waeup.kofa'] 823 823 session['import_filename'] = select 824 824 self.redirect(self.url(self.context, '@@import2')) 825 825 826 class DatacenterImportStep2( SIRPPage):826 class DatacenterImportStep2(KOFAPage): 827 827 """Manual import step 2: choose importer 828 828 """ … … 909 909 def update(self, mode=None, importer=None, 910 910 back1=None, cancel=None, proceed=None): 911 session = ISession(self.request)['waeup. sirp']911 session = ISession(self.request)['waeup.kofa'] 912 912 self.filename = session.get('import_filename', None) 913 913 … … 944 944 self.flash(warnings) 945 945 946 class DatacenterImportStep3( SIRPPage):946 class DatacenterImportStep3(KOFAPage): 947 947 """Manual import step 3: modify header 948 948 """ … … 1023 1023 1024 1024 def update(self, headerfield=None, back2=None, cancel=None, proceed=None): 1025 session = ISession(self.request)['waeup. sirp']1025 session = ISession(self.request)['waeup.kofa'] 1026 1026 self.filename = session.get('import_filename', None) 1027 1027 self.mode = session.get('import_mode', None) … … 1052 1052 self.flash(warnings) 1053 1053 1054 class DatacenterImportStep4( SIRPPage):1054 class DatacenterImportStep4(KOFAPage): 1055 1055 """Manual import step 4: do actual import 1056 1056 """ … … 1074 1074 self.redirect(self.url(self.context)) 1075 1075 return 1076 session = ISession(self.request)['waeup. sirp']1076 session = ISession(self.request)['waeup.kofa'] 1077 1077 self.filename = session.get('import_filename', None) 1078 1078 self.mode = session.get('import_mode', None) … … 1111 1111 mapping = {'a':linenum - self.warn_num})) 1112 1112 1113 class DatacenterLogsOverview( SIRPPage):1113 class DatacenterLogsOverview(KOFAPage): 1114 1114 grok.context(IDataCenter) 1115 1115 grok.name('logs') … … 1122 1122 1123 1123 def update(self, show=None, logname=None, back=None): 1124 session = ISession(self.request)['waeup. sirp']1124 session = ISession(self.request)['waeup.kofa'] 1125 1125 if back is not None: 1126 1126 self.redirect(self.url(self.context)) … … 1133 1133 self.files = self.context.getLogFiles() 1134 1134 1135 class DatacenterLogsFileview( SIRPPage):1135 class DatacenterLogsFileview(KOFAPage): 1136 1136 grok.context(IDataCenter) 1137 1137 grok.name('show') … … 1153 1153 self.redirect(self.url(self.context, '@@logs')) 1154 1154 return 1155 session = ISession(self.request)['waeup. sirp']1155 session = ISession(self.request)['waeup.kofa'] 1156 1156 logname = session.get('logname', None) 1157 1157 if back is not None or logname is None: … … 1172 1172 popen.close() 1173 1173 1174 class DatacenterSettings( SIRPPage):1174 class DatacenterSettings(KOFAPage): 1175 1175 grok.context(IDataCenter) 1176 1176 grok.name('manage') … … 1215 1215 1216 1216 def render(self): 1217 exporter = I SIRPXMLExporter(self.context)1217 exporter = IKOFAXMLExporter(self.context) 1218 1218 xml = exporter.export().read() 1219 1219 self.response.setHeader( … … 1221 1221 return xml 1222 1222 1223 class ImportXMLPage( SIRPPage):1223 class ImportXMLPage(KOFAPage): 1224 1224 """Replace the context object by an object created from an XML 1225 1225 representation. … … 1237 1237 if not xmlfile: 1238 1238 return 1239 importer = I SIRPXMLImporter(self.context)1239 importer = IKOFAXMLImporter(self.context) 1240 1240 obj = importer.doImport(xmlfile) 1241 1241 if type(obj) != type(self.context): … … 1257 1257 # 1258 1258 1259 class FacultiesContainerPage( SIRPPage):1259 class FacultiesContainerPage(KOFAPage): 1260 1260 """ Index page for faculty containers. 1261 1261 """ … … 1267 1267 grok.template('facultypage') 1268 1268 1269 class FacultiesContainerManageFormPage( SIRPEditFormPage):1269 class FacultiesContainerManageFormPage(KOFAEditFormPage): 1270 1270 """Manage the basic properties of a `Faculty` instance. 1271 1271 """ … … 1302 1302 1303 1303 1304 class FacultyAddFormPage( SIRPAddFormPage):1304 class FacultyAddFormPage(KOFAAddFormPage): 1305 1305 """ Page form to add a new faculty to a faculty container. 1306 1306 """ … … 1330 1330 # Faculty pages 1331 1331 # 1332 class FacultyPage( SIRPPage):1332 class FacultyPage(KOFAPage): 1333 1333 """Index page of faculties. 1334 1334 """ … … 1342 1342 return _('Departments') 1343 1343 1344 class FacultyManageFormPage( SIRPEditFormPage):1344 class FacultyManageFormPage(KOFAEditFormPage): 1345 1345 """Manage the basic properties of a `Faculty` instance. 1346 1346 """ … … 1416 1416 return del_local_roles(self,3,**data) 1417 1417 1418 class DepartmentAddFormPage( SIRPAddFormPage):1418 class DepartmentAddFormPage(KOFAAddFormPage): 1419 1419 """Add a department to a faculty. 1420 1420 """ … … 1446 1446 # Department pages 1447 1447 # 1448 class DepartmentPage( SIRPPage):1448 class DepartmentPage(KOFAPage): 1449 1449 """Department index page. 1450 1450 """ … … 1475 1475 yield(dict(url=url, name=key, container=val)) 1476 1476 1477 class ShowStudentsInDepartmentPage( SIRPPage):1477 class ShowStudentsInDepartmentPage(KOFAPage): 1478 1478 """Page that lists all students in the department. 1479 1479 """ … … 1510 1510 return hitlist 1511 1511 1512 class DepartmentManageFormPage( SIRPEditFormPage):1512 class DepartmentManageFormPage(KOFAEditFormPage): 1513 1513 """Manage the basic properties of a `Department` instance. 1514 1514 """ … … 1612 1612 return del_local_roles(self,4,**data) 1613 1613 1614 class CourseAddFormPage( SIRPAddFormPage):1614 class CourseAddFormPage(KOFAAddFormPage): 1615 1615 """Add-form to add course to a department. 1616 1616 """ … … 1649 1649 return 1650 1650 1651 class CertificateAddFormPage( SIRPAddFormPage):1651 class CertificateAddFormPage(KOFAAddFormPage): 1652 1652 """Add-form to add certificate to a department. 1653 1653 """ … … 1690 1690 # Courses pages 1691 1691 # 1692 class CoursePage( SIRPDisplayFormPage):1692 class CoursePage(KOFADisplayFormPage): 1693 1693 """Course index page. 1694 1694 """ … … 1703 1703 return '%s (%s)' % (self.context.title, self.context.code) 1704 1704 1705 class CourseManageFormPage( SIRPEditFormPage):1705 class CourseManageFormPage(KOFAEditFormPage): 1706 1706 """Edit form page for courses. 1707 1707 """ … … 1734 1734 # Certificate pages 1735 1735 # 1736 class CertificatePage( SIRPDisplayFormPage):1736 class CertificatePage(KOFADisplayFormPage): 1737 1737 """Index page for certificates. 1738 1738 """ … … 1752 1752 return super(CertificatePage, self).update() 1753 1753 1754 class CertificateManageFormPage( SIRPEditFormPage):1754 class CertificateManageFormPage(KOFAEditFormPage): 1755 1755 """Manage the properties of a `Certificate` instance. 1756 1756 """ … … 1830 1830 1831 1831 1832 class CertificateCourseAddFormPage( SIRPAddFormPage):1832 class CertificateCourseAddFormPage(KOFAAddFormPage): 1833 1833 """Add-page to add a course ref to a certificate 1834 1834 """ … … 1862 1862 # Certificate course pages... 1863 1863 # 1864 class CertificateCoursePage( SIRPPage):1864 class CertificateCoursePage(KOFAPage): 1865 1865 """CertificateCourse index page. 1866 1866 """ … … 1879 1879 return course_levels.getTerm(self.context.level).title 1880 1880 1881 class CertificateCourseManageFormPage( SIRPEditFormPage):1881 class CertificateCourseManageFormPage(KOFAEditFormPage): 1882 1882 """Manage the basic properties of a `CertificateCourse` instance. 1883 1883 """ -
main/waeup.kofa/trunk/src/waeup/kofa/browser/resources.py
r7592 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Special JavaScript and CSS resources provided by waeup. sirp.18 """Special JavaScript and CSS resources provided by waeup.kofa. 19 19 """ 20 20 #from hurry import yui … … 24 24 25 25 26 #: All local resources are registered under the name ``waeup_ sirp``.27 waeup_ sirp = Library('waeup_sirp', 'static')26 #: All local resources are registered under the name ``waeup_kofa``. 27 waeup_kofa = Library('waeup_kofa', 'static') 28 28 29 29 #: A resource that binds a jQueryUI datepicker widget to each … … 36 36 #: require the JavaScript code to be rendered into the page:: 37 37 #: 38 #: from waeup. sirp.browser.resources import datepicker38 #: from waeup.kofa.browser.resources import datepicker 39 39 #: # ... 40 40 #: class MyPage(...): … … 89 89 #: ``"datepicker-us-year"`` 90 90 #: same but also adds a select field for year 91 datepicker = ResourceInclusion(waeup_ sirp, 'datepicker.js',91 datepicker = ResourceInclusion(waeup_kofa, 'datepicker.js', 92 92 depends=[jqueryui]) 93 93 … … 99 99 #: require the JavaScript code to be rendered into the page:: 100 100 #: 101 #: from waeup. sirp.browser.resources import warning101 #: from waeup.kofa.browser.resources import warning 102 102 #: # ... 103 103 #: class MyPage(...): … … 115 115 #: <input type="submit" name="xyz" value="abc"> 116 116 #: onclick="return confirmPost('Are you sure?')"/> 117 warning = ResourceInclusion(waeup_ sirp, 'warning.js')117 warning = ResourceInclusion(waeup_kofa, 'warning.js') 118 118 119 119 #: If you have many select boxes in a from which have to be selected at the same … … 123 123 #: require the JavaScript code to be rendered into the page:: 124 124 #: 125 #: from waeup. sirp.browser.resources import toggleall125 #: from waeup.kofa.browser.resources import toggleall 126 126 #: # ... 127 127 #: class MyPage(...): … … 138 138 #: 139 139 #: <input type="checkbox" onClick="toggle(this, 'entries')" /> 140 toggleall = ResourceInclusion(waeup_ sirp, 'toggleall.js')140 toggleall = ResourceInclusion(waeup_kofa, 'toggleall.js') 141 141 142 142 #: A resource that binds Bootstrap tabs to <div> tags with class … … 150 150 #: tab for redirection:: 151 151 #: 152 #: from waeup. sirp.browser.resources import tabs152 #: from waeup.kofa.browser.resources import tabs 153 153 #: 154 154 #: class MyPage(...): … … 188 188 #: for details. 189 189 #: 190 tabs = ResourceInclusion(waeup_ sirp, 'bootstrap-tabs-1.4.0.js',190 tabs = ResourceInclusion(waeup_kofa, 'bootstrap-tabs-1.4.0.js', 191 191 depends=[jquery]) 192 192 … … 197 197 #: use of datatables you might want to add some specialized CSS like 198 198 #: `datatable_css` below. 199 datatables = ResourceInclusion(waeup_ sirp, 'jquery.dataTables.js',199 datatables = ResourceInclusion(waeup_kofa, 'jquery.dataTables.js', 200 200 minified='jquery.dataTables.min.js', 201 201 depends=[jquery]) 202 202 203 203 #: A stylesheet for datatables 204 datatables_css = ResourceInclusion(waeup_ sirp, 'datatables.css')204 datatables_css = ResourceInclusion(waeup_kofa, 'datatables.css') 205 205 206 206 #: A resource that turns HTML tables into sortable, searchable and : … … 214 214 #: require the JavaScript code to be rendered into the page:: 215 215 #: 216 #: from waeup. sirp.browser.resources import datatable216 #: from waeup.kofa.browser.resources import datatable 217 217 #: # ... 218 218 #: class MyPage(...): … … 251 251 #: for details. 252 252 #: 253 datatable = ResourceInclusion(waeup_ sirp, 'datatable.js',253 datatable = ResourceInclusion(waeup_kofa, 'datatable.js', 254 254 depends=[datatables, datatables_css]) 255 255 256 256 #: Register Twitter's Bootsrap css including dropdown js as a resource. 257 257 bootstrap_min = ResourceInclusion( 258 waeup_ sirp, 'bootstrap-1.4.0.css')258 waeup_kofa, 'bootstrap-1.4.0.css') 259 259 260 260 dropdown = ResourceInclusion( 261 waeup_ sirp, 'bootstrap-dropdown-1.4.0.js',261 waeup_kofa, 'bootstrap-dropdown-1.4.0.js', 262 262 depends=[jquery]) 263 263 264 #: Register basic SIRPCSS (which is based on ``bootstrap.min-1.4.0.css``264 #: Register basic KOFA CSS (which is based on ``bootstrap.min-1.4.0.css`` 265 265 #: and ``base`` as a resource. 266 266 waeup_base_css = ResourceInclusion( 267 waeup_ sirp, 'waeup-base.css',267 waeup_kofa, 'waeup-base.css', 268 268 depends=[dropdown,bootstrap_min, base]) 269 269 270 270 #: A basic theme based on jQuery only (crappy yet). 271 271 waeuptheme_empty = ResourceInclusion( 272 waeup_ sirp, 'empty.css',272 waeup_kofa, 'empty.css', 273 273 depends=[humanity]) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/static/datatable.js
r6023 r7811 4 4 "aaSorting": [[ 1, "asc" ]], 5 5 "aoColumnDefs":[{ "bSortable": false, "aTargets": [ 0 ] }] 6 } ); 6 } ); 7 7 }); 8 8 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/static/datepicker.js
r6060 r7811 1 1 $(function() { 2 $( ".datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', 2 $( ".datepicker" ).datepicker({ dateFormat: 'yy-mm-dd', 3 3 duration: 'fast' 4 4 }); … … 24 24 25 25 $(function() { 26 $( ".datepicker-year" ).datepicker({ dateFormat: 'yy-mm-dd', 26 $( ".datepicker-year" ).datepicker({ dateFormat: 'yy-mm-dd', 27 27 duration: 'fast', 28 28 changeYear: true, -
main/waeup.kofa/trunk/src/waeup/kofa/browser/static/waeup-base.css
r7746 r7811 1 /* This is the base stylesheet for SIRP. It defines base styles1 /* This is the base stylesheet for KOFA. It defines base styles 2 2 additionally or modifying Bootstrap styles. For themes, please create 3 3 a stylesheet overriding values set here in a file named … … 132 132 } 133 133 134 /* SIRPstuff */134 /* KOFA stuff */ 135 135 136 136 div.actionbar { -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatecoursepage.pt
r7705 r7811 1 <table i18n:domain="waeup. sirp" class="form-table">1 <table i18n:domain="waeup.kofa" class="form-table"> 2 2 <thead> 3 3 </thead> … … 6 6 <td i18n:translate="">Code:</td> 7 7 <td tal:content="context/__name__">CODE</td> 8 </tr> 8 </tr> 9 9 <tr> 10 10 <td i18n:translate="">Course Code:</td> 11 11 <td tal:content="context/getCourseCode">THE COURSE</td> 12 </tr> 12 </tr> 13 13 <tr> 14 14 <td i18n:translate="">Course Title:</td> … … 17 17 <tr> 18 18 <td i18n:translate="">Provided by:</td> 19 <td> 19 <td> 20 20 <span tal:content="python: context.course.__parent__.__parent__.longtitle()">DEPARTMENT</span> 21 21 <br /> 22 22 <span tal:content="python: context.course.__parent__.__parent__.__parent__.longtitle()">FACULTY</span> 23 23 </td> 24 </tr> 24 </tr> 25 25 <tr> 26 26 <td i18n:translate="">Level:</td> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatemanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 enctype="multipart/form-data" i18n:domain="waeup. sirp">2 enctype="multipart/form-data" i18n:domain="waeup.kofa"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> … … 7 7 <li tal:attributes="class view/tab3"><a href="#tab-3" i18n:translate="">Local Roles</a></li> 8 8 </ul> 9 9 10 10 <div class="tab-content"> 11 11 <div id="tab-1" tal:attributes="class view/tab1"> … … 136 136 </div> 137 137 </div> 138 </form> 138 </form> 139 139 140 140 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/certificatepage.pt
r7705 r7811 1 1 <table class="form-table"> 2 2 <thead> 3 </thead> 3 </thead> 4 4 <tbody> 5 5 <tal:block repeat="widget view/widgets"> … … 20 20 <h3> 21 21 <span tal:content="context/__name__">Code</span> 22 <span i18n:domain="waeup. sirp" i18n:translate="">Course Referrers</span>22 <span i18n:domain="waeup.kofa" i18n:translate="">Course Referrers</span> 23 23 </h3> 24 24 <br /> 25 <table i18n:domain="waeup. sirp" class="display dataTable">25 <table i18n:domain="waeup.kofa" class="display dataTable"> 26 26 <thead> 27 27 <tr> … … 49 49 tal:content="cc/course/code"> 50 50 COURSE CODE 51 </a> 51 </a> 52 52 <td> 53 53 <span tal:content="cc/course/title"> … … 59 59 MANDATORY 60 60 </span> 61 </td> 61 </td> 62 62 </tr> 63 63 </tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/configurationmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 enctype="multipart/form-data" i18n:domain="waeup. sirp">2 enctype="multipart/form-data" i18n:domain="waeup.kofa"> 3 3 <ul class="tabs" data-tabs="tabs"> 4 4 <li tal:attributes="class view/tab1"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/contactform.pt
r7464 r7811 3 3 4 4 <tal:block repeat="widget view/widgets"> 5 5 6 6 <div tal:condition="python: widget.name != 'form.body'" 7 7 tal:content="widget/label">Label -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterimport1page.pt
r7705 r7811 1 <h3 i18n:domain="waeup. sirp" i18n:translate="">Step 1</h3>2 <p i18n:domain="waeup. sirp" i18n:translate="">1 <h3 i18n:domain="waeup.kofa" i18n:translate="">Step 1</h3> 2 <p i18n:domain="waeup.kofa" i18n:translate=""> 3 3 Using batch processing you can mass-create, mass-update, or 4 4 mass-remove datasets from the database using CSV files. 5 5 </p> 6 <p i18n:domain="waeup. sirp" i18n:translate="">6 <p i18n:domain="waeup.kofa" i18n:translate=""> 7 7 Please select a file for processing from the list below. 8 8 </p> 9 <form i18n:domain="waeup. sirp" method="POST">9 <form i18n:domain="waeup.kofa" method="POST"> 10 10 <table> 11 11 <thead> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterimport2page.pt
r7705 r7811 1 <h3 i18n:domain="waeup. sirp" i18n:translate="">Step 2</h3>2 <form i18n:domain="waeup. sirp" method="POST">1 <h3 i18n:domain="waeup.kofa" i18n:translate="">Step 2</h3> 2 <form i18n:domain="waeup.kofa" method="POST"> 3 3 <p> 4 4 <b i18n:translate="">File:</b> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterimport3page.pt
r7705 r7811 1 <div i18n:domain="waeup. sirp" i18n:translate=""1 <div i18n:domain="waeup.kofa" i18n:translate="" 2 2 class="alert-message success" tal:condition="not: view/getWarnings"> 3 3 Header fields OK 4 4 </div> 5 5 6 <h3 i18n:domain="waeup. sirp" i18n:translate="">Step 3</h3>7 <form i18n:domain="waeup. sirp">6 <h3 i18n:domain="waeup.kofa" i18n:translate="">Step 3</h3> 7 <form i18n:domain="waeup.kofa"> 8 8 <p i18n:translate=""> 9 9 Eventually modify headerfields of import file below. -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterimport4page.pt
r7705 r7811 1 <h3 i18n:domain="waeup. sirp" i18n:translate="">Step 4</h3>2 <p i18n:domain="waeup. sirp" i18n:translate="">1 <h3 i18n:domain="waeup.kofa" i18n:translate="">Step 4</h3> 2 <p i18n:domain="waeup.kofa" i18n:translate=""> 3 3 Batch processing finished. 4 4 </p> 5 <p i18n:domain="waeup. sirp">5 <p i18n:domain="waeup.kofa"> 6 6 <b i18n:translate="">File:</b> <span tal:content="view/filename">Filename.csv</span> 7 7 </p> 8 <p i18n:domain="waeup. sirp">8 <p i18n:domain="waeup.kofa"> 9 9 <b i18n:translate="">Processor:</b> 10 10 <span tal:content="view/importer/name">Importer Name</span> 11 11 </p> 12 <p i18n:domain="waeup. sirp">12 <p i18n:domain="waeup.kofa"> 13 13 <b i18n:translate="">Processing mode: </b> 14 14 <span tal:content="view/mode">mode</span> 15 15 </p> 16 <form method="POST" i18n:domain="waeup. sirp">16 <form method="POST" i18n:domain="waeup.kofa"> 17 17 <input class="btn primary" type="submit" name="finish" 18 18 tal:attributes="value view/back_button" /> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterlogspage.pt
r7705 r7811 1 <div i18n:domain="waeup. sirp" tal:define="files view/files">1 <div i18n:domain="waeup.kofa" tal:define="files view/files"> 2 2 <p i18n:translate="" tal:condition="not: files"> 3 3 Currently no log files are available. -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacentermanagepage.pt
r7705 r7811 1 <form i18n:domain="waeup. sirp" method="POST">1 <form i18n:domain="waeup.kofa" method="POST"> 2 2 <div> 3 3 <span i18n:translate="">Storage path:</span> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/datacenterpage.pt
r7745 r7811 1 <p i18n:domain="waeup. sirp" i18n:translate="">1 <p i18n:domain="waeup.kofa" i18n:translate=""> 2 2 The data center helps you to manage portal data. You can upload CSV 3 3 files here, which will be available for import afterwards. 4 4 </p> 5 5 6 <p i18n:domain="waeup. sirp">6 <p i18n:domain="waeup.kofa"> 7 7 <b i18n:translate="">Storage path:</b> 8 8 <span tal:content="context/storage">/foo/bar</span> 9 9 </p> 10 10 11 <table i18n:domain="waeup. sirp">11 <table i18n:domain="waeup.kofa"> 12 12 <thead> 13 13 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/departmentmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 <ul class="tabs" data-tabs="tabs"> 4 4 <li tal:attributes="class view/tab1"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/departmentpage.pt
r7707 r7811 1 <ul i18n:domain="waeup. sirp" class="tabs" data-tabs="tabs">1 <ul i18n:domain="waeup.kofa" class="tabs" data-tabs="tabs"> 2 2 <li class="active"><a href="#tab-1"> 3 3 <span i18n:translate="">Courses</span></a> … … 7 7 </li> 8 8 </ul> 9 <div i18n:domain="waeup. sirp" class="tab-content">9 <div i18n:domain="waeup.kofa" class="tab-content"> 10 10 <div id="tab-1" class="active"> 11 <br /> 11 <br /> 12 12 <table class="display dataTable"> 13 13 <thead> … … 26 26 <td tal:content="entry/container/title"> 27 27 Title 28 </td> 28 </td> 29 29 </tr> 30 30 </tbody> 31 31 </table> 32 32 <br /><br /> 33 </div> 33 </div> 34 34 <div id="tab-2"> 35 35 <br /> … … 50 50 <td tal:content="entry/container/title"> 51 51 Title 52 </td> 52 </td> 53 53 </tr> 54 54 </tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/facultymanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" 2 i18n:domain="waeup. sirp" method="POST" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" method="POST" enctype="multipart/form-data"> 3 3 <ul class="tabs" data-tabs="tabs"> 4 4 <li tal:attributes="class view/tab1"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/facultypage.pt
r7707 r7811 1 <div i18n:domain="waeup. sirp" i18n:translate="" tal:condition="python: not len(context.keys())">1 <div i18n:domain="waeup.kofa" i18n:translate="" tal:condition="python: not len(context.keys())"> 2 2 There no subobjects registered yet. 3 3 </div> 4 4 5 <table i18n:domain="waeup. sirp">5 <table i18n:domain="waeup.kofa"> 6 6 <thead> 7 7 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/loginpage.pt
r7707 r7811 1 <form i18n:domain="waeup. sirp" method="post">1 <form i18n:domain="waeup.kofa" method="post"> 2 2 <table id="login" class="form-table" summary="Table for entering login information"> 3 3 <tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/myrolespage.pt
r7707 r7811 1 <h3 i18n:domain="waeup. sirp"1 <h3 i18n:domain="waeup.kofa" 2 2 i18n:translate="">My Portal Roles:</h3> 3 <table i18n:domain="waeup. sirp" class="form-table">3 <table i18n:domain="waeup.kofa" class="form-table"> 4 4 <tr tal:repeat="role view/getSiteRoles"> 5 5 <td> … … 9 9 </table> 10 10 11 <h3 i18n:domain="waeup. sirp"11 <h3 i18n:domain="waeup.kofa" 12 12 i18n:translate="">My Local Roles:</h3> 13 13 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/notfound.pt
r7707 r7811 1 <h2 i18n:domain="waeup. sirp" i18n:translate="">1 <h2 i18n:domain="waeup.kofa" i18n:translate=""> 2 2 The page you are trying to access is not available. 3 3 </h2> 4 4 5 <div i18n:domain="waeup. sirp">5 <div i18n:domain="waeup.kofa"> 6 6 <b i18n:translate="">Please note the following:</b></div> 7 <div i18n:domain="waeup. sirp">7 <div i18n:domain="waeup.kofa"> 8 8 <ol class="list"> 9 9 <li i18n:translate=""> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/searchpage.pt
r7707 r7811 6 6 </form> 7 7 <br /> 8 <span i18n:domain="waeup. sirp" tal:condition="view/hitlist">8 <span i18n:domain="waeup.kofa" tal:condition="view/hitlist"> 9 9 <h3 i18n:translate="">Search Results</h3> 10 10 <table class="display dataTable"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/showstudentspage.pt
r7707 r7811 1 <table i18n:domain="waeup. sirp" class="display dataTable">1 <table i18n:domain="waeup.kofa" class="display dataTable"> 2 2 <thead> 3 3 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/staffsitelayout.pt
r7707 r7811 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" i18n:domain="waeup. sirp">2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" i18n:domain="waeup.kofa"> 3 3 <head> 4 4 <title>WAeUP - your way up -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/studentsitelayout.pt
r7707 r7811 1 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" i18n:domain="waeup. sirp">2 <html xmlns="http://www.w3.org/1999/xhtml" i18n:domain="waeup.kofa"> 3 3 <head> 4 4 <title>WAeUP - your way up … … 10 10 <meta name="viewport" content="width=320, initial-scale=1, maximum-scale=1"/> 11 11 <link rel="stylesheet" media="only screen and (max-device-width: 480px)" 12 tal:attributes="href python: view.url(layout.site, '@@/waeup. sirp.browser/mobile.css')"12 tal:attributes="href python: view.url(layout.site, '@@/waeup.kofa.browser/mobile.css')" 13 13 type="text/css" /> 14 14 <link rel="shortcut icon" tal:attributes="href static/favicon.ico" type="image/x-icon" /> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/universityrss20feed.pt
r4989 r7811 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <rss version="2.0" 3 xmlns:tal="http://xml.zope.org/namespaces/tal" 2 <rss version="2.0" 3 xmlns:tal="http://xml.zope.org/namespaces/tal" 4 4 xmlns:atom="http://www.w3.org/2005/Atom"> 5 5 <channel> 6 6 <title> 7 7 <tal:block tal:content="view/title"/> 8 <tal:block 9 tal:define="title view/contexttitle" 8 <tal:block 9 tal:define="title view/contexttitle" 10 10 tal:condition="title"> - <tal:block content="title"/> 11 11 </tal:block> … … 16 16 tal:content="view/description"></description> 17 17 <language 18 tal:condition="view/language" 18 tal:condition="view/language" 19 19 tal:content="view/language"></language> 20 20 <pubDate 21 tal:condition="view/date" 21 tal:condition="view/date" 22 22 tal:content="view/date"></pubDate> 23 23 <lastBuildDate 24 tal:condition="view/buildDate" 24 tal:condition="view/buildDate" 25 25 tal:content="view/buildDate"></lastBuildDate> 26 26 <managingEditor 27 tal:condition="view/editor" 27 tal:condition="view/editor" 28 28 tal:content="view/editor"></managingEditor> 29 29 <webMaster 30 tal:condition="view/webmaster" 30 tal:condition="view/webmaster" 31 31 tal:content="view/webmaster"></webMaster> 32 32 <atom:link 33 tal:attributes="href string:${view/link}@@feeds/${view/name}" 33 tal:attributes="href string:${view/link}@@feeds/${view/name}" 34 34 rel="self" type="application/rss+xml" /> 35 35 <item … … 40 40 tal:content="item/description"></description> 41 41 <guid 42 tal:content="item/guid" 42 tal:content="item/guid" 43 43 tal:define="isPermaLink item/isPermaLink|nothing" 44 44 tal:attributes="isPermaLink python:isPermaLink and 'true' or 'false'"></guid> 45 45 <link 46 tal:condition="item/link|nothing" 46 tal:condition="item/link|nothing" 47 47 tal:content="item/link"></link> 48 48 <author 49 tal:condition="item/author|nothing" 49 tal:condition="item/author|nothing" 50 50 tal:content="item/author"></author> 51 51 <category 52 tal:condition="item/category|nothing" 52 tal:condition="item/category|nothing" 53 53 tal:content="item/category"></category> 54 54 <pubDate 55 tal:condition="item/pubDate|nothing" 55 tal:condition="item/pubDate|nothing" 56 56 tal:content="item/pubDate"></pubDate> 57 57 </item> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/usereditformpage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/templates/userscontainerpage.pt
r7745 r7811 1 <table i18n:domain="waeup. sirp">1 <table i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_captcha.py
r7312 r7811 21 21 from zope.interface import verify 22 22 from zope.publisher.browser import TestRequest 23 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase24 from waeup. sirp.browser.captcha import (23 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 24 from waeup.kofa.browser.captcha import ( 25 25 CaptchaResponse, CaptchaRequest, NullCaptcha, StaticCaptcha, ReCaptcha, 26 26 CaptchaManager) 27 from waeup. sirp.browser.interfaces import (27 from waeup.kofa.browser.interfaces import ( 28 28 ICaptchaRequest, ICaptchaResponse, ICaptcha, ICaptchaConfig, 29 29 ICaptchaManager) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_doctests.py
r7195 r7811 18 18 """Setup doctests for browser module. 19 19 """ 20 from waeup. sirp.testing import get_doctest_suite20 from waeup.kofa.testing import get_doctest_suite 21 21 22 22 def test_suite(): -
main/waeup.kofa/trunk/src/waeup/kofa/browser/tests/test_permissions.py
r7195 r7811 31 31 from zope.security.interfaces import Unauthorized 32 32 from zope.testbrowser.testing import Browser 33 from waeup. sirp.app import University34 from waeup. sirp.testing import (33 from waeup.kofa.app import University 34 from waeup.kofa.testing import ( 35 35 FunctionalLayer, FunctionalTestCase, get_all_loggers, remove_new_loggers, 36 36 remove_logger) -
main/waeup.kofa/trunk/src/waeup/kofa/browser/theming.py
r7459 r7811 23 23 from zope.interface import Interface 24 24 from zope.schema.interfaces import IVocabularyFactory 25 from waeup. sirp.interfaces import SimpleSIRPVocabulary26 from waeup. sirp.browser.interfaces import ITheme27 from waeup. sirp.browser.resources import (25 from waeup.kofa.interfaces import SimpleKOFAVocabulary 26 from waeup.kofa.browser.interfaces import ITheme 27 from waeup.kofa.browser.resources import ( 28 28 waeuptheme_empty, waeup_base_css, 29 29 ) 30 30 31 class SIRPThemeBase(grok.GlobalUtility):31 class KOFAThemeBase(grok.GlobalUtility): 32 32 grok.implements(ITheme) 33 33 grok.name('base waeup theme') … … 38 38 return [waeup_base_css] 39 39 40 #class SIRPThemeRed1(grok.GlobalUtility):40 #class KOFAThemeRed1(grok.GlobalUtility): 41 41 # grok.implements(ITheme) 42 42 # grok.name('red waeup theme') … … 47 47 # return [waeuptheme_red1] 48 48 49 #class SIRPThemeGray1(grok.GlobalUtility):49 #class KOFAThemeGray1(grok.GlobalUtility): 50 50 # grok.implements(ITheme) 51 51 # grok.name('gray waeup theme') … … 56 56 # return [waeuptheme_gray1] 57 57 58 class SIRPThemeEmpty(grok.GlobalUtility):58 class KOFAThemeEmpty(grok.GlobalUtility): 59 59 """A theme based on jQuery only. 60 60 … … 87 87 and registered under the name 88 88 89 'waeup. sirp.browser.theming.ThemesVocabulary'89 'waeup.kofa.browser.theming.ThemesVocabulary' 90 90 91 91 Interface fields that wish to provide a list of available themes 92 92 can require a 'named vocabulary', i.e. set: 93 93 94 vocabulary = 'waeup. sirp.browser.theming.ThemesVocabulary'94 vocabulary = 'waeup.kofa.browser.theming.ThemesVocabulary' 95 95 96 96 and the vocabulary will deliver themes and their descriptive text … … 101 101 """ 102 102 grok.implements(IVocabularyFactory) 103 grok.name('waeup. sirp.browser.theming.ThemesVocabulary')103 grok.name('waeup.kofa.browser.theming.ThemesVocabulary') 104 104 105 105 def __call__(self, context): … … 112 112 terms = [(theme.description, name) 113 113 for name, theme in get_all_themes()] 114 vocab = Simple SIRPVocabulary(*terms)114 vocab = SimpleKOFAVocabulary(*terms) 115 115 return vocab -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r7736 r7811 23 23 from zope.location.interfaces import ISite 24 24 from zope.traversing.browser import absoluteURL 25 from waeup. sirp.browser.pages import (25 from waeup.kofa.browser.pages import ( 26 26 UniversityPage, FacultiesContainerPage, DatacenterPage, FacultyPage, 27 27 DepartmentPage, CoursePage, CertificatePage, CertificateCoursePage, 28 28 UsersContainerPage, UserManageFormPage) 29 from waeup. sirp.browser.interfaces import (29 from waeup.kofa.browser.interfaces import ( 30 30 IFacultiesContainer, IFaculty, IDepartment, ICourse, ICertificate, 31 31 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer) 32 from waeup. sirp.interfaces import (33 I SIRPUtils, ISIRPObject, ISIRPXMLExporter,34 I SIRPXMLImporter, IDataCenter, IUserAccount)35 from waeup. sirp.browser.layout import SIRPPage, default_primary_nav_template36 from waeup. sirp.utils.helpers import get_user_account37 38 from waeup. sirp.interfaces import MessageFactory as _32 from waeup.kofa.interfaces import ( 33 IKOFAUtils, IKOFAObject, IKOFAXMLExporter, 34 IKOFAXMLImporter, IDataCenter, IUserAccount) 35 from waeup.kofa.browser.layout import KOFAPage, default_primary_nav_template 36 from waeup.kofa.utils.helpers import get_user_account 37 38 from waeup.kofa.interfaces import MessageFactory as _ 39 39 40 40 grok.templatedir('templates') 41 grok.context(I SIRPObject) # Make ISIRPObject the default context41 grok.context(IKOFAObject) # Make IKOFAObject the default context 42 42 43 43 class LeftSidebar(grok.ViewletManager): … … 85 85 """ 86 86 grok.baseclass() 87 grok.context(I SIRPObject)87 grok.context(IKOFAObject) 88 88 grok.viewletmanager(ActionBar) 89 89 icon = 'actionicon_modify.png' # File must exist in static/ … … 126 126 # local to the derived class' module. As we often like to 127 127 # get the icons from here 128 # (i.e. waeup. sirp.browser/static), we set the directory128 # (i.e. waeup.kofa.browser/static), we set the directory 129 129 # resource appropiately. 130 130 # … … 134 134 # TODO: notes in here should go to general documentation. 135 135 static = queryAdapter( 136 self.request, Interface, name='waeup. sirp.browser')136 self.request, Interface, name='waeup.kofa.browser') 137 137 return static[self.icon]() 138 138 … … 196 196 197 197 class BreadCrumbs(grok.Viewlet): 198 grok.context(I SIRPObject)198 grok.context(IKOFAObject) 199 199 grok.viewletmanager(BreadCrumbManager) 200 200 grok.order(1) … … 216 216 """ 217 217 grok.viewletmanager(LanguageManager) 218 grok.context(I SIRPObject)218 grok.context(IKOFAObject) 219 219 grok.require('waeup.Public') 220 220 title = u'Languages' 221 221 222 222 def render(self): 223 preferred_languages = getUtility(I SIRPUtils).PREFERRED_LANGUAGES_DICT223 preferred_languages = getUtility(IKOFAUtils).PREFERRED_LANGUAGES_DICT 224 224 html = u'' 225 225 for key, value in sorted( … … 257 257 grok.baseclass() 258 258 grok.viewletmanager(LeftSidebar) 259 grok.context(I SIRPObject)259 grok.context(IKOFAObject) 260 260 grok.order(5) 261 261 grok.require('waeup.manageUniversity') … … 278 278 # local to the derived class' module. As we often like to 279 279 # get the icons from here 280 # (i.e. waeup. sirp.browser/static), we set the directory280 # (i.e. waeup.kofa.browser/static), we set the directory 281 281 # resource appropiately. 282 282 # … … 286 286 # TODO: notes in here should go to general documentation. 287 287 static = queryAdapter( 288 self.request, Interface, name='waeup. sirp.browser')288 self.request, Interface, name='waeup.kofa.browser') 289 289 return static[self.icon]() 290 290 return … … 310 310 311 311 # 312 # waeup. sirp.app.University viewlets...312 # waeup.kofa.app.University viewlets... 313 313 # 314 314 class Login(grok.Viewlet): … … 316 316 """ 317 317 grok.viewletmanager(LeftSidebar) 318 grok.context(I SIRPObject)318 grok.context(IKOFAObject) 319 319 grok.view(Interface) 320 320 grok.order(2) … … 350 350 """ 351 351 grok.viewletmanager(LeftSidebar) 352 grok.context(I SIRPObject)352 grok.context(IKOFAObject) 353 353 grok.view(Interface) 354 354 grok.order(5) … … 520 520 class BrowseActionButton(ActionButton): 521 521 grok.baseclass() 522 grok.context(I SIRPObject)522 grok.context(IKOFAObject) 523 523 grok.template('actionbutton') 524 524 grok.viewletmanager(ActionBar) … … 686 686 target_viewname = 'datacenter' 687 687 688 # The SubobjectLister and its viewlets below are not used in SIRP.688 # The SubobjectLister and its viewlets below are not used in KOFA. 689 689 690 690 class SubobjectLister(grok.ViewletManager): -
main/waeup.kofa/trunk/src/waeup/kofa/catalog.py
r7321 r7811 27 27 from zope.intid.interfaces import IIntIds 28 28 29 from waeup. sirp.app import University30 from waeup. sirp.interfaces import IQueryResultItem29 from waeup.kofa.app import University 30 from waeup.kofa.interfaces import IQueryResultItem 31 31 32 32 # not yet used 33 class SIRPQuery(Query):33 class KOFAQuery(Query): 34 34 """A hurry.query-like query that supports also ``apply``. 35 35 """ … … 50 50 return results 51 51 52 grok.global_utility( SIRPQuery)52 grok.global_utility(KOFAQuery) 53 53 54 54 # not yet used -
main/waeup.kofa/trunk/src/waeup/kofa/catalog.txt
r7321 r7811 1 :mod:`waeup. sirp.catalog` -- Cataloging support SIRP1 :mod:`waeup.kofa.catalog` -- Cataloging support KOFA 2 2 **************************************************** 3 3 4 .. module:: waeup. sirp.catalog4 .. module:: waeup.kofa.catalog 5 5 6 6 Components that support cataloging and searching objects inside a 7 SIRPsite.7 KOFA site. 8 8 9 9 .. :doctest: 10 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer10 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 11 11 12 12 .. contents:: … … 15 15 ======= 16 16 17 :class:` SIRPQuery`17 :class:`KOFAQuery` 18 18 ------------------ 19 19 20 .. class:: SIRPQuery()20 .. class:: KOFAQuery() 21 21 22 22 .. attribute:: grok.implements(hurry.query.interfaces.IQuery) … … 25 25 retrival of plain ``Bree`` result sets as used inside a catalog. 26 26 27 Like `hurry.query.query.Query` objects, ` SIRPQuery` is some kind27 Like `hurry.query.query.Query` objects, `KOFAQuery` is some kind 28 28 of a meta query or 'compound query' that can give the cataloged 29 29 objects (or their int ids) matching one or more 'subqueries'. … … 55 55 ------------------------------ 56 56 57 We can get a SIRPQuery object by asking for an unnamed global utility57 We can get a KOFAQuery object by asking for an unnamed global utility 58 58 implementing `hurry.query.interfaces.IQuery`: 59 59 … … 62 62 >>> q = getUtility(IQuery) 63 63 >>> q 64 <waeup. sirp.catalog.SIRPQuery object at 0x...>64 <waeup.kofa.catalog.KOFAQuery object at 0x...> 65 65 66 66 This query can get 'subqueries' and delivers the objects found or … … 101 101 102 102 We also setup a `zope.intid.interfaces.IIntIds` utility. This is not 103 necessary for plain catalogs, but when we want to use SIRPQuery (or103 necessary for plain catalogs, but when we want to use KOFAQuery (or 104 104 `hurry.query.query.Query` objects), as to get a unique mapping from 105 105 objects (stored in ZODB) to integer numbers (stored in catalogs), … … 204 204 205 205 This can be done by using the ``searchResults`` method of 206 `` SIRPQuery``:206 ``KOFAQuery``: 207 207 208 208 >>> r2 = q.searchResults(subquery1) -
main/waeup.kofa/trunk/src/waeup/kofa/configuration.py
r7314 r7811 22 22 from zope.component.interfaces import IFactory 23 23 from zope.interface import implementedBy 24 from waeup. sirp.interfaces import (24 from waeup.kofa.interfaces import ( 25 25 ISessionConfiguration, IConfigurationContainer, ISessionConfigurationAdd, 26 26 academic_sessions_vocab) 27 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup.kofa.utils.helpers import attrs_to_fields 28 28 29 29 class ConfigurationContainer(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/configure.zcml
r7667 r7811 3 3 xmlns:i18n="http://namespaces.zope.org/i18n"> 4 4 <include package="grok" /> 5 <include package="waeup. sirp" file="meta.zcml" />5 <include package="waeup.kofa" file="meta.zcml" /> 6 6 <includeDependencies package="." /> 7 7 <grok:grok package="." /> 8 8 <i18n:registerTranslations directory="locales" /> 9 9 10 <includeOverrides package="waeup. sirp.utils" file="overrides.zcml" />10 <includeOverrides package="waeup.kofa.utils" file="overrides.zcml" /> 11 11 </configure> -
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.py
r7585 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ SIRPdata center.18 """KOFA data center. 19 19 20 20 The waeup data center cares for management of upload data and provides … … 28 28 from zope.component import getUtility 29 29 from zope.component.interfaces import ObjectEvent 30 from waeup. sirp.interfaces import (IDataCenter, IDataCenterFile,30 from waeup.kofa.interfaces import (IDataCenter, IDataCenterFile, 31 31 IDataCenterStorageMovedEvent, 32 32 IDataCenterConfig) 33 from waeup. sirp.utils.helpers import copy_filesystem_tree34 from waeup. sirp.utils.logger import Logger33 from waeup.kofa.utils.helpers import copy_filesystem_tree 34 from waeup.kofa.utils.logger import Logger 35 35 36 36 class DataCenter(grok.Container, Logger): … … 39 39 grok.implements(IDataCenter) 40 40 41 logger_name = 'waeup. sirp.${sitename}.datacenter'41 logger_name = 'waeup.kofa.${sitename}.datacenter' 42 42 logger_filename = 'datacenter.log' 43 43 -
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.txt
r7584 r7811 1 SIRPData Center1 KOFA Data Center 2 2 **************** 3 3 4 The SIRPdata center cares for managing CSV files and importing then.4 The KOFA data center cares for managing CSV files and importing then. 5 5 6 6 .. :doctest: 7 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer7 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 8 8 9 9 Creating a data center … … 12 12 A data center can be created easily: 13 13 14 >>> from waeup. sirp.datacenter import DataCenter14 >>> from waeup.kofa.datacenter import DataCenter 15 15 >>> mydatacenter = DataCenter() 16 16 >>> mydatacenter 17 <waeup. sirp.datacenter.DataCenter object at 0x...>17 <waeup.kofa.datacenter.DataCenter object at 0x...> 18 18 19 19 Each data center has a location in file system where files are stored: … … 78 78 79 79 >>> mydatacenter.getFiles() 80 [<waeup. sirp.datacenter.DataCenterFile object at 0x...>]80 [<waeup.kofa.datacenter.DataCenterFile object at 0x...>] 81 81 82 82 As we can see, the actual file is wrapped by a convenience wrapper, -
main/waeup.kofa/trunk/src/waeup/kofa/ftesting.zcml
r7582 r7811 1 1 <configure 2 2 xmlns="http://namespaces.zope.org/zope" 3 xmlns: sirp="http://namespaces.waeup.org/sirp"4 i18n_domain="waeup. sirp"5 package="waeup. sirp"3 xmlns:kofa="http://namespaces.waeup.org/kofa" 4 i18n_domain="waeup.kofa" 5 package="waeup.kofa" 6 6 > 7 7 8 8 <include package="grok" /> 9 <includeOverrides package="waeup. sirp" />10 <include package="waeup. sirp" file="mail.zcml" />9 <includeOverrides package="waeup.kofa" /> 10 <include package="waeup.kofa" file="mail.zcml" /> 11 11 12 12 <!-- Where should the datacenter reside by default? --> 13 < sirp:datacenter13 <kofa:datacenter 14 14 path="../../../parts/test/datacenter" /> 15 15 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/__init__.py
r6963 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.hostels.container import HostelsContainer5 from waeup. sirp.hostels.hostel import Hostel, Bed4 from waeup.kofa.hostels.container import HostelsContainer 5 from waeup.kofa.hostels.hostel import Hostel, Bed 6 6 7 7 __all__ = [ -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r7718 r7811 22 22 from zope.i18n import translate 23 23 from zope.component import getUtility 24 from waeup. sirp.browser import (25 SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,24 from waeup.kofa.browser import ( 25 KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage, 26 26 NullValidator) 27 from waeup. sirp.browser.breadcrumbs import Breadcrumb28 from waeup. sirp.browser.resources import datepicker, datatable, tabs, warning29 from waeup. sirp.browser.layout import default_primary_nav_template30 from waeup. sirp.browser.pages import delSubobjects31 from waeup. sirp.browser.viewlets import (27 from waeup.kofa.browser.breadcrumbs import Breadcrumb 28 from waeup.kofa.browser.resources import datepicker, datatable, tabs, warning 29 from waeup.kofa.browser.layout import default_primary_nav_template 30 from waeup.kofa.browser.pages import delSubobjects 31 from waeup.kofa.browser.viewlets import ( 32 32 ManageActionButton, PrimaryNavTab) 33 from waeup. sirp.browser.layout import jsaction, action34 from waeup. sirp.interfaces import ISIRPObject, ISIRPUtils35 from waeup. sirp.interfaces import MessageFactory as _36 from waeup. sirp.hostels.vocabularies import NOT_OCCUPIED37 from waeup. sirp.hostels.hostel import Hostel38 from waeup. sirp.hostels.interfaces import (33 from waeup.kofa.browser.layout import jsaction, action 34 from waeup.kofa.interfaces import IKOFAObject, IKOFAUtils 35 from waeup.kofa.interfaces import MessageFactory as _ 36 from waeup.kofa.hostels.vocabularies import NOT_OCCUPIED 37 from waeup.kofa.hostels.hostel import Hostel 38 from waeup.kofa.hostels.interfaces import ( 39 39 IHostelsContainer, IHostel, IBed, IBedAllocateStudent) 40 40 41 41 def write_log_message(view, message): 42 ob_class = view.__implemented__.__name__.replace('waeup. sirp.','')42 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 43 43 view.context.loggerInfo(ob_class, message) 44 44 return … … 61 61 """ 62 62 63 grok.context(I SIRPObject)63 grok.context(IKOFAObject) 64 64 grok.order(5) 65 65 grok.require('waeup.viewHostels') … … 96 96 mapping = {'a':co[1], 'b':co[2], 'c':co[3]}) 97 97 98 class HostelsContainerPage( SIRPDisplayFormPage):98 class HostelsContainerPage(KOFADisplayFormPage): 99 99 """The standard view for hostels containers. 100 100 """ … … 113 113 text = _('Manage accommodation section') 114 114 115 class HostelsContainerManagePage( SIRPDisplayFormPage):115 class HostelsContainerManagePage(KOFADisplayFormPage): 116 116 """The manage page for hostel containers. 117 117 """ … … 148 148 return 149 149 150 class HostelAddFormPage( SIRPAddFormPage):150 class HostelAddFormPage(KOFAAddFormPage): 151 151 """Add-form to add a hostel. 152 152 """ … … 175 175 return 176 176 177 class HostelDisplayFormPage( SIRPDisplayFormPage):177 class HostelDisplayFormPage(KOFADisplayFormPage): 178 178 """ Page to display hostel data 179 179 """ … … 196 196 target = 'manage' 197 197 198 class HostelManageFormPage( SIRPEditFormPage):198 class HostelManageFormPage(KOFAEditFormPage): 199 199 """ View to edit hostel data 200 200 """ … … 261 261 switched = [] # for log file 262 262 switched_translated = [] # for flash message 263 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE263 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 264 264 preferred_language = self.request.cookies.get( 265 ' sirp.language', portal_language)265 'kofa.language', portal_language) 266 266 for bed_id in child_id: 267 267 message = self.context[bed_id].switchReservation() 268 268 switched.append('%s (%s)' % (bed_id,message)) 269 m_translated = translate(message, 'waeup. sirp',269 m_translated = translate(message, 'waeup.kofa', 270 270 target_language=preferred_language) 271 271 switched_translated.append('%s (%s)' % (bed_id,m_translated)) … … 306 306 return 307 307 308 class BedManageFormPage( SIRPEditFormPage):308 class BedManageFormPage(KOFAEditFormPage): 309 309 """ View to edit bed data 310 310 """ -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/containermanagepage.pt
r7718 r7811 1 1 <form action="." tal:attributes="action request/URL" 2 i18n:domain="waeup. sirp"2 i18n:domain="waeup.kofa" 3 3 method="POST" enctype="multipart/form-data"> 4 4 <table> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/containerpage.pt
r7718 r7811 1 <div i18n:domain="waeup. sirp"1 <div i18n:domain="waeup.kofa" 2 2 i18n:translate="" tal:condition="python: not len(context.keys())"> 3 3 There no subobjects registered yet. 4 4 </div> 5 5 6 <table i18n:domain="waeup. sirp">6 <table i18n:domain="waeup.kofa"> 7 7 <thead> 8 8 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser_templates/hostelmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/catalog.py
r7257 r7811 20 20 import grok 21 21 from grok import index 22 from waeup. sirp.interfaces import IUniversity23 from waeup. sirp.hostels.interfaces import IBed22 from waeup.kofa.interfaces import IUniversity 23 from waeup.kofa.hostels.interfaces import IBed 24 24 25 25 class BedIndexes(grok.Indexes): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/container.py
r7652 r7811 20 20 """ 21 21 import grok 22 from waeup. sirp.hostels.interfaces import IHostelsContainer, IHostel23 from waeup. sirp.utils.logger import Logger22 from waeup.kofa.hostels.interfaces import IHostelsContainer, IHostel 23 from waeup.kofa.utils.logger import Logger 24 24 25 25 class HostelsContainer(grok.Container, Logger): … … 48 48 return 49 49 50 logger_name = 'waeup. sirp.${sitename}.hostels'50 logger_name = 'waeup.kofa.${sitename}.hostels' 51 51 logger_filename = 'hostels.log' 52 52 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/hostel.py
r7718 r7811 22 22 from zope.event import notify 23 23 from datetime import datetime 24 from waeup. sirp.utils.helpers import attrs_to_fields25 from waeup. sirp.hostels.vocabularies import NOT_OCCUPIED26 from waeup. sirp.hostels.interfaces import IHostel, IBed, IBedAllocateStudent27 from waeup. sirp.students.interfaces import IBedTicket28 from waeup. sirp.interfaces import MessageFactory as _24 from waeup.kofa.utils.helpers import attrs_to_fields 25 from waeup.kofa.hostels.vocabularies import NOT_OCCUPIED 26 from waeup.kofa.hostels.interfaces import IHostel, IBed, IBedAllocateStudent 27 from waeup.kofa.students.interfaces import IBedTicket 28 from waeup.kofa.interfaces import MessageFactory as _ 29 29 30 30 class Hostel(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r7718 r7811 18 18 from zope.interface import invariant, Invalid 19 19 from zope import schema 20 from waeup. sirp.interfaces import ISIRPObject21 from waeup. sirp.interfaces import MessageFactory as _22 from waeup. sirp.hostels.vocabularies import (20 from waeup.kofa.interfaces import IKOFAObject 21 from waeup.kofa.interfaces import MessageFactory as _ 22 from waeup.kofa.hostels.vocabularies import ( 23 23 bed_letters, blocks, special_handling, StudentSource) 24 24 25 class IHostelsContainer(I SIRPObject):25 class IHostelsContainer(IKOFAObject): 26 26 """A container for all kind of hostel objects. 27 27 28 28 """ 29 29 30 class IHostel(I SIRPObject):30 class IHostel(IKOFAObject): 31 31 """A base representation of hostels. 32 32 … … 146 146 raise Invalid(_('Bed categories overlap.')) 147 147 148 class IBed(I SIRPObject):148 class IBed(IKOFAObject): 149 149 """A base representation of beds. 150 150 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/tests.py
r7802 r7811 30 30 from zope.catalog.interfaces import ICatalog 31 31 from zope.component import queryUtility 32 from waeup. sirp.app import University33 from waeup. sirp.hostels.interfaces import (32 from waeup.kofa.app import University 33 from waeup.kofa.hostels.interfaces import ( 34 34 IHostelsContainer, IHostel, IBed) 35 from waeup. sirp.hostels.container import HostelsContainer36 from waeup. sirp.hostels.hostel import Hostel, Bed37 from waeup. sirp.testing import (FunctionalLayer, FunctionalTestCase)38 from waeup. sirp.students.student import Student39 from waeup. sirp.students.accommodation import BedTicket40 from waeup. sirp.university.department import Department35 from waeup.kofa.hostels.container import HostelsContainer 36 from waeup.kofa.hostels.hostel import Hostel, Bed 37 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase) 38 from waeup.kofa.students.student import Student 39 from waeup.kofa.students.accommodation import BedTicket 40 from waeup.kofa.university.department import Department 41 41 42 42 class HostelsContainerTestCase(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/vocabularies.py
r7718 r7811 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zc.sourcefactory.contextual import BasicContextualSourceFactory 24 from waeup. sirp.interfaces import SimpleSIRPVocabulary25 from waeup. sirp.interfaces import MessageFactory as _24 from waeup.kofa.interfaces import SimpleKOFAVocabulary 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 27 27 NOT_OCCUPIED = u'not occupied' … … 54 54 return "%s - %s" % (value, self.acco_students(context)[value]) 55 55 56 bed_letters = Simple SIRPVocabulary(56 bed_letters = SimpleKOFAVocabulary( 57 57 (_('Bed A'),'A'), 58 58 (_('Bed B'),'B'), … … 66 66 ) 67 67 68 blocks = Simple SIRPVocabulary(68 blocks = SimpleKOFAVocabulary( 69 69 (_('Block A'),'A'), 70 70 (_('Block B'),'B'), … … 84 84 ) 85 85 86 special_handling = Simple SIRPVocabulary(86 special_handling = SimpleKOFAVocabulary( 87 87 (_('Regular Hostel'),'regular'), 88 88 (_('Blocked Hostel'),'blocked'), -
main/waeup.kofa/trunk/src/waeup/kofa/image/README.txt
r7495 r7811 1 waeup. sirp.image -- handling image files1 waeup.kofa.image -- handling image files 2 2 ======================================== 3 3 4 The image file widget is built on top of the :class:` SIRPImageFile` object::5 6 >>> from waeup. sirp.image import SIRPImageFile7 >>> file = SIRPImageFile('foo.jpg', 'mydata')4 The image file widget is built on top of the :class:`KOFAImageFile` object:: 5 6 >>> from waeup.kofa.image import KOFAImageFile 7 >>> file = KOFAImageFile('foo.jpg', 'mydata') 8 8 >>> file.filename 9 9 'foo.jpg' … … 16 16 'mydata' 17 17 18 We can also create SIRPImageFile objects from file-like objects::18 We can also create KOFAImageFile objects from file-like objects:: 19 19 20 20 >>> from StringIO import StringIO … … 36 36 ---------------- 37 37 38 The SIRPImageFile object normally stores the file data using ZODB38 The KOFAImageFile object normally stores the file data using ZODB 39 39 persistence. Files can however also be stored by tramline. If 40 40 tramline is installed in Apache, the Tramline takes care of generating … … 73 73 just '1') will now be created:: 74 74 75 >>> file = SIRPImageFile('foo.jpg', '1')75 >>> file = KOFAImageFile('foo.jpg', '1') 76 76 77 77 The data is now '1', referring to the real file:: … … 102 102 We expect the same behavior as when tramline is not installed:: 103 103 104 >>> file = SIRPImageFile('foo.jpg', 'data')104 >>> file = KOFAImageFile('foo.jpg', 'data') 105 105 >>> f = file.file 106 106 >>> f.read() … … 114 114 >>> shutil.rmtree(dirpath) 115 115 116 Support for :mod:`waeup. sirp.imagestorage`116 Support for :mod:`waeup.kofa.imagestorage` 117 117 ------------------------------------------ 118 118 119 119 The behaviour shown above can be used for any Zope3 application. With 120 :mod:`waeup. sirp` we use a special file retrieval utility defined in121 :mod:`waeup. sirp.imagestorage`. As this utility is based on122 :mod:`waeup. sirp` internal stuff we do not show it here but in the120 :mod:`waeup.kofa` we use a special file retrieval utility defined in 121 :mod:`waeup.kofa.imagestorage`. As this utility is based on 122 :mod:`waeup.kofa` internal stuff we do not show it here but in the 123 123 tests that come with that storage type. 124 124 … … 135 135 The `ImageFile` field accepts only certain content types: 136 136 137 >>> from waeup. sirp.image.schema import ImageFile137 >>> from waeup.kofa.image.schema import ImageFile 138 138 >>> from zope.publisher.browser import TestRequest 139 139 >>> field = ImageFile(__name__='foo', title=u'Foo') … … 141 141 Traceback (most recent call last): 142 142 ... 143 WrongType: ('asd', <class 'waeup. sirp.image.image.SIRPImageFile'>, 'foo')143 WrongType: ('asd', <class 'waeup.kofa.image.image.KOFAImageFile'>, 'foo') 144 144 145 145 which means: `ImageFile` fields should better contain 146 :class:` SIRPImageFile` instances.147 148 We can store normal :class:` SIRPImageFile` instances:149 150 >>> field.validate( SIRPImageFile('bar.jpg', 'data')) is None146 :class:`KOFAImageFile` instances. 147 148 We can store normal :class:`KOFAImageFile` instances: 149 150 >>> field.validate(KOFAImageFile('bar.jpg', 'data')) is None 151 151 True 152 152 … … 173 173 174 174 >>> field.validate( 175 ... SIRPImageFile('bar.jpg', '123456789012')) is None176 True 177 178 >>> field.validate( 179 ... SIRPImageFile('bar.jpg', '12345')) is None175 ... KOFAImageFile('bar.jpg', '123456789012')) is None 176 True 177 178 >>> field.validate( 179 ... KOFAImageFile('bar.jpg', '12345')) is None 180 180 True 181 181 … … 183 183 184 184 >>> field.validate( 185 ... SIRPImageFile('bar.jpg', '1234567890123'))185 ... KOFAImageFile('bar.jpg', '1234567890123')) 186 186 Traceback (most recent call last): 187 187 ... … … 189 189 190 190 >>> field.validate( 191 ... SIRPImageFile('bar.jpg', '1234'))191 ... KOFAImageFile('bar.jpg', '1234')) 192 192 Traceback (most recent call last): 193 193 ... … … 198 198 ---------------------------- 199 199 200 SIRPImageFile does not reproduce the broken unequal comparison from200 KOFAImageFile does not reproduce the broken unequal comparison from 201 201 its base: 202 202 203 >>> f1 = SIRPImageFile('bar.jpg', '123456789')204 >>> f2 = SIRPImageFile('bar.jpg', '123456789')205 >>> f3 = SIRPImageFile('baz.jpg', '1234')203 >>> f1 = KOFAImageFile('bar.jpg', '123456789') 204 >>> f2 = KOFAImageFile('bar.jpg', '123456789') 205 >>> f3 = KOFAImageFile('baz.jpg', '1234') 206 206 >>> f1 == f2 207 207 True -
main/waeup.kofa/trunk/src/waeup/kofa/image/__init__.py
r7321 r7811 3 3 Includings schemas, widgets and the content components. 4 4 """ 5 from waeup. sirp.image.image import SIRPImageFile, createSIRPImageFile5 from waeup.kofa.image.image import KOFAImageFile, createKOFAImageFile 6 6 7 7 __all__ = [ 8 " SIRPImageFile",9 "create SIRPImageFile",8 "KOFAImageFile", 9 "createKOFAImageFile", 10 10 ] -
main/waeup.kofa/trunk/src/waeup/kofa/image/browser/__init__.py
r7137 r7811 1 1 # The public API part 2 2 # Contains the widgets defined for image files. 3 from waeup. sirp.image.browser.widget import (3 from waeup.kofa.image.browser.widget import ( 4 4 EncodingImageFileWidget, ThumbnailWidget, 5 5 ) -
main/waeup.kofa/trunk/src/waeup/kofa/image/browser/tests/image.txt
r7321 r7811 12 12 13 13 >>> import os 14 >>> from waeup. sirp.image import SIRPImageFile14 >>> from waeup.kofa.image import KOFAImageFile 15 15 >>> testimage = os.path.join(os.path.dirname(__file__), 'sample.jpg') 16 16 >>> testimage2 = os.path.join(os.path.dirname(__file__), 'sample2.jpg') 17 >>> some_file = SIRPImageFile('foo.jpg', open(testimage, 'rb').read())17 >>> some_file = KOFAImageFile('foo.jpg', open(testimage, 'rb').read()) 18 18 >>> some_file.filename 19 19 'foo.jpg' … … 26 26 >>> from hurry.file.browser import DownloadWidget 27 27 >>> from hurry.file.schema import File 28 >>> from waeup. sirp.image.schema import ImageFile28 >>> from waeup.kofa.image.schema import ImageFile 29 29 >>> from zope.publisher.browser import TestRequest 30 30 >>> field = ImageFile(__name__='foo', title=u'Foo') … … 51 51 Instead of downloading, we can also use a thumbnail widget: 52 52 53 >>> from waeup. sirp.image.browser import ThumbnailWidget53 >>> from waeup.kofa.image.browser import ThumbnailWidget 54 54 >>> request = TestRequest(form={'field.foo': FileUpload(some_file)}) 55 55 >>> widget = ThumbnailWidget(field, request) … … 61 61 data already available, and no data in request: 62 62 63 >>> from waeup. sirp.image.browser import EncodingImageFileWidget63 >>> from waeup.kofa.image.browser import EncodingImageFileWidget 64 64 >>> field = ImageFile(__name__='foo', title=u'Foo', required=False) 65 65 >>> field = field.bind(None) … … 166 166 prepare some new file: 167 167 168 >>> another_file = SIRPImageFile('bar.txt', 'bar contents')168 >>> another_file = KOFAImageFile('bar.txt', 'bar contents') 169 169 170 170 We happen to know, due to the implementation of … … 200 200 --------------------------- 201 201 202 As :class:`waeup. sirp.image.SIRPImageFile` objects support storing202 As :class:`waeup.kofa.image.KOFAImageFile` objects support storing 203 203 image data by using external 'storages', also our widgets should do 204 204 so. … … 220 220 ... contents = f.read() 221 221 ... id_string = hashlib.md5(contents).hexdigest() 222 ... result = SIRPImageFile(filename, id_string)222 ... result = KOFAImageFile(filename, id_string) 223 223 ... self.storage[id_string] = contents 224 224 ... return result … … 260 260 We now want to simulate, that the field contains already data, 261 261 identified by some `file_id`. To do so, we first store the data in our 262 file retrieval and then create a SIRPImageFile object with that262 file retrieval and then create a KOFAImageFile object with that 263 263 file_id stored: 264 264 265 >>> from waeup. sirp.image import createSIRPImageFile266 >>> image = create SIRPImageFile(265 >>> from waeup.kofa.image import createKOFAImageFile 266 >>> image = createKOFAImageFile( 267 267 ... 'sample.jpg', open(testimage, 'rb')) 268 268 >>> file_id = image.data … … 274 274 '9feac4265077922000aa8b88748e25be' 275 275 276 The new file was stored by our utility, as create SIRPImageFile looks276 The new file was stored by our utility, as createKOFAImageFile looks 277 277 up IFileRetrieval utilities and uses them: 278 278 -
main/waeup.kofa/trunk/src/waeup/kofa/image/browser/tests/test_views.py
r7137 r7811 30 30 from hurry.file.file import IdFileRetrieval 31 31 from hurry.file.interfaces import IFileRetrieval 32 from waeup. sirp.image.browser.views import HurryFileView32 from waeup.kofa.image.browser.views import HurryFileView 33 33 from zope.component import getMultiAdapter, provideUtility 34 34 from zope.publisher.browser import TestRequest … … 41 41 class ImageBrowserViewsLayer(object): 42 42 """A layer that registers all components in 43 `waeup. sirp.image.browser.views` module.43 `waeup.kofa.image.browser.views` module. 44 44 """ 45 45 @classmethod 46 46 def setUp(cls): 47 grok.testing.grok('waeup. sirp.image.browser.views')47 grok.testing.grok('waeup.kofa.image.browser.views') 48 48 49 49 @classmethod -
main/waeup.kofa/trunk/src/waeup/kofa/image/browser/widget.py
r7321 r7811 19 19 """ 20 20 import os 21 from waeup. sirp.image import SIRPImageFile21 from waeup.kofa.image import KOFAImageFile 22 22 from hurry.file.browser.widget import ( 23 23 EncodingFileWidget, DownloadWidget, FakeFieldStorage) … … 62 62 seek(0) 63 63 return retrieval.createFile(input.filename, input) 64 return SIRPImageFile(input.filename, data)64 return KOFAImageFile(input.filename, data) 65 65 else: 66 66 return self.context.missing_value … … 143 143 data = file_id.decode('base64') 144 144 filename, filedata = data.split('\n', 1) 145 return SIRPImageFile(filename, filedata)145 return KOFAImageFile(filename, filedata) 146 146 147 147 class ThumbnailWidget(DownloadWidget): -
main/waeup.kofa/trunk/src/waeup/kofa/image/image.py
r7321 r7811 23 23 from zope.component import getUtility 24 24 from zope.interface import implements 25 from waeup. sirp.image.interfaces import ISIRPImageFile25 from waeup.kofa.image.interfaces import IKOFAImageFile 26 26 27 class SIRPImageFile(HurryFile):27 class KOFAImageFile(HurryFile): 28 28 """A file prepared for storing image files. 29 29 … … 32 32 regular hurry files. 33 33 34 To create a :class:` SIRPImageFile` you should use35 :func:`create SIRPImageFile`.34 To create a :class:`KOFAImageFile` you should use 35 :func:`createKOFAImageFile`. 36 36 """ 37 implements(I SIRPImageFile)37 implements(IKOFAImageFile) 38 38 39 39 def __ne__(self, other): … … 45 45 return True 46 46 47 def create SIRPImageFile(filename, f):47 def createKOFAImageFile(filename, f): 48 48 retrieval = getUtility(IFileRetrieval) 49 49 return retrieval.createFile(filename, f) -
main/waeup.kofa/trunk/src/waeup/kofa/image/interfaces.py
r7321 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Interfaces for waeup. sirp.image18 """Interfaces for waeup.kofa.image 19 19 """ 20 20 from hurry.file.interfaces import IFile, IFileRetrieval, IHurryFile … … 23 23 """Image file field. 24 24 """ 25 26 class I SIRPImageFile(IHurryFile):25 26 class IKOFAImageFile(IHurryFile): 27 27 """Image file. 28 28 """ 29 29 30 30 class IImageFileRetrieval(IFileRetrieval): 31 31 """A file retrieval for images. -
main/waeup.kofa/trunk/src/waeup/kofa/image/schema.py
r7321 r7811 22 22 from zope.schema.interfaces import TooBig, TooSmall 23 23 from hurry.file.schema import File 24 from waeup. sirp.image.interfaces import IImageFile25 from waeup. sirp.image.image import SIRPImageFile24 from waeup.kofa.image.interfaces import IImageFile 25 from waeup.kofa.image.image import KOFAImageFile 26 26 27 27 class MinMaxSize(object): … … 82 82 implements(IImageFile) 83 83 84 _type = SIRPImageFile84 _type = KOFAImageFile -
main/waeup.kofa/trunk/src/waeup/kofa/imagestorage.py
r7193 r7811 18 18 """A storage for image (and other) files. 19 19 20 A few words about storing files with ``waeup. sirp``. The need for this20 A few words about storing files with ``waeup.kofa``. The need for this 21 21 feature arised initially from the need to store passport files for 22 22 applicants and students. These files are dynamic (can be changed … … 57 57 :class:`ExtFileStore`. An instance of this file storage (which is also 58 58 able to store non-image files) is available at runtime as a global 59 utility implementing :class:`waeup. sirp.interfaces.IExtFileStore`.59 utility implementing :class:`waeup.kofa.interfaces.IExtFileStore`. 60 60 61 61 The main task of this central component is to maintain a filesystem … … 68 68 >>> from StringIO import StringIO 69 69 >>> from zope.component import getUtility 70 >>> from waeup. sirp.interfaces import IExtFileStore70 >>> from waeup.kofa.interfaces import IExtFileStore 71 71 >>> store = getUtility(IExtFileStore) 72 72 >>> store.createFile('myfile.txt', StringIO('some file content')) … … 120 120 121 121 Examples for such a file store handler can be found in the 122 :mod:`waeup. sirp.applicants.applicant` module. Please see also the122 :mod:`waeup.kofa.applicants.applicant` module. Please see also the 123 123 :class:`DefaultFileStoreHandler` class below for more details. 124 124 125 125 The file store looks up handlers by utility lookups: it looks for a 126 126 named utiliy providing 127 :class:`waeup. sirp.interfaces.IFileStoreHandler` and named like the127 :class:`waeup.kofa.interfaces.IFileStoreHandler` and named like the 128 128 marker string (without leading/trailing underscores) in lower 129 129 case. For example if the file id would be … … 135 135 ``img_user`` 136 136 137 and provide :class:`waeup. sirp.interfaces.IFileStoreHandler`. If no137 and provide :class:`waeup.kofa.interfaces.IFileStoreHandler`. If no 138 138 such utility can be found, a default handler is used instead 139 139 (see :class:`DefaultFileStoreHandler`). … … 141 141 **About File IDs and Filenames** 142 142 143 In the waeup. sirppackage we want to store documents like CVs,143 In the waeup.kofa package we want to store documents like CVs, 144 144 photographs, and similar. Each of this documents might come into the 145 145 system with different filename extensions. This could be a problem as … … 193 193 something like: 194 194 195 >>> from waeup. sirp.interfaces import IFileStoreNameChooser195 >>> from waeup.kofa.interfaces import IFileStoreNameChooser 196 196 >>> file_id = IFileStoreNameChooser(my_context_obj) 197 197 … … 218 218 from zope.component import queryUtility 219 219 from zope.interface import Interface 220 from waeup. sirp.interfaces import (220 from waeup.kofa.interfaces import ( 221 221 IFileStoreNameChooser, IExtFileStore, IFileStoreHandler,) 222 222 … … 229 229 special type of context. 230 230 231 Provides the :class:`waeup. sirp.interfaces.IFileStoreNameChooser`231 Provides the :class:`waeup.kofa.interfaces.IFileStoreNameChooser` 232 232 interface. 233 233 … … 285 285 want to change this path -- it is dynamic. That means, if you call 286 286 the file store from 'within' a site, the root path will be located 287 inside this site (a :class:`waeup. sirp.University` instance). If287 inside this site (a :class:`waeup.kofa.University` instance). If 288 288 you call it from 'outside' a site some temporary dir (always the 289 289 same during lifetime of the file store instance) will be used. The … … 299 299 300 300 An ExtFileStore instance is available as a global utility 301 implementing :class:`waeup. sirp.interfaces.IExtFileStore`.301 implementing :class:`waeup.kofa.interfaces.IExtFileStore`. 302 302 303 303 To add and retrieve files from the storage, use the appropriate … … 505 505 506 506 Registered globally as utility for 507 :class:`waeup. sirp.interfaces.IFileStoreHandler`.507 :class:`waeup.kofa.interfaces.IFileStoreHandler`. 508 508 """ 509 509 grok.implements(IFileStoreHandler) -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7799 r7811 34 34 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm 35 35 36 _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup. sirp')36 _ = MessageFactory = zope.i18nmessageid.MessageFactory('waeup.kofa') 37 37 38 38 CREATED = 'created' … … 50 50 encoding='utf-8', mode='rb').read() 51 51 52 def Simple SIRPVocabulary(*terms):52 def SimpleKOFAVocabulary(*terms): 53 53 """A well-buildt vocabulary provides terms with a value, token and 54 54 title for each term … … 66 66 return [('%s/%s' % (year,year+1), year) for year in year_range] 67 67 68 academic_sessions_vocab = Simple SIRPVocabulary(*academic_sessions())69 70 registration_states_vocab = Simple SIRPVocabulary(68 academic_sessions_vocab = SimpleKOFAVocabulary(*academic_sessions()) 69 70 registration_states_vocab = SimpleKOFAVocabulary( 71 71 (_('created'), CREATED), 72 72 (_('admitted'), ADMITTED), … … 139 139 def getValues(self): 140 140 # late import: in interfaces we should not import local modules 141 from waeup. sirp.permissions import get_waeup_role_names141 from waeup.kofa.permissions import get_waeup_role_names 142 142 return get_waeup_role_names() 143 143 144 144 def getTitle(self, value): 145 145 # late import: in interfaces we should not import local modules 146 from waeup. sirp.permissions import get_all_roles146 from waeup.kofa.permissions import get_all_roles 147 147 roles = dict(get_all_roles()) 148 148 if value in roles.keys(): … … 160 160 # we have to 'try' because IConfiguration can only handle 161 161 # interfaces from w.s.interface. 162 from waeup. sirp.browser.interfaces import ICaptchaManager162 from waeup.kofa.browser.interfaces import ICaptchaManager 163 163 except: 164 164 return captchas … … 187 187 """ 188 188 189 class I SIRPUtils(Interface):189 class IKOFAUtils(Interface): 190 190 """A collection of methods which are subject to customization. 191 191 """ … … 222 222 """ 223 223 224 class I SIRPObject(Interface):225 """A SIRPobject.224 class IKOFAObject(Interface): 225 """A KOFA object. 226 226 227 227 This is merely a marker interface. 228 228 """ 229 229 230 class IUniversity(I SIRPObject):230 class IUniversity(IKOFAObject): 231 231 """Representation of a university. 232 232 """ 233 233 234 234 235 class I SIRPContainer(ISIRPObject):236 """A container for SIRPobjects.237 """ 238 239 class I SIRPContained(ISIRPObject):240 """An item contained in an I SIRPContainer.235 class IKOFAContainer(IKOFAObject): 236 """A container for KOFA objects. 237 """ 238 239 class IKOFAContained(IKOFAObject): 240 """An item contained in an IKOFAContainer. 241 241 """ 242 242 … … 267 267 """ 268 268 269 class I SIRPExporter(Interface):269 class IKOFAExporter(Interface): 270 270 """An exporter for objects. 271 271 """ … … 279 279 """ 280 280 281 class I SIRPXMLExporter(Interface):281 class IKOFAXMLExporter(Interface): 282 282 """An XML exporter for objects. 283 283 """ … … 291 291 """ 292 292 293 class I SIRPXMLImporter(Interface):293 class IKOFAXMLImporter(Interface): 294 294 """An XML import for objects. 295 295 """ … … 328 328 """ 329 329 330 class IContactForm(I SIRPObject):330 class IContactForm(IKOFAObject): 331 331 """A contact form. 332 332 """ … … 358 358 required = True,) 359 359 360 class I SIRPPrincipalInfo(IPrincipalInfo):361 """Infos about principals that are users of SIRP SIRP.360 class IKOFAPrincipalInfo(IPrincipalInfo): 361 """Infos about principals that are users of KOFA KOFA. 362 362 """ 363 363 email = Attribute("The email address of a user") … … 365 365 366 366 367 class I SIRPPrincipal(IPrincipal):368 """A principle for SIRP SIRP.367 class IKOFAPrincipal(IPrincipal): 368 """A principle for KOFA KOFA. 369 369 370 370 This interface extends zope.security.interfaces.IPrincipal and … … 382 382 required=False,) 383 383 384 class IUserAccount(I SIRPObject):384 class IUserAccount(IKOFAObject): 385 385 """A user account. 386 386 """ … … 425 425 426 426 427 class IUsersContainer(I SIRPObject):427 class IUsersContainer(IKOFAObject): 428 428 """A container for users (principals). 429 429 … … 450 450 """ 451 451 452 class IConfigurationContainer(I SIRPObject):452 class IConfigurationContainer(IKOFAObject): 453 453 """A container for session configuration objects. 454 454 """ … … 462 462 acronym = schema.TextLine( 463 463 title = u'Abbreviated Title of University', 464 default = u'WAeUP. SIRP',464 default = u'WAeUP.KOFA', 465 465 required = True, 466 466 ) … … 469 469 title = u'Skin', 470 470 default = u'gray waeup theme', 471 vocabulary = 'waeup. sirp.browser.theming.ThemesVocabulary',471 vocabulary = 'waeup.kofa.browser.theming.ThemesVocabulary', 472 472 required = True, 473 473 ) … … 516 516 email_subject = schema.TextLine( 517 517 title = u'Subject of Email to Administrator', 518 default = u' SIRPContact',518 default = u'KOFA Contact', 519 519 required = False, 520 520 ) … … 539 539 ) 540 540 541 class ISessionConfiguration(I SIRPObject):541 class ISessionConfiguration(IKOFAObject): 542 542 """A session configuration object. 543 543 """ … … 606 606 'academic_session'].order 607 607 608 class IDataCenter(I SIRPObject):608 class IDataCenter(IKOFAObject): 609 609 """A data center. 610 610 … … 669 669 title = u'Longer description of the item found.') 670 670 671 class I SIRPPluggable(Interface):672 """A component that might be plugged into a SIRP SIRPapp.671 class IKOFAPluggable(Interface): 672 """A component that might be plugged into a KOFA KOFA app. 673 673 674 674 Components implementing this interface are referred to as 675 675 'plugins'. They are normally called when a new 676 :class:`waeup. sirp.app.University` instance is created.676 :class:`waeup.kofa.app.University` instance is created. 677 677 678 678 Plugins can setup and update parts of the central site without the 679 site object (normally a :class:`waeup. sirp.app.University` object)679 site object (normally a :class:`waeup.kofa.app.University` object) 680 680 needing to know about that parts. The site simply collects all 681 681 available plugins, calls them and the plugins care for their … … 730 730 Utilities providing this interface are looked up when a Pluggable 731 731 Authentication Utility (PAU) for any 732 :class:`waeup. sirp.app.University` instance is created and put732 :class:`waeup.kofa.app.University` instance is created and put 733 733 into ZODB. 734 734 … … 807 807 """ 808 808 809 class I SIRPWorkflowInfo(IWorkflowInfo):809 class IKOFAWorkflowInfo(IWorkflowInfo): 810 810 """A :class:`hurry.workflow.workflow.WorkflowInfo` with additional 811 811 methods for convenience. … … 820 820 class ISiteLoggers(Interface): 821 821 822 loggers = Attribute("A list or generator of registered SIRPLoggers")822 loggers = Attribute("A list or generator of registered KOFALoggers") 823 823 824 824 def register(name, filename=None, site=None, **options): … … 841 841 842 842 def __init__(name, filename=None, site=None, **options): 843 """Create a SIRPlogger instance.843 """Create a KOFA logger instance. 844 844 """ 845 845 … … 973 973 974 974 Returns a tuple ``(raw_file, path, file_like_obj)`` where the 975 ``file_like_obj`` should be a HurryFile, a SIRPImageFile or975 ``file_like_obj`` should be a HurryFile, a KOFAImageFile or 976 976 similar. ``raw_file`` is the (maybe changed) input file and 977 977 ``path`` the relative internal path to store the file at. -
main/waeup.kofa/trunk/src/waeup/kofa/language.py
r7678 r7811 21 21 from zope.publisher.interfaces.browser import IBrowserRequest 22 22 from zope.i18n.interfaces import IUserPreferredLanguages 23 from waeup. sirp.configuration import ConfigurationContainer24 from waeup. sirp.interfaces import ISIRPUtils23 from waeup.kofa.configuration import ConfigurationContainer 24 from waeup.kofa.interfaces import IKOFAUtils 25 25 26 class SIRPLanguage(grokcore.component.Adapter):26 class KOFALanguage(grokcore.component.Adapter): 27 27 """Set preferred languages""" 28 28 grokcore.component.context(IBrowserRequest) … … 30 30 31 31 def getPreferredLanguages(self): 32 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE32 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 33 33 34 34 # This an adapter for the request, so self.context is the request. … … 36 36 37 37 # Extract the preferred language from a cookie: 38 lang = request.cookies.get(' sirp.language', portal_language)38 lang = request.cookies.get('kofa.language', portal_language) 39 39 40 40 # According to IUserPreferredLanguages, we must return a list. -
main/waeup.kofa/trunk/src/waeup/kofa/mail.zcml
r7470 r7811 29 29 background thread and sends mail independently from requests. 30 30 31 By default in SIRPwe have a fake mailer activated, that does not31 By default in KOFA we have a fake mailer activated, that does not 32 32 send real mail to the outside world. 33 33 --> -
main/waeup.kofa/trunk/src/waeup/kofa/meta.py
r7653 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Grokkers for SIRPcomponents.18 """Grokkers for KOFA components. 19 19 20 20 Stuff in here is mainly taken from grok.meta, with some modifications … … 40 40 from martian.error import GrokError 41 41 from zope import component 42 from waeup. sirp.interfaces import IObjectUpgradeEvent42 from waeup.kofa.interfaces import IObjectUpgradeEvent 43 43 44 44 class IndexesGrokker(martian.InstanceGrokker): … … 61 61 return False 62 62 63 subscriber = SIRPIndexesUpgradeSubscriber(63 subscriber = KOFAIndexesUpgradeSubscriber( 64 64 catalog_name, indexes, context, module_info) 65 65 subscribed = (site, IObjectUpgradeEvent) … … 72 72 73 73 74 class SIRPIndexesUpgradeSubscriber(IndexesSetupSubscriber):74 class KOFAIndexesUpgradeSubscriber(IndexesSetupSubscriber): 75 75 """Helper that sets up indexes when their Grok site is upgraded. 76 76 -
main/waeup.kofa/trunk/src/waeup/kofa/meta.zcml
r7576 r7811 11 11 12 12 <meta:directive 13 namespace="http://namespaces.waeup.org/ sirp"13 namespace="http://namespaces.waeup.org/kofa" 14 14 name="datacenter" 15 15 schema=".zcml.IDataCenterConfig" -
main/waeup.kofa/trunk/src/waeup/kofa/objecthistory.py
r7690 r7811 22 22 from zope.i18n import translate 23 23 from zope.annotation.interfaces import IAnnotations 24 from waeup. sirp.interfaces import IObjectHistory, ISIRPObject, ISIRPUtils25 from waeup. sirp.utils.helpers import get_current_principal24 from waeup.kofa.interfaces import IObjectHistory, IKOFAObject, IKOFAUtils 25 from waeup.kofa.utils.helpers import get_current_principal 26 26 27 from waeup. sirp.interfaces import MessageFactory as _27 from waeup.kofa.interfaces import MessageFactory as _ 28 28 29 29 class ObjectHistory(grok.Adapter): 30 30 """A history for objects. 31 31 32 For any object implementing `I SIRPObject` which is annotatable,32 For any object implementing `IKOFAObject` which is annotatable, 33 33 we provide histories. A history for such an object can be obtained 34 34 by adapting it to `IObjectHistory`. 35 35 """ 36 grok.context(I SIRPObject)36 grok.context(IKOFAObject) 37 37 grok.implements(IObjectHistory) 38 38 … … 68 68 else: 69 69 user = user.title 70 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE70 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 71 71 by = 'by' 72 72 if portal_language != 'en': 73 by = translate(_('by'),'waeup. sirp',target_language=portal_language)74 msg = translate(msg,'waeup. sirp',target_language=portal_language)73 by = translate(_('by'),'waeup.kofa',target_language=portal_language) 74 msg = translate(msg,'waeup.kofa',target_language=portal_language) 75 75 msg = u'%s - %s %s %s' % (timestamp, msg, by, user) 76 76 msgs.append(msg) -
main/waeup.kofa/trunk/src/waeup/kofa/payments/__init__.py
r6864 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.payments.container import PaymentsContainer5 from waeup. sirp.payments.payment import SCPayment, OnlinePayment4 from waeup.kofa.payments.container import PaymentsContainer 5 from waeup.kofa.payments.payment import SCPayment, OnlinePayment 6 6 7 7 __all__ = [ -
main/waeup.kofa/trunk/src/waeup/kofa/payments/container.py
r7195 r7811 21 21 import grok 22 22 from grok import index 23 from waeup. sirp.payments.interfaces import IPaymentsContainer24 from waeup. sirp.utils.helpers import attrs_to_fields23 from waeup.kofa.payments.interfaces import IPaymentsContainer 24 from waeup.kofa.utils.helpers import attrs_to_fields 25 25 26 26 class PaymentsContainer(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py
r7717 r7811 18 18 from zope.interface import Attribute 19 19 from zope import schema 20 from waeup. sirp.interfaces import ISIRPObject, SimpleSIRPVocabulary21 from waeup. sirp.interfaces import MessageFactory as _20 from waeup.kofa.interfaces import IKOFAObject, SimpleKOFAVocabulary 21 from waeup.kofa.interfaces import MessageFactory as _ 22 22 23 payment_states = Simple SIRPVocabulary(23 payment_states = SimpleKOFAVocabulary( 24 24 (_('Not yet paid'),'unpaid'), 25 25 (_('Paid'),'paid'), … … 27 27 ) 28 28 29 payment_categories = Simple SIRPVocabulary(29 payment_categories = SimpleKOFAVocabulary( 30 30 (_('School Fee'),'schoolfee'), 31 31 (_('Clearance'),'clearance'), … … 37 37 ) 38 38 39 class IPaymentsContainer(I SIRPObject):39 class IPaymentsContainer(IKOFAObject): 40 40 """A container for all kind of payment objects. 41 41 42 42 """ 43 43 44 class IPayment(I SIRPObject):44 class IPayment(IKOFAObject): 45 45 """A base representation of payments. 46 46 -
main/waeup.kofa/trunk/src/waeup/kofa/payments/payment.py
r7627 r7811 22 22 from datetime import datetime 23 23 from grok import index 24 from waeup. sirp.payments.interfaces import (24 from waeup.kofa.payments.interfaces import ( 25 25 IPayment, ISCPayment, IOnlinePayment, 26 26 payment_states, payment_categories) 27 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup.kofa.utils.helpers import attrs_to_fields 28 28 29 29 class Payment(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/payments/tests.py
r7195 r7811 20 20 """ 21 21 from zope.interface.verify import verifyClass, verifyObject 22 from waeup. sirp.payments.interfaces import (22 from waeup.kofa.payments.interfaces import ( 23 23 IPaymentsContainer, ISCPayment, IOnlinePayment) 24 from waeup. sirp.payments.container import PaymentsContainer25 from waeup. sirp.payments.payment import (24 from waeup.kofa.payments.container import PaymentsContainer 25 from waeup.kofa.payments.payment import ( 26 26 SCPayment, OnlinePayment) 27 from waeup. sirp.testing import (FunctionalLayer, FunctionalTestCase)27 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase) 28 28 29 29 class PaymentsContainerTestCase(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r7335 r7811 20 20 from zope.interface import Interface 21 21 from zope.securitypolicy.interfaces import IRole, IPrincipalRoleMap 22 from waeup. sirp.interfaces import ILocalRolesAssignable22 from waeup.kofa.interfaces import ILocalRolesAssignable 23 23 24 24 class Public(grok.Permission): … … 168 168 169 169 def get_waeup_roles(also_local=False): 170 """Get all SIRProles.171 172 SIRProles are ordinary roles whose id by convention starts with170 """Get all KOFA roles. 171 172 KOFA roles are ordinary roles whose id by convention starts with 173 173 a ``waeup.`` prefix. 174 174 175 175 If `also_local` is ``True`` (``False`` by default), also local 176 roles are returned. Local SIRProles are such whose id starts176 roles are returned. Local KOFA roles are such whose id starts 177 177 with ``waeup.local.`` prefix (this is also a convention). 178 178 … … 181 181 for name, item in get_all_roles(): 182 182 if not name.startswith('waeup.'): 183 # Ignore non- SIRProles...183 # Ignore non-KOFA roles... 184 184 continue 185 185 if not also_local and name.startswith('waeup.local.'): … … 189 189 190 190 def get_waeup_role_names(): 191 """Get the ids of all SIRProles.192 193 See :func:`get_waeup_roles` for what a ' SIRPRole' is.194 195 This function returns a sorted list of SIRProle names.191 """Get the ids of all KOFA roles. 192 193 See :func:`get_waeup_roles` for what a 'KOFARole' is. 194 195 This function returns a sorted list of KOFA role names. 196 196 """ 197 197 return sorted([x.id for x in get_waeup_roles()]) -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.txt
r7334 r7811 1 SIRPpermissions and roles1 KOFA permissions and roles 2 2 ************************** 3 3 4 Permissions and roles used in a SIRPportal.4 Permissions and roles used in a KOFA portal. 5 5 6 6 .. :doctest: 7 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer7 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 8 8 9 9 Convenience functions 10 10 ===================== 11 11 12 :mod:`waeup. sirp` offers some convenience functions to handle security12 :mod:`waeup.kofa` offers some convenience functions to handle security 13 13 roles. 14 14 … … 16 16 --------------------- 17 17 18 Gives us all roles defined in SIRP. We get tuples of18 Gives us all roles defined in KOFA. We get tuples of 19 19 kind 20 20 … … 24 24 with the ZCA (a string) and ``<ROLE>`` is the real role object. 25 25 26 >>> from waeup. sirp.permissions import get_all_roles26 >>> from waeup.kofa.permissions import get_all_roles 27 27 >>> get_all_roles() 28 28 <generator object...at 0x...> 29 29 30 30 >>> sorted(list(get_all_roles())) 31 [(u'waeup.ACManager', <waeup. sirp.permissions.ACManager object at 0x...]31 [(u'waeup.ACManager', <waeup.kofa.permissions.ACManager object at 0x...] 32 32 33 33 :func:`get_waeup_roles` 34 34 ----------------------- 35 35 36 Gives us all roles, except the SIRPspecific roles. We can get a list36 Gives us all roles, except the KOFA specific roles. We can get a list 37 37 with or without local roles: 38 38 39 >>> from waeup. sirp.permissions import get_waeup_roles39 >>> from waeup.kofa.permissions import get_waeup_roles 40 40 >>> len(list(get_waeup_roles())) 41 41 11 … … 48 48 ---------------------------- 49 49 50 We can get all role names defined in SIRP(except 'local'50 We can get all role names defined in KOFA (except 'local' 51 51 roles that are meant not to be assigned globally): 52 52 53 >>> from waeup. sirp.permissions import get_waeup_role_names53 >>> from waeup.kofa.permissions import get_waeup_role_names 54 54 >>> list(get_waeup_role_names()) 55 55 [u'waeup.ACManager', … … 72 72 they are not stored in the ZODB: 73 73 74 >>> from waeup. sirp.permissions import get_users_with_local_roles74 >>> from waeup.kofa.permissions import get_users_with_local_roles 75 75 >>> mycontext = object() 76 76 >>> people_and_roles = get_users_with_local_roles(mycontext) -
main/waeup.kofa/trunk/src/waeup/kofa/schema/__init__.py
r7137 r7811 1 from waeup. sirp.schema.field import *1 from waeup.kofa.schema.field import * 2 2 3 3 __all__ = tuple(name for name in globals() if not name.startswith('_')) -
main/waeup.kofa/trunk/src/waeup/kofa/schema/tests/test_textlinechoice.py
r7196 r7811 25 25 IVocabulary, ISource, IContextSourceBinder,) 26 26 from zope.schema.tests.test_strfield import TextLineTest 27 from waeup. sirp.schema import TextLineChoice27 from waeup.kofa.schema import TextLineChoice 28 28 29 29 # Define some helper functions, classes, vars for tests -
main/waeup.kofa/trunk/src/waeup/kofa/schoolgrades.py
r7795 r7811 23 23 from zope.schema.fieldproperty import FieldProperty 24 24 from zope.schema import Object 25 from waeup. sirp.interfaces import IResultEntry, IResultEntryField26 from waeup. sirp.widgets.objectwidget import (27 SIRPObjectWidget, SIRPObjectDisplayWidget25 from waeup.kofa.interfaces import IResultEntry, IResultEntryField 26 from waeup.kofa.widgets.objectwidget import ( 27 KOFAObjectWidget, KOFAObjectDisplayWidget 28 28 ) 29 29 … … 52 52 return 53 53 54 # register SIRPObjectWidgets as default widgets for IResultEntryFields54 # register KOFAObjectWidgets as default widgets for IResultEntryFields 55 55 @grok.adapter(IResultEntryField, IBrowserRequest) 56 56 @grok.implementer(IInputWidget) 57 57 def result_entry_input_widget(obj, req): 58 return SIRPObjectWidget(obj, req, ResultEntry)58 return KOFAObjectWidget(obj, req, ResultEntry) 59 59 60 60 # register a display widget for IResultEntryFields … … 62 62 @grok.implementer(IDisplayWidget) 63 63 def result_entry_display_widget(obj, req): 64 return SIRPObjectDisplayWidget(obj, req, ResultEntry)64 return KOFAObjectDisplayWidget(obj, req, ResultEntry) -
main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
r7476 r7811 17 17 ## 18 18 """ 19 Email (SMTP) services for SIRP.19 Email (SMTP) services for KOFA. 20 20 21 21 Note About Encodings … … 51 51 from zope.component import getUtility 52 52 from zope.sendmail.interfaces import IMailDelivery 53 from waeup. sirp.interfaces import IMailService53 from waeup.kofa.interfaces import IMailService 54 54 55 55 class DefaultMailService(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/students/__init__.py
r7592 r7811 2 2 """ 3 3 # Make this a package. 4 from waeup. sirp.students.student import (4 from waeup.kofa.students.student import ( 5 5 Student, StudentFactory 6 6 ) 7 from waeup. sirp.students.container import StudentsContainer8 from waeup. sirp.students.studycourse import StudentStudyCourse9 from waeup. sirp.students.payments import StudentPaymentsContainer10 from waeup. sirp.students.accommodation import StudentAccommodation11 from waeup. sirp.students.dynamicroles import StudentPrincipalRoleManager7 from waeup.kofa.students.container import StudentsContainer 8 from waeup.kofa.students.studycourse import StudentStudyCourse 9 from waeup.kofa.students.payments import StudentPaymentsContainer 10 from waeup.kofa.students.accommodation import StudentAccommodation 11 from waeup.kofa.students.dynamicroles import StudentPrincipalRoleManager 12 12 13 13 -
main/waeup.kofa/trunk/src/waeup/kofa/students/accommodation.py
r7599 r7811 23 23 from zope.component.interfaces import IFactory 24 24 from zope.interface import implementedBy 25 from waeup. sirp.interfaces import academic_sessions_vocab26 from waeup. sirp.students.interfaces import (25 from waeup.kofa.interfaces import academic_sessions_vocab 26 from waeup.kofa.students.interfaces import ( 27 27 IStudentAccommodation, IStudentNavigation, IBedTicket) 28 from waeup. sirp.utils.helpers import attrs_to_fields28 from waeup.kofa.utils.helpers import attrs_to_fields 29 29 30 30 class StudentAccommodation(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r7592 r7811 28 28 from zope.publisher.interfaces.http import IHTTPRequest 29 29 from zope.session.interfaces import ISession 30 from waeup. sirp.authentication import (31 SIRPPrincipalInfo, get_principal_role_manager)32 from waeup. sirp.interfaces import (30 from waeup.kofa.authentication import ( 31 KOFAPrincipalInfo, get_principal_role_manager) 32 from waeup.kofa.interfaces import ( 33 33 IAuthPluginUtility, IUserAccount, IPasswordValidator) 34 from waeup. sirp.students.interfaces import IStudent34 from waeup.kofa.students.interfaces import IStudent 35 35 36 36 class StudentAccount(grok.Adapter): … … 135 135 if not account.checkPassword(credentials['password']): 136 136 return None 137 return SIRPPrincipalInfo(id=account.name,137 return KOFAPrincipalInfo(id=account.name, 138 138 title=account.title, 139 139 description=account.description, -
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r7656 r7811 32 32 from zope.catalog.interfaces import ICatalog 33 33 from hurry.workflow.interfaces import IWorkflowState 34 from waeup. sirp.interfaces import (34 from waeup.kofa.interfaces import ( 35 35 IBatchProcessor, FatalCSVError, IObjectConverter, IUserAccount, 36 36 IObjectHistory) 37 from waeup. sirp.students.interfaces import (37 from waeup.kofa.students.interfaces import ( 38 38 IStudent, IStudentStudyCourse, 39 39 IStudentUpdateByRegNo, IStudentUpdateByMatricNo, 40 40 IStudentStudyLevel, ICourseTicket, 41 41 IStudentOnlinePayment) 42 from waeup. sirp.students.workflow import IMPORTABLE_STATES43 from waeup. sirp.utils.batching import BatchProcessor42 from waeup.kofa.students.workflow import IMPORTABLE_STATES 43 from waeup.kofa.utils.batching import BatchProcessor 44 44 45 45 class StudentProcessor(BatchProcessor): -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
r7745 r7811 29 29 from zope.formlib.textwidgets import BytesDisplayWidget 30 30 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 31 from waeup. sirp.accesscodes import (31 from waeup.kofa.accesscodes import ( 32 32 invalidate_accesscode, get_access_code, create_accesscode) 33 from waeup. sirp.accesscodes.workflow import USED34 from waeup. sirp.browser import (35 SIRPPage, SIRPEditFormPage, SIRPAddFormPage, SIRPDisplayFormPage,36 ContactAdminForm, SIRPForm)37 from waeup. sirp.browser.interfaces import ICaptchaManager38 from waeup. sirp.browser.breadcrumbs import Breadcrumb39 from waeup. sirp.browser.resources import datepicker, datatable, tabs, warning40 from waeup. sirp.browser.layout import jsaction, action, UtilityView41 from waeup. sirp.interfaces import (42 I SIRPObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,43 I SIRPUtils, IUniversity)44 from waeup. sirp.interfaces import MessageFactory as _45 from waeup. sirp.widgets.datewidget import (33 from waeup.kofa.accesscodes.workflow import USED 34 from waeup.kofa.browser import ( 35 KOFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage, 36 ContactAdminForm, KOFAForm) 37 from waeup.kofa.browser.interfaces import ICaptchaManager 38 from waeup.kofa.browser.breadcrumbs import Breadcrumb 39 from waeup.kofa.browser.resources import datepicker, datatable, tabs, warning 40 from waeup.kofa.browser.layout import jsaction, action, UtilityView 41 from waeup.kofa.interfaces import ( 42 IKOFAObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm, 43 IKOFAUtils, IUniversity) 44 from waeup.kofa.interfaces import MessageFactory as _ 45 from waeup.kofa.widgets.datewidget import ( 46 46 FriendlyDateWidget, FriendlyDateDisplayWidget, 47 47 FriendlyDatetimeDisplayWidget) 48 from waeup. sirp.students.interfaces import (48 from waeup.kofa.students.interfaces import ( 49 49 IStudentsContainer, IStudent, IStudentClearance, 50 50 IStudentPersonal, IStudentBase, IStudentStudyCourse, … … 53 53 IStudentOnlinePayment, IBedTicket, IStudentsUtils, IStudentChangePassword 54 54 ) 55 from waeup. sirp.students.catalog import search56 from waeup. sirp.students.workflow import (ADMITTED, PAID,55 from waeup.kofa.students.catalog import search 56 from waeup.kofa.students.workflow import (ADMITTED, PAID, 57 57 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED) 58 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket59 from waeup. sirp.students.vocabularies import StudyLevelSource60 from waeup. sirp.browser.resources import toggleall61 from waeup. sirp.hostels.hostel import NOT_OCCUPIED62 from waeup. sirp.utils.helpers import get_current_principal58 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 59 from waeup.kofa.students.vocabularies import StudyLevelSource 60 from waeup.kofa.browser.resources import toggleall 61 from waeup.kofa.hostels.hostel import NOT_OCCUPIED 62 from waeup.kofa.utils.helpers import get_current_principal 63 63 64 64 def write_log_message(view, message): 65 ob_class = view.__implemented__.__name__.replace('waeup. sirp.','')65 ob_class = view.__implemented__.__name__.replace('waeup.kofa.','') 66 66 view.context.getStudent().loggerInfo(ob_class, message) 67 67 return … … 155 155 @property 156 156 def title(self): 157 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE157 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 158 158 # There is no request attribute, thus we can only translate 159 159 # to the default (portal) language 160 return translate(self.context.level_title, 'waeup. sirp',160 return translate(self.context.level_title, 'waeup.kofa', 161 161 target_language=portal_language) 162 162 163 class StudentsContainerPage( SIRPPage):163 class StudentsContainerPage(KOFAPage): 164 164 """The standard view for student containers. 165 165 """ … … 194 194 return 195 195 196 class StudentsContainerManagePage( SIRPPage):196 class StudentsContainerManagePage(KOFAPage): 197 197 """The manage page for student containers. 198 198 """ … … 245 245 return 246 246 247 class StudentAddFormPage( SIRPAddFormPage):247 class StudentAddFormPage(KOFAAddFormPage): 248 248 """Add-form to add a student. 249 249 """ … … 265 265 return 266 266 267 class StudentBaseDisplayFormPage( SIRPDisplayFormPage):267 class StudentBaseDisplayFormPage(KOFADisplayFormPage): 268 268 """ Page to display student base data 269 269 """ … … 310 310 usertype = getattr(self.request.principal, 311 311 'user_type', 'system').title() 312 sirp_utils = getUtility(ISIRPUtils)313 success = sirp_utils.sendContactForm(312 kofa_utils = getUtility(IKOFAUtils) 313 success = kofa_utils.sendContactForm( 314 314 self.request.principal.title,email, 315 315 self.context.display_fullname,self.context.email, … … 323 323 return 324 324 325 class StudentBaseManageFormPage( SIRPEditFormPage):325 class StudentBaseManageFormPage(KOFAEditFormPage): 326 326 """ View to manage student base data 327 327 """ … … 388 388 return 389 389 390 class StudentClearanceDisplayFormPage( SIRPDisplayFormPage):390 class StudentClearanceDisplayFormPage(KOFADisplayFormPage): 391 391 """ Page to display student clearance data 392 392 """ … … 415 415 @property 416 416 def title(self): 417 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE418 return translate(_('Clearance Data'), 'waeup. sirp',417 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 418 return translate(_('Clearance Data'), 'waeup.kofa', 419 419 target_language=portal_language) 420 420 421 421 @property 422 422 def label(self): 423 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE423 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 424 424 return translate(_('Clearance Slip of '), 425 'waeup. sirp', target_language=portal_language) \425 'waeup.kofa', target_language=portal_language) \ 426 426 + ' %s' % self.context.display_fullname 427 427 … … 434 434 self.context.getStudent(), studentview) 435 435 436 class StudentClearanceManageFormPage( SIRPEditFormPage):436 class StudentClearanceManageFormPage(KOFAEditFormPage): 437 437 """ Page to edit student clearance data 438 438 """ … … 508 508 return 509 509 510 class StudentPersonalDisplayFormPage( SIRPDisplayFormPage):510 class StudentPersonalDisplayFormPage(KOFADisplayFormPage): 511 511 """ Page to display student personal data 512 512 """ … … 523 523 mapping = {'a':self.context.display_fullname}) 524 524 525 class StudentPersonalManageFormPage( SIRPEditFormPage):525 class StudentPersonalManageFormPage(KOFAEditFormPage): 526 526 """ Page to edit student clearance data 527 527 """ … … 538 538 return 539 539 540 class StudyCourseDisplayFormPage( SIRPDisplayFormPage):540 class StudyCourseDisplayFormPage(KOFADisplayFormPage): 541 541 """ Page to display the student study course data 542 542 """ … … 556 556 def current_mode(self): 557 557 if self.context.certificate is not None: 558 studymodes_dict = getUtility(I SIRPUtils).getStudyModesDict()558 studymodes_dict = getUtility(IKOFAUtils).getStudyModesDict() 559 559 return studymodes_dict[self.context.certificate.study_mode] 560 560 return … … 572 572 return 573 573 574 class StudyCourseManageFormPage( SIRPEditFormPage):574 class StudyCourseManageFormPage(KOFAEditFormPage): 575 575 """ Page to edit the student study course data 576 576 """ … … 645 645 return 646 646 647 class StudyLevelDisplayFormPage( SIRPDisplayFormPage):647 class StudyLevelDisplayFormPage(KOFADisplayFormPage): 648 648 """ Page to display student study levels 649 649 """ … … 662 662 @property 663 663 def label(self): 664 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE665 lang = self.request.cookies.get(' sirp.language', portal_language)666 level_title = translate(self.context.level_title, 'waeup. sirp',664 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 665 lang = self.request.cookies.get('kofa.language', portal_language) 666 level_title = translate(self.context.level_title, 'waeup.kofa', 667 667 target_language=lang) 668 668 return _('${a}: Study Level ${b}', mapping = { … … 688 688 @property 689 689 def title(self): 690 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE691 return translate(_('Level Data'), 'waeup. sirp',690 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 691 return translate(_('Level Data'), 'waeup.kofa', 692 692 target_language=portal_language) 693 693 694 694 @property 695 695 def content_title(self): 696 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE697 return translate(_('Course List'), 'waeup. sirp',696 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 697 return translate(_('Course List'), 'waeup.kofa', 698 698 target_language=portal_language) 699 699 700 700 @property 701 701 def label(self): 702 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE703 lang = self.request.cookies.get(' sirp.language', portal_language)704 level_title = translate(self.context.level_title, 'waeup. sirp',702 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 703 lang = self.request.cookies.get('kofa.language', portal_language) 704 level_title = translate(self.context.level_title, 'waeup.kofa', 705 705 target_language=lang) 706 706 return translate(_('Course Registration Slip '), 707 'waeup. sirp', target_language=portal_language) \707 'waeup.kofa', target_language=portal_language) \ 708 708 + ' %s' % level_title 709 709 710 710 def render(self): 711 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE712 Sem = translate(_('Sem.'), 'waeup. sirp', target_language=portal_language)713 Code = translate(_('Code'), 'waeup. sirp', target_language=portal_language)714 Title = translate(_('Title'), 'waeup. sirp', target_language=portal_language)715 Dept = translate(_('Dept.'), 'waeup. sirp', target_language=portal_language)716 Faculty = translate(_('Faculty'), 'waeup. sirp', target_language=portal_language)717 Cred = translate(_('Cred.'), 'waeup. sirp', target_language=portal_language)718 Mand = translate(_('Mand.'), 'waeup. sirp', target_language=portal_language)719 Score = translate(_('Score'), 'waeup. sirp', target_language=portal_language)711 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 712 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 713 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) 714 Title = translate(_('Title'), 'waeup.kofa', target_language=portal_language) 715 Dept = translate(_('Dept.'), 'waeup.kofa', target_language=portal_language) 716 Faculty = translate(_('Faculty'), 'waeup.kofa', target_language=portal_language) 717 Cred = translate(_('Cred.'), 'waeup.kofa', target_language=portal_language) 718 Mand = translate(_('Mand.'), 'waeup.kofa', target_language=portal_language) 719 Score = translate(_('Score'), 'waeup.kofa', target_language=portal_language) 720 720 studentview = StudentBaseDisplayFormPage(self.context.getStudent(), 721 721 self.request) … … 735 735 tabledata=tabledata) 736 736 737 class StudyLevelManageFormPage( SIRPEditFormPage):737 class StudyLevelManageFormPage(KOFAEditFormPage): 738 738 """ Page to edit the student study level data 739 739 """ … … 762 762 @property 763 763 def label(self): 764 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE765 lang = self.request.cookies.get(' sirp.language', portal_language)766 level_title = translate(self.context.level_title, 'waeup. sirp',764 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 765 lang = self.request.cookies.get('kofa.language', portal_language) 766 level_title = translate(self.context.level_title, 'waeup.kofa', 767 767 target_language=lang) 768 768 return _('Manage study level ${a}', … … 853 853 return 854 854 855 class CourseTicketAddFormPage( SIRPAddFormPage):855 class CourseTicketAddFormPage(KOFAAddFormPage): 856 856 """Add a course ticket. 857 857 """ … … 890 890 self.redirect(self.url(self.context)) 891 891 892 class CourseTicketDisplayFormPage( SIRPDisplayFormPage):892 class CourseTicketDisplayFormPage(KOFADisplayFormPage): 893 893 """ Page to display course tickets 894 894 """ … … 906 906 'b':self.context.code}) 907 907 908 class CourseTicketManageFormPage( SIRPEditFormPage):908 class CourseTicketManageFormPage(KOFAEditFormPage): 909 909 """ Page to manage course tickets 910 910 """ … … 925 925 return 926 926 927 class PaymentsManageFormPage( SIRPEditFormPage):927 class PaymentsManageFormPage(KOFAEditFormPage): 928 928 """ Page to manage the student payments 929 929 … … 982 982 self.redirect(self.url(self.context, '@@addop')) 983 983 984 class OnlinePaymentAddFormPage( SIRPAddFormPage):984 class OnlinePaymentAddFormPage(KOFAAddFormPage): 985 985 """ Page to add an online payment ticket 986 986 """ … … 1039 1039 return 1040 1040 1041 class OnlinePaymentDisplayFormPage( SIRPDisplayFormPage):1041 class OnlinePaymentDisplayFormPage(KOFADisplayFormPage): 1042 1042 """ Page to view an online payment ticket 1043 1043 """ … … 1138 1138 1139 1139 1140 class AccommodationManageFormPage( SIRPEditFormPage):1140 class AccommodationManageFormPage(KOFAEditFormPage): 1141 1141 """ Page to manage bed tickets. 1142 1142 … … 1195 1195 return self.actions 1196 1196 1197 class BedTicketAddPage( SIRPPage):1197 class BedTicketAddPage(KOFAPage): 1198 1198 """ Page to add an online payment ticket 1199 1199 """ … … 1287 1287 'c':room_nr, 'd':bed_nr, 1288 1288 'e':bed.bed_type}) 1289 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1289 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1290 1290 bedticket.bed_coordinates = translate( 1291 bc, 'waeup. sirp',target_language=portal_language)1291 bc, 'waeup.kofa',target_language=portal_language) 1292 1292 key = str(acc_details['booking_session']) 1293 1293 self.context[key] = bedticket … … 1297 1297 return 1298 1298 1299 class BedTicketDisplayFormPage( SIRPDisplayFormPage):1299 class BedTicketDisplayFormPage(KOFADisplayFormPage): 1300 1300 """ Page to display bed tickets 1301 1301 """ … … 1325 1325 @property 1326 1326 def title(self): 1327 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1328 return translate(_('Bed Allocation Data'), 'waeup. sirp',1327 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1328 return translate(_('Bed Allocation Data'), 'waeup.kofa', 1329 1329 target_language=portal_language) 1330 1330 1331 1331 @property 1332 1332 def label(self): 1333 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1333 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1334 1334 return translate(_('Bed Allocation: '), 1335 'waeup. sirp', target_language=portal_language) \1335 'waeup.kofa', target_language=portal_language) \ 1336 1336 + ' %s' % self.context.bed_coordinates 1337 1337 … … 1405 1405 'c':room_nr, 'd':bed_nr, 1406 1406 'e':new_bed.bed_type}) 1407 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1407 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1408 1408 self.context.bed_coordinates = translate( 1409 bc, 'waeup. sirp',target_language=portal_language)1409 bc, 'waeup.kofa',target_language=portal_language) 1410 1410 self.flash(_('Student relocated: ${a}', 1411 1411 mapping = {'a':self.context.bed_coordinates})) … … 1416 1416 return 1417 1417 1418 class StudentHistoryPage( SIRPPage):1418 class StudentHistoryPage(KOFAPage): 1419 1419 """ Page to display student clearance data 1420 1420 """ … … 1431 1431 # Pages for students only 1432 1432 1433 class StudentBaseEditFormPage( SIRPEditFormPage):1433 class StudentBaseEditFormPage(KOFAEditFormPage): 1434 1434 """ View to edit student base data 1435 1435 """ … … 1447 1447 return 1448 1448 1449 class StudentChangePasswordPage( SIRPEditFormPage):1449 class StudentChangePasswordPage(KOFAEditFormPage): 1450 1450 """ View to manage student base data 1451 1451 """ … … 1473 1473 return 1474 1474 1475 class StudentFilesUploadPage( SIRPPage):1475 class StudentFilesUploadPage(KOFAPage): 1476 1476 """ View to upload files by student 1477 1477 """ … … 1490 1490 return 1491 1491 1492 class StartClearancePage( SIRPPage):1492 class StartClearancePage(KOFAPage): 1493 1493 grok.context(IStudent) 1494 1494 grok.name('start_clearance') … … 1593 1593 return 1594 1594 1595 class RequestClearancePage( SIRPPage):1595 class RequestClearancePage(KOFAPage): 1596 1596 grok.context(IStudent) 1597 1597 grok.name('request_clearance') … … 1624 1624 return 1625 1625 1626 class StartCourseRegistrationPage( SIRPPage):1626 class StartCourseRegistrationPage(KOFAPage): 1627 1627 grok.context(IStudentStudyCourse) 1628 1628 grok.name('start_course_registration') … … 1673 1673 return 1674 1674 1675 class AddStudyLevelFormPage( SIRPEditFormPage):1675 class AddStudyLevelFormPage(KOFAEditFormPage): 1676 1676 """ Page for students to add current study levels 1677 1677 """ … … 1710 1710 return 1711 1711 1712 class StudyLevelEditFormPage( SIRPEditFormPage):1712 class StudyLevelEditFormPage(KOFAEditFormPage): 1713 1713 """ Page to edit the student study level data by students 1714 1714 """ … … 1732 1732 @property 1733 1733 def label(self): 1734 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE1735 lang = self.request.cookies.get(' sirp.language', portal_language)1736 level_title = translate(self.context.level_title, 'waeup. sirp',1734 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 1735 lang = self.request.cookies.get('kofa.language', portal_language) 1736 level_title = translate(self.context.level_title, 'waeup.kofa', 1737 1737 target_language=lang) 1738 1738 return _('Add and remove course tickets of study level ${a}', … … 1816 1816 return 1817 1817 1818 class ChangePasswordRequestPage( SIRPForm):1818 class ChangePasswordRequestPage(KOFAForm): 1819 1819 """Captcha'd page for students to request a password change. 1820 1820 """ … … 1851 1851 student = list(results)[0] 1852 1852 # Change password 1853 sirp_utils = getUtility(ISIRPUtils)1854 pwd = sirp_utils.genPassword()1853 kofa_utils = getUtility(IKOFAUtils) 1854 pwd = kofa_utils.genPassword() 1855 1855 IUserAccount(student).setPassword(pwd) 1856 1856 # Send email with new redentials 1857 1857 msg = _('You have successfully changed your password for the') 1858 1858 login_url = self.url(grok.getSite(), 'login') 1859 success = sirp_utils.sendCredentials(1859 success = kofa_utils.sendCredentials( 1860 1860 IUserAccount(student),pwd,login_url,msg) 1861 1861 if success: … … 1866 1866 return 1867 1867 1868 class SetPasswordPage( SIRPPage):1869 grok.context(I SIRPObject)1868 class SetPasswordPage(KOFAPage): 1869 grok.context(IKOFAObject) 1870 1870 grok.name('setpassword') 1871 1871 grok.require('waeup.Anonymous') -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/accommodationmanagepage.pt
r7735 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="display dataTableManage"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/basemanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/basepage.pt
r7735 r7811 1 <table i18n:domain="waeup. sirp" class="form-table">1 <table i18n:domain="waeup.kofa" class="form-table"> 2 2 <tbody> 3 3 <tal:block repeat="widget view/widgets"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/change_password.pt
r7735 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <input type="hidden" name="student_id" value="" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/changepw.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/clearanceeditpage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/containermanagepage.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <br /> 3 3 <input class="btn primary" type="submit" name="search" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/containerpage.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <br /> 3 3 <input class="btn primary" type="submit" name="search" -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/courseticketmanagepage.pt
r7737 r7811 1 1 <form action="." tal:attributes="action request/URL" method="post" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="form-table"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/courseticketpage.pt
r7735 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <tbody> 3 3 <tr> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/enterpin.pt
r7735 r7811 1 <form method="POST" i18n:domain="waeup. sirp">1 <form method="POST" i18n:domain="waeup.kofa"> 2 2 <table class="form-table"> 3 3 <tbody> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/fileupload.pt
r7735 r7811 1 <tr i18n:domain="waeup. sirp">1 <tr i18n:domain="waeup.kofa"> 2 2 <td class="fieldname"> 3 3 <span tal:replace="viewlet/label">FILENAME</span>: -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/imageupload.pt
r7738 r7811 1 <tr i18n:domain="waeup. sirp">1 <tr i18n:domain="waeup.kofa"> 2 2 <td class="fieldname"> 3 3 <span tal:replace="viewlet/label">FILENAME</span>: -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/paymentsmanagepage.pt
r7741 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <table class="display dataTableManage"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/setpassword.pt
r7738 r7811 1 <form i18n:domain="waeup. sirp" method="POST">1 <form i18n:domain="waeup.kofa" method="POST"> 2 2 <table class="form-table"> 3 3 <tbody> … … 29 29 tal:attributes="value view/set_button" /> 30 30 </form> 31 <div i18n:domain="waeup. sirp" >31 <div i18n:domain="waeup.kofa" > 32 32 <h3 i18n:translate="">Instructions:</h3> 33 33 <ul class="list" i18n:translate=""> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studycoursemanagepage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studycoursepage.pt
r7738 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 </thead> … … 50 50 </table> 51 51 52 <h3 i18n:domain="waeup. sirp" i18n:translate="">Study Levels (Course Lists)</h3>52 <h3 i18n:domain="waeup.kofa" i18n:translate="">Study Levels (Course Lists)</h3> 53 53 54 <table i18n:domain="waeup. sirp">54 <table i18n:domain="waeup.kofa"> 55 55 <thead> 56 56 <tr> … … 70 70 71 71 <div tal:condition="python: not len(context.keys())" 72 i18n:domain="waeup. sirp" i18n:translate="">72 i18n:domain="waeup.kofa" i18n:translate=""> 73 73 There are no levels registered yet. 74 74 </div> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveladdpage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <p i18n:translate="">Text to explain course registration procedure.</p> … … 10 10 </span> 11 11 </div> 12 </form> 12 </form> 13 13 14 14 -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studyleveleditpage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <h3 i18n:translate=""> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelmanagepage.pt
r7738 r7811 1 1 <form action="." tal:attributes="action request/URL" method="POST" 2 i18n:domain="waeup. sirp" enctype="multipart/form-data">2 i18n:domain="waeup.kofa" enctype="multipart/form-data"> 3 3 4 4 <ul class="tabs" data-tabs="tabs"> -
main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/studylevelpage.pt
r7741 r7811 1 <table class="form-table" i18n:domain="waeup. sirp">1 <table class="form-table" i18n:domain="waeup.kofa"> 2 2 <thead> 3 3 </thead> … … 26 26 </table> 27 27 28 <h3 i18n:domain="waeup. sirp" i18n:translate="">Course Tickets</h3>28 <h3 i18n:domain="waeup.kofa" i18n:translate="">Course Tickets</h3> 29 29 30 <table class="display dataTable" i18n:domain="waeup. sirp">30 <table class="display dataTable" i18n:domain="waeup.kofa"> 31 31 <thead> 32 32 <tr> … … 62 62 63 63 64 <div i18n:domain="waeup. sirp"64 <div i18n:domain="waeup.kofa" 65 65 tal:condition="python: not len(context.keys())" i18n:translate=""> 66 66 The're no tickets added yet. -
main/waeup.kofa/trunk/src/waeup/kofa/students/catalog.py
r7692 r7811 24 24 from zope.catalog.interfaces import ICatalog 25 25 from zope.component import queryUtility 26 from waeup. sirp.interfaces import (26 from waeup.kofa.interfaces import ( 27 27 IUniversity, IQueryResultItem, academic_sessions_vocab) 28 from waeup. sirp.students.interfaces import (IStudent, ICourseTicket,28 from waeup.kofa.students.interfaces import (IStudent, ICourseTicket, 29 29 IStudentOnlinePayment) 30 from waeup. sirp.university.vocabularies import course_levels30 from waeup.kofa.university.vocabularies import course_levels 31 31 32 32 class StudentIndexes(grok.Indexes): -
main/waeup.kofa/trunk/src/waeup/kofa/students/container.py
r7652 r7811 20 20 """ 21 21 import grok 22 from waeup. sirp.students.interfaces import (22 from waeup.kofa.students.interfaces import ( 23 23 IStudentsContainer, IStudent) 24 from waeup. sirp.utils.logger import Logger24 from waeup.kofa.utils.logger import Logger 25 25 26 26 class StudentsContainer(grok.Container, Logger): … … 46 46 return 47 47 48 logger_name = 'waeup. sirp.${sitename}.students'48 logger_name = 'waeup.kofa.${sitename}.students' 49 49 logger_filename = 'students.log' 50 50 -
main/waeup.kofa/trunk/src/waeup/kofa/students/dynamicroles.py
r7336 r7811 27 27 AnnotationPrincipalPermissionManager,) 28 28 from zope.securitypolicy.principalrole import AnnotationPrincipalRoleManager 29 from waeup. sirp.students.interfaces import IStudent29 from waeup.kofa.students.interfaces import IStudent 30 30 31 31 # All components in here have the same context: Student instances -
main/waeup.kofa/trunk/src/waeup/kofa/students/interfaces.py
r7723 r7811 21 21 from zope import schema 22 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 23 from waeup. sirp.interfaces import (24 I SIRPObject, academic_sessions_vocab, validate_email, ISIRPUtils)25 from waeup. sirp.interfaces import MessageFactory as _26 from waeup. sirp.schema import TextLineChoice27 from waeup. sirp.university.vocabularies import CourseSource, StudyModeSource28 from waeup. sirp.students.vocabularies import (23 from waeup.kofa.interfaces import ( 24 IKOFAObject, academic_sessions_vocab, validate_email, IKOFAUtils) 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.schema import TextLineChoice 27 from waeup.kofa.university.vocabularies import CourseSource, StudyModeSource 28 from waeup.kofa.students.vocabularies import ( 29 29 CertificateSource, StudyLevelSource, 30 30 contextual_reg_num_source, contextual_mat_num_source, 31 31 GenderSource, nats_vocab, 32 32 ) 33 from waeup. sirp.payments.interfaces import IPaymentsContainer, IOnlinePayment33 from waeup.kofa.payments.interfaces import IPaymentsContainer, IOnlinePayment 34 34 35 35 # VerdictSource can't be placed into the vocabularies module because it … … 78 78 """ 79 79 80 class IStudentsContainer(I SIRPObject):80 class IStudentsContainer(IKOFAObject): 81 81 """A students container contains university students. 82 82 … … 117 117 """ 118 118 119 class IStudentNavigation(I SIRPObject):119 class IStudentNavigation(IKOFAObject): 120 120 """Interface needed for student navigation. 121 121 … … 126 126 """ 127 127 128 class IStudentBase(I SIRPObject):128 class IStudentBase(IKOFAObject): 129 129 """Representation of student base data. 130 130 … … 206 206 ) 207 207 208 class IStudentClearance(I SIRPObject):208 class IStudentClearance(IKOFAObject): 209 209 """Representation of student clearance data. 210 210 … … 234 234 ) 235 235 236 class IStudentPersonal(I SIRPObject):236 class IStudentPersonal(IKOFAObject): 237 237 """Representation of student personal data. 238 238 … … 268 268 ) 269 269 270 class IStudentStudyCourse(I SIRPObject):270 class IStudentStudyCourse(IKOFAObject): 271 271 """A container for student study levels. 272 272 … … 326 326 ) 327 327 328 class IStudentStudyLevel(I SIRPObject):328 class IStudentStudyLevel(IKOFAObject): 329 329 """A container for course tickets. 330 330 … … 348 348 ) 349 349 350 class ICourseTicket(I SIRPObject):350 class ICourseTicket(IKOFAObject): 351 351 """A course ticket. 352 352 … … 406 406 ) 407 407 408 class IStudentAccommodation(I SIRPObject):408 class IStudentAccommodation(IKOFAObject): 409 409 """A container for student accommodation objects. 410 410 411 411 """ 412 412 413 class IBedTicket(I SIRPObject):413 class IBedTicket(IKOFAObject): 414 414 """A ticket for accommodation booking. 415 415 … … 475 475 'p_item'].order 476 476 477 class IStudentChangePassword(I SIRPObject):477 class IStudentChangePassword(IKOFAObject): 478 478 """Interface needed for change pasword page. 479 479 -
main/waeup.kofa/trunk/src/waeup/kofa/students/payments.py
r7599 r7811 22 22 from zope.component.interfaces import IFactory 23 23 from zope.interface import implementedBy 24 from waeup. sirp.students.interfaces import (24 from waeup.kofa.students.interfaces import ( 25 25 IStudentPaymentsContainer, IStudentNavigation, IStudentOnlinePayment) 26 from waeup. sirp.payments import PaymentsContainer, OnlinePayment27 from waeup. sirp.utils.helpers import attrs_to_fields26 from waeup.kofa.payments import PaymentsContainer, OnlinePayment 27 from waeup.kofa.utils.helpers import attrs_to_fields 28 28 29 29 class StudentPaymentsContainer(PaymentsContainer): -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r7677 r7811 26 26 from hurry.workflow.interfaces import IWorkflowState, IWorkflowInfo 27 27 from zope.securitypolicy.interfaces import IPrincipalRoleManager 28 from waeup. sirp.interfaces import (28 from waeup.kofa.interfaces import ( 29 29 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 30 I SIRPUtils, CLEARANCE, registration_states_vocab)31 from waeup. sirp.image import SIRPImageFile32 from waeup. sirp.imagestorage import DefaultFileStoreHandler33 from waeup. sirp.students.interfaces import IStudent, IStudentNavigation34 from waeup. sirp.students.studycourse import StudentStudyCourse35 from waeup. sirp.students.payments import StudentPaymentsContainer36 from waeup. sirp.students.accommodation import StudentAccommodation37 from waeup. sirp.utils.helpers import attrs_to_fields38 from waeup. sirp.students.utils import generate_student_id30 IKOFAUtils, CLEARANCE, registration_states_vocab) 31 from waeup.kofa.image import KOFAImageFile 32 from waeup.kofa.imagestorage import DefaultFileStoreHandler 33 from waeup.kofa.students.interfaces import IStudent, IStudentNavigation 34 from waeup.kofa.students.studycourse import StudentStudyCourse 35 from waeup.kofa.students.payments import StudentPaymentsContainer 36 from waeup.kofa.students.accommodation import StudentAccommodation 37 from waeup.kofa.utils.helpers import attrs_to_fields 38 from waeup.kofa.students.utils import generate_student_id 39 39 40 40 class Student(grok.Container): … … 63 63 def display_fullname(self): 64 64 middlename = getattr(self, 'middlename', None) 65 sirp_utils = getUtility(ISIRPUtils)66 return sirp_utils.fullname(self.firstname, self.lastname, middlename)65 kofa_utils = getUtility(IKOFAUtils) 66 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 67 67 68 68 @property … … 204 204 205 205 This chooser is registered as an adapter providing 206 :class:`waeup. sirp.interfaces.IFileStoreNameChooser`.206 :class:`waeup.kofa.interfaces.IFileStoreNameChooser`. 207 207 208 208 File store name choosers like this one are only convenience … … 211 211 manually setting up filenames for students. 212 212 213 .. seealso:: :mod:`waeup. sirp.imagestorage`213 .. seealso:: :mod:`waeup.kofa.imagestorage` 214 214 215 215 """ … … 284 284 StudentFileStoreHandler, self).createFile( 285 285 store, root, filename, file_id, file) 286 return file, path, SIRPImageFile(286 return file, path, KOFAImageFile( 287 287 file_obj.filename, file_obj.data) -
main/waeup.kofa/trunk/src/waeup/kofa/students/studycourse.py
r7665 r7811 23 23 from zope.component.interfaces import IFactory 24 24 from zope.interface import implementedBy 25 from waeup. sirp.students.interfaces import (25 from waeup.kofa.students.interfaces import ( 26 26 IStudentStudyCourse, IStudentNavigation, IStudentStudyLevel) 27 from waeup. sirp.students.studylevel import CourseTicket28 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup.kofa.students.studylevel import CourseTicket 28 from waeup.kofa.utils.helpers import attrs_to_fields 29 29 30 30 class StudentStudyCourse(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/studylevel.py
r7633 r7811 22 22 import grok 23 23 from zope.component.interfaces import IFactory 24 from waeup. sirp.students.interfaces import (24 from waeup.kofa.students.interfaces import ( 25 25 IStudentStudyLevel, IStudentNavigation, ICourseTicket) 26 from waeup. sirp.utils.helpers import attrs_to_fields27 from waeup. sirp.students.vocabularies import StudyLevelSource26 from waeup.kofa.utils.helpers import attrs_to_fields 27 from waeup.kofa.students.vocabularies import StudyLevelSource 28 28 29 29 class StudentStudyLevel(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_authentication.py
r7364 r7811 26 26 from zope.securitypolicy.role import Role 27 27 from zope.securitypolicy.interfaces import IRole, Allow 28 from waeup. sirp.authentication import get_principal_role_manager29 from waeup. sirp.interfaces import IAuthPluginUtility, IUserAccount30 from waeup. sirp.students.authentication import (28 from waeup.kofa.authentication import get_principal_role_manager 29 from waeup.kofa.interfaces import IAuthPluginUtility, IUserAccount 30 from waeup.kofa.students.authentication import ( 31 31 StudentsAuthenticatorSetup, StudentAccount) 32 from waeup. sirp.students.tests.test_browser import StudentsFullSetup33 from waeup. sirp.testing import FunctionalLayer32 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 33 from waeup.kofa.testing import FunctionalLayer 34 34 35 35 class StudentsAuthenticatorSetupTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_batching.py
r7665 r7811 28 28 from zope.interface.verify import verifyClass, verifyObject 29 29 30 from waeup. sirp.app import University31 from waeup. sirp.university.faculty import Faculty32 from waeup. sirp.university.department import Department33 from waeup. sirp.students.batching import (30 from waeup.kofa.app import University 31 from waeup.kofa.university.faculty import Faculty 32 from waeup.kofa.university.department import Department 33 from waeup.kofa.students.batching import ( 34 34 StudentProcessor, StudentStudyCourseProcessor, 35 35 StudentStudyLevelProcessor, CourseTicketProcessor, 36 36 StudentOnlinePaymentProcessor) 37 from waeup. sirp.students.student import Student38 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase39 from waeup. sirp.interfaces import IBatchProcessor37 from waeup.kofa.students.student import Student 38 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 39 from waeup.kofa.interfaces import IBatchProcessor 40 40 41 41 STUDENT_SAMPLE_DATA = open( -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
r7723 r7811 33 33 from zope.testbrowser.testing import Browser 34 34 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 35 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase36 from waeup. sirp.app import University37 from waeup. sirp.configuration import SessionConfiguration38 from waeup. sirp.students.student import Student39 from waeup. sirp.students.studylevel import StudentStudyLevel40 from waeup. sirp.university.faculty import Faculty41 from waeup. sirp.university.department import Department42 from waeup. sirp.interfaces import IUserAccount43 from waeup. sirp.authentication import LocalRoleSetEvent44 from waeup. sirp.hostels.hostel import Hostel, Bed, NOT_OCCUPIED35 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 36 from waeup.kofa.app import University 37 from waeup.kofa.configuration import SessionConfiguration 38 from waeup.kofa.students.student import Student 39 from waeup.kofa.students.studylevel import StudentStudyLevel 40 from waeup.kofa.university.faculty import Faculty 41 from waeup.kofa.university.department import Department 42 from waeup.kofa.interfaces import IUserAccount 43 from waeup.kofa.authentication import LocalRoleSetEvent 44 from waeup.kofa.hostels.hostel import Hostel, Bed, NOT_OCCUPIED 45 45 46 46 PH_LEN = 2059 # Length of placeholder file -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py
r7640 r7811 23 23 from zope.component import queryUtility, createObject 24 24 from zope.component.hooks import setSite 25 from waeup. sirp.app import University26 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase27 from waeup. sirp.students.student import Student28 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket29 from waeup. sirp.university.faculty import Faculty30 from waeup. sirp.university.department import Department25 from waeup.kofa.app import University 26 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 27 from waeup.kofa.students.student import Student 28 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 29 from waeup.kofa.university.faculty import Faculty 30 from waeup.kofa.university.department import Department 31 31 32 32 class CatalogTestSetup(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_container.py
r7256 r7811 23 23 from zope.interface.verify import verifyClass, verifyObject 24 24 from zope.component.hooks import setSite, clearSite 25 from waeup. sirp.app import University26 from waeup. sirp.university.department import Department27 from waeup. sirp.students.interfaces import (25 from waeup.kofa.app import University 26 from waeup.kofa.university.department import Department 27 from waeup.kofa.students.interfaces import ( 28 28 IStudentsContainer, 29 29 ) 30 from waeup. sirp.students.container import (30 from waeup.kofa.students.container import ( 31 31 StudentsContainer, 32 32 ) 33 from waeup. sirp.testing import (33 from waeup.kofa.testing import ( 34 34 FunctionalLayer, FunctionalTestCase, remove_logger) 35 35 … … 39 39 40 40 def setUp(self): 41 remove_logger('waeup. sirp.app.students')41 remove_logger('waeup.kofa.app.students') 42 42 super(StudentsContainerTestCase, self).setUp() 43 43 # Setup a sample site for each test … … 86 86 logger = self.app['students'].logger 87 87 assert logger is not None 88 assert logger.name == 'waeup. sirp.app.students'88 assert logger.name == 'waeup.kofa.app.students' 89 89 handlers = logger.handlers 90 90 assert len(handlers) == 1 … … 100 100 logger = self.app['students'].logger 101 101 assert logger is not None 102 assert logger.name == 'waeup. sirp.app.students'102 assert logger.name == 'waeup.kofa.app.students' 103 103 handlers = logger.handlers 104 104 assert len(handlers) == 1 -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_dynamicroles.py
r7257 r7811 24 24 from zope.securitypolicy.tests.test_annotationprincipalrolemanager import ( 25 25 Test as APRMTest, Manageable) 26 from waeup. sirp.testing import FunctionalLayer27 from waeup. sirp.students.tests.test_browser import StudentsFullSetup28 from waeup. sirp.students import Student, StudentPrincipalRoleManager26 from waeup.kofa.testing import FunctionalLayer 27 from waeup.kofa.students.tests.test_browser import StudentsFullSetup 28 from waeup.kofa.students import Student, StudentPrincipalRoleManager 29 29 30 30 class StudentPrincipalRoleManagerTests(APRMTest): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_payment.py
r7193 r7811 20 20 """ 21 21 22 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase23 from waeup. sirp.students.payments import (22 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 23 from waeup.kofa.students.payments import ( 24 24 StudentOnlinePayment, StudentOnlinePaymentFactory) 25 from waeup. sirp.payments.interfaces import IOnlinePayment26 from waeup. sirp.students.interfaces import IStudentNavigation25 from waeup.kofa.payments.interfaces import IOnlinePayment 26 from waeup.kofa.students.interfaces import IStudentNavigation 27 27 28 28 class StudentOnlinePaymentFactoryTest(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_student.py
r7364 r7811 20 20 from zope.component.interfaces import IFactory 21 21 from zope.interface import verify 22 from waeup. sirp.students.student import Student, StudentFactory23 from waeup. sirp.students.studycourse import StudentStudyCourse24 from waeup. sirp.students.studylevel import StudentStudyLevel, CourseTicket25 from waeup. sirp.students.payments import StudentPaymentsContainer26 from waeup. sirp.students.accommodation import StudentAccommodation, BedTicket27 from waeup. sirp.applicants.interfaces import IApplicantBaseData28 from waeup. sirp.students.interfaces import (22 from waeup.kofa.students.student import Student, StudentFactory 23 from waeup.kofa.students.studycourse import StudentStudyCourse 24 from waeup.kofa.students.studylevel import StudentStudyLevel, CourseTicket 25 from waeup.kofa.students.payments import StudentPaymentsContainer 26 from waeup.kofa.students.accommodation import StudentAccommodation, BedTicket 27 from waeup.kofa.applicants.interfaces import IApplicantBaseData 28 from waeup.kofa.students.interfaces import ( 29 29 IStudent, IStudentStudyCourse, IStudentPaymentsContainer, IStudentAccommodation, 30 30 IStudentStudyLevel, ICourseTicket, IBedTicket) 31 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase32 from waeup. sirp.university.department import Department31 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 32 from waeup.kofa.university.department import Department 33 33 34 34 class StudentTest(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_utils.py
r7510 r7811 1 1 # -*- coding: utf-8 -*- 2 2 import unittest 3 from waeup. sirp.students.utils import formatted_text3 from waeup.kofa.students.utils import formatted_text 4 4 5 5 class FormatterTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_vocabularies.py
r7691 r7811 17 17 ## 18 18 import unittest 19 from waeup. sirp.students.vocabularies import StudyLevelSource20 from waeup. sirp.university.certificate import Certificate19 from waeup.kofa.students.vocabularies import StudyLevelSource 20 from waeup.kofa.university.certificate import Certificate 21 21 22 22 -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r7804 r7811 35 35 from zope.component import getUtility 36 36 from zope.formlib.form import setUpEditWidgets 37 from waeup. sirp.interfaces import IExtFileStore, ISIRPUtils38 from waeup. sirp.interfaces import MessageFactory as _39 from waeup. sirp.students.interfaces import IStudentsUtils37 from waeup.kofa.interfaces import IExtFileStore, IKOFAUtils 38 from waeup.kofa.interfaces import MessageFactory as _ 39 from waeup.kofa.students.interfaces import IStudentsUtils 40 40 41 41 SLIP_STYLE = [ … … 108 108 studentview.context, attr='passport.jpg') 109 109 if img is None: 110 from waeup. sirp.browser import DEFAULT_PASSPORT_IMAGE_PATH110 from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH 111 111 img = open(DEFAULT_PASSPORT_IMAGE_PATH, 'rb') 112 112 doc_img = Image(img.name, width=4*cm, height=4*cm, kind='bound') 113 113 data_left.append([doc_img]) 114 114 #data.append([Spacer(1, 12)]) 115 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE115 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 116 116 for widget in studentview.widgets: 117 117 if widget.name == 'form.adm_code': 118 118 continue 119 119 f_label = formatted_label(size=12) % translate( 120 widget.label.strip(), 'waeup. sirp',120 widget.label.strip(), 'waeup.kofa', 121 121 target_language=portal_language) 122 122 f_label = Paragraph(f_label, style["Normal"]) … … 164 164 story = [] 165 165 frame_footer = Frame(1*cm,0,width-(2*cm),1*cm) 166 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE166 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 167 167 right_text = translate(_('<font size=10>${a} Page ${b} of ${c}</font>', 168 168 mapping = {'a':text, 'b':pdf.getPageNumber(), 'c':number_of_pages}), 169 'waeup. sirp', target_language=portal_language)169 'waeup.kofa', target_language=portal_language) 170 170 story.append(Paragraph(right_text, style["Right"])) 171 171 frame_footer.addFromList(story,pdf) … … 256 256 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 257 257 view.request.principal.id)) 258 pdf.setCreator('WAeUP SIRP')258 pdf.setCreator('WAeUP KOFA') 259 259 width, height = A4 260 260 footer_text = view.label … … 275 275 frame_body = Frame(1*cm,1*cm,width-(2*cm),height-(3.5*cm)) 276 276 story.append(Paragraph(view.label, style["Heading2"])) 277 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE277 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 278 278 if student is not None: 279 279 #story.append(Spacer(1, 12)) 280 280 bd_translation = translate(_('Base Data'), 281 'waeup. sirp', target_language=portal_language)281 'waeup.kofa', target_language=portal_language) 282 282 story.append(Paragraph(bd_translation, style["Heading3"])) 283 283 studenttable = render_student_data(studentview) … … 288 288 set_up_widgets(view) 289 289 data = [] 290 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE290 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 291 291 for widget in view.widgets: 292 292 f_label = '<font size=12>%s</font>:' % translate( 293 widget.label.strip(), 'waeup. sirp',293 widget.label.strip(), 'waeup.kofa', 294 294 target_language=portal_language) 295 295 f_label = Paragraph(f_label, style["Normal"]) … … 302 302 # Import browser components locally 303 303 # to avoid circular import 304 from waeup. sirp.students.viewlets import FileManager305 from waeup. sirp.browser import DEFAULT_IMAGE_PATH304 from waeup.kofa.students.viewlets import FileManager 305 from waeup.kofa.browser import DEFAULT_IMAGE_PATH 306 306 data = [] 307 307 # Collect viewlets … … 309 309 fm.update() 310 310 if fm.viewlets: 311 sc_translation = translate(_('Scanned Documents'), 'waeup. sirp',311 sc_translation = translate(_('Scanned Documents'), 'waeup.kofa', 312 312 target_language=portal_language) 313 313 story.append(Paragraph(sc_translation, style["Heading3"])) … … 315 315 for viewlet in fm.viewlets: 316 316 f_label = formatted_label(size=12) % translate( 317 viewlet.label, 'waeup. sirp',317 viewlet.label, 'waeup.kofa', 318 318 target_language=portal_language) 319 319 f_label = Paragraph(f_label, style["Normal"]) -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r7741 r7811 21 21 from zope.interface import Interface 22 22 from zope.i18n import translate 23 from waeup. sirp.interfaces import (24 I SIRPObject, IExtFileStore, IFileStoreNameChooser, ISIRPUtils)25 from waeup. sirp.interfaces import MessageFactory as _26 from waeup. sirp.utils.helpers import string_from_bytes, file_size27 from waeup. sirp.browser import DEFAULT_IMAGE_PATH28 from waeup. sirp.browser.viewlets import (23 from waeup.kofa.interfaces import ( 24 IKOFAObject, IExtFileStore, IFileStoreNameChooser, IKOFAUtils) 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.utils.helpers import string_from_bytes, file_size 27 from waeup.kofa.browser import DEFAULT_IMAGE_PATH 28 from waeup.kofa.browser.viewlets import ( 29 29 PrimaryNavTab, ManageActionButton, AddActionButton) 30 from waeup. sirp.browser.layout import default_primary_nav_template31 from waeup. sirp.students.workflow import (ADMITTED, PAID,30 from waeup.kofa.browser.layout import default_primary_nav_template 31 from waeup.kofa.students.workflow import (ADMITTED, PAID, 32 32 CLEARANCE, REQUESTED, RETURNING, CLEARED, REGISTERED, VALIDATED) 33 from waeup. sirp.students.browser import (33 from waeup.kofa.students.browser import ( 34 34 StudentClearanceManageFormPage, 35 35 write_log_message, StudentBaseManageFormPage, … … 40 40 CourseTicketDisplayFormPage, OnlinePaymentDisplayFormPage, 41 41 AccommodationManageFormPage, BedTicketDisplayFormPage,) 42 from waeup. sirp.students.interfaces import (42 from waeup.kofa.students.interfaces import ( 43 43 IStudentsContainer, IStudent, IStudentClearance, 44 44 IStudentStudyCourse, IStudentAccommodation, IStudentStudyLevel, … … 46 46 ) 47 47 48 from waeup. sirp.interfaces import MessageFactory as _49 50 grok.context(I SIRPObject) # Make ISIRPObject the default context48 from waeup.kofa.interfaces import MessageFactory as _ 49 50 grok.context(IKOFAObject) # Make IKOFAObject the default context 51 51 grok.templatedir('browser_templates') 52 52 … … 63 63 grok.baseclass() 64 64 grok.viewletmanager(StudentManageSidebar) 65 grok.context(I SIRPObject)65 grok.context(IKOFAObject) 66 66 grok.view(Interface) 67 67 grok.order(5) … … 73 73 def render(self): 74 74 url = self.view.url(self.context.getStudent(), self.link) 75 portal_language = getUtility(I SIRPUtils).PORTAL_LANGUAGE76 lang = self.request.cookies.get(' sirp.language', portal_language)77 text = translate(self.text, 'waeup. sirp',75 portal_language = getUtility(IKOFAUtils).PORTAL_LANGUAGE 76 lang = self.request.cookies.get('kofa.language', portal_language) 77 text = translate(self.text, 'waeup.kofa', 78 78 target_language=lang) 79 79 return u'<li><a href="%s">%s</a></li>' % ( … … 465 465 """ 466 466 467 grok.context(I SIRPObject)467 grok.context(IKOFAObject) 468 468 grok.order(4) 469 469 grok.require('waeup.viewStudentsTab') -
main/waeup.kofa/trunk/src/waeup/kofa/students/vocabularies.py
r7691 r7811 25 25 from zc.sourcefactory.basic import BasicSourceFactory 26 26 from zc.sourcefactory.contextual import BasicContextualSourceFactory 27 from waeup. sirp.interfaces import SimpleSIRPVocabulary28 from waeup. sirp.interfaces import MessageFactory as _29 from waeup. sirp.students.lgas import LGAS30 from waeup. sirp.students.nats import NATS31 from waeup. sirp.university.vocabularies import course_levels27 from waeup.kofa.interfaces import SimpleKOFAVocabulary 28 from waeup.kofa.interfaces import MessageFactory as _ 29 from waeup.kofa.students.lgas import LGAS 30 from waeup.kofa.students.nats import NATS 31 from waeup.kofa.university.vocabularies import course_levels 32 32 33 lgas_vocab = Simple SIRPVocabulary(33 lgas_vocab = SimpleKOFAVocabulary( 34 34 *sorted([(x[1],x[0]) for x in LGAS])) 35 35 36 nats_vocab = Simple SIRPVocabulary(36 nats_vocab = SimpleKOFAVocabulary( 37 37 *sorted([(x[1],x[0]) for x in NATS])) 38 38 -
main/waeup.kofa/trunk/src/waeup/kofa/students/workflow.py
r7690 r7811 5 5 from hurry.workflow.workflow import Transition, WorkflowState, NullCondition 6 6 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 7 from waeup. sirp.interfaces import (8 IObjectHistory, I SIRPWorkflowInfo, ISIRPUtils,7 from waeup.kofa.interfaces import ( 8 IObjectHistory, IKOFAWorkflowInfo, IKOFAUtils, 9 9 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 10 10 REGISTERED, VALIDATED) 11 from waeup. sirp.interfaces import MessageFactory as _12 from waeup. sirp.workflow import SIRPWorkflow, SIRPWorkflowInfo13 from waeup. sirp.students.interfaces import IStudent, IStudentsUtils11 from waeup.kofa.interfaces import MessageFactory as _ 12 from waeup.kofa.workflow import KOFAWorkflow, KOFAWorkflowInfo 13 from waeup.kofa.students.interfaces import IStudent, IStudentsUtils 14 14 15 15 … … 156 156 UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance') 157 157 158 registration_workflow = SIRPWorkflow(REGISTRATION_TRANSITIONS)158 registration_workflow = KOFAWorkflow(REGISTRATION_TRANSITIONS) 159 159 160 160 class RegistrationWorkflowState(WorkflowState, grok.Adapter): … … 167 167 state_id = 'wf.registration.id' 168 168 169 class RegistrationWorkflowInfo( SIRPWorkflowInfo, grok.Adapter):169 class RegistrationWorkflowInfo(KOFAWorkflowInfo, grok.Adapter): 170 170 """Adapter to adapt Student objects to workflow info objects. 171 171 """ 172 172 grok.context(IStudent) 173 grok.provides(I SIRPWorkflowInfo)173 grok.provides(IKOFAWorkflowInfo) 174 174 175 175 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/testing.py
r7581 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Testing support for :mod:`waeup. sirp`.18 """Testing support for :mod:`waeup.kofa`. 19 19 """ 20 20 import grok … … 28 28 import warnings 29 29 import zope.component 30 import waeup. sirp30 import waeup.kofa 31 31 from zope.app.testing.functional import ( 32 32 ZCMLLayer, FunctionalTestSetup, getRootFolder, sync, FunctionalTestCase) … … 37 37 38 38 ftesting_zcml = os.path.join( 39 os.path.dirname(waeup. sirp.__file__), 'ftesting.zcml')39 os.path.dirname(waeup.kofa.__file__), 'ftesting.zcml') 40 40 FunctionalLayer = ZCMLLayer(ftesting_zcml, __name__, 'FunctionalLayer', 41 41 allow_teardown=True) … … 45 45 """ 46 46 result = logging.root.manager.loggerDict.keys() 47 ws_loggers = [x for x in result if 'waeup. sirp' in x]47 ws_loggers = [x for x in result if 'waeup.kofa' in x] 48 48 if ws_loggers: 49 49 # For debugging: show any remaining loggers from w.s. namespace … … 93 93 94 94 def maybe_grok(): 95 """Try to grok the :mod:`waeup. sirp` package.95 """Try to grok the :mod:`waeup.kofa` package. 96 96 97 97 For many tests, even simple ones, we want the components defined 98 somewhere in the :mod:`waeup. sirp` package being registered. While98 somewhere in the :mod:`waeup.kofa` package being registered. While 99 99 grokking the complete package can become expensive when done many 100 100 times, we only want to grok if it did not happen … … 105 105 registered and does nothing in that case. 106 106 107 The grokking of :mod:`waeup. sirp` is done with warnings disabled.107 The grokking of :mod:`waeup.kofa` is done with warnings disabled. 108 108 109 109 Returns ``True`` if grokking was done, ``False`` else. … … 122 122 123 123 import unittest2 as unittest # Want Python 2.7 features 124 from waeup. sirp.testing import (124 from waeup.kofa.testing import ( 125 125 maybe_grok, setUpZope, cleanUpZope, 126 126 ) 127 from waeup. sirp.app import University127 from waeup.kofa.app import University 128 128 129 129 class MyTestCase(unittest.TestCase): … … 153 153 Here the component registration is done only once for the whole 154 154 :class:`unittest.TestCase` and no ZODB is needed. That means 155 inside the tests you can expect to have all :mod:`waeup. sirp`155 inside the tests you can expect to have all :mod:`waeup.kofa` 156 156 components (utilities, adapter, events) registered but as objects 157 157 have here still have no place inside a ZODB things like 'browsing' … … 163 163 If you use the Zope testrunner (from :mod:`zope.testing`) 164 164 then you have to use appropriate layers like the 165 :class:`waeup. sirp.testing.SIRPUnitTestLayer`.165 :class:`waeup.kofa.testing.KOFAUnitTestLayer`. 166 166 167 167 Usage with :mod:`zope.testing` testrunners … … 172 172 like the one defined in this module. 173 173 174 .. seealso:: :class:`waeup. sirp.testing.SIRPUnitTestLayer`174 .. seealso:: :class:`waeup.kofa.testing.KOFAUnitTestLayer` 175 175 176 176 """ 177 177 gsm = getGlobalSiteManager() 178 178 # If there are any event handlers registered already, we assume 179 # that waeup. sirpwas grokked already. There might be a batter179 # that waeup.kofa was grokked already. There might be a batter 180 180 # check, though. 181 181 if len(list(gsm.registeredHandlers())) > 0: … … 184 184 addCheckerPublic() 185 185 warnings.simplefilter('ignore') # disable (erraneous) warnings 186 grok.testing.grok('waeup. sirp')186 grok.testing.grok('waeup.kofa') 187 187 warnings.simplefilter('default') # reenable warnings 188 188 return True … … 191 191 """Register a datacenter config utility for non-functional tests. 192 192 """ 193 from waeup. sirp.interfaces import IDataCenterConfig193 from waeup.kofa.interfaces import IDataCenterConfig 194 194 conf = queryUtility(IDataCenterConfig) 195 195 if conf is not None: … … 204 204 """Unregister a datacenter config utility for non-functional tests. 205 205 """ 206 from waeup. sirp.interfaces import IDataCenterConfig206 from waeup.kofa.interfaces import IDataCenterConfig 207 207 conf = queryUtility(IDataCenterConfig) 208 208 if conf is None: … … 214 214 return 215 215 216 class SIRPUnitTestLayer(object):217 """A layer for tests that groks `waeup. sirp`.218 219 A Zope test layer that registers all :mod:`waeup. sirp` components216 class KOFAUnitTestLayer(object): 217 """A layer for tests that groks `waeup.kofa`. 218 219 A Zope test layer that registers all :mod:`waeup.kofa` components 220 220 before attached tests are run and cleans this registrations up 221 afterwards. Also basic (non-waeup. sirp) components like the event221 afterwards. Also basic (non-waeup.kofa) components like the event 222 222 dispatcher machinery are registered, set up and cleaned up. 223 223 … … 237 237 238 238 import unittest 239 from waeup. sirp.testing import SIRPUnitTestLayer239 from waeup.kofa.testing import KOFAUnitTestLayer 240 240 241 241 class MyTestCase(unittest.TestCase): 242 242 243 layer = SIRPUnitTestLayer243 layer = KOFAUnitTestLayer 244 244 245 245 # per-test setups and real tests go here... … … 331 331 def clear_logger_collector(): 332 332 from zope.component import queryUtility, getGlobalSiteManager 333 from waeup. sirp.interfaces import ILoggerCollector333 from waeup.kofa.interfaces import ILoggerCollector 334 334 collector = queryUtility(ILoggerCollector) 335 335 if collector is None: … … 363 363 If no special `checker` is passed, we use an extended 364 364 :class:`doctest.OutputChecker` as defined in 365 :mod:`waeup. sirp.testing`.365 :mod:`waeup.kofa.testing`. 366 366 367 367 If optional `optionflags` are not given, use ``REPORT_NDIFF``, 368 368 ``ELLIPSIS``, and ``NORMALIZE_WHITESPACE``. 369 369 370 .. seealso:: :data:`waeup. sirp.testing.optionflags`371 372 .. seealso:: :data:`waeup. sirp.testing.checker`370 .. seealso:: :data:`waeup.kofa.testing.optionflags` 371 372 .. seealso:: :data:`waeup.kofa.testing.checker` 373 373 """ 374 374 if checker.check_output(want, got, optionflags): … … 406 406 instance by something like: 407 407 408 from waeup. sirp.testing import get_doctest_suite408 from waeup.kofa.testing import get_doctest_suite 409 409 def test_suite(): 410 410 suite = get_doctest_suite(['mypkg/foo.txt', 'mypkg/bar.txt']) -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_app.py
r7193 r7811 22 22 from zope.component.hooks import setSite 23 23 from zope.interface.verify import verifyClass, verifyObject 24 from waeup. sirp.app import University25 from waeup. sirp.interfaces import IUniversity26 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase24 from waeup.kofa.app import University 25 from waeup.kofa.interfaces import IUniversity 26 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 27 27 28 28 class UniversityTests(FunctionalTestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_authentication.py
r7290 r7811 22 22 from zope.pluggableauth.interfaces import IAuthenticatorPlugin 23 23 from zope.securitypolicy.interfaces import IPrincipalRoleManager 24 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer25 from waeup. sirp.authentication import (26 UserAuthenticatorPlugin, Account, SIRPPrincipalInfo,24 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 25 from waeup.kofa.authentication import ( 26 UserAuthenticatorPlugin, Account, KOFAPrincipalInfo, 27 27 get_principal_role_manager) 28 28 … … 64 64 result2 = plugin.authenticateCredentials( 65 65 dict(login='bob', password='nonsense')) 66 self.assertTrue(isinstance(result1, SIRPPrincipalInfo))66 self.assertTrue(isinstance(result1, KOFAPrincipalInfo)) 67 67 self.assertTrue(result2 is None) 68 68 return … … 73 73 result1 = plugin.principalInfo('bob') 74 74 result2 = plugin.principalInfo('manfred') 75 self.assertTrue(isinstance(result1, SIRPPrincipalInfo))75 self.assertTrue(isinstance(result1, KOFAPrincipalInfo)) 76 76 self.assertTrue(result2 is None) 77 77 return -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_configuration.py
r7193 r7811 20 20 from zope.component.interfaces import IFactory 21 21 from zope.interface import verify 22 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase23 from waeup. sirp.configuration import (22 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 23 from waeup.kofa.configuration import ( 24 24 ConfigurationContainer, SessionConfiguration, SessionConfigurationFactory) 25 from waeup. sirp.interfaces import(25 from waeup.kofa.interfaces import( 26 26 IConfigurationContainer, ISessionConfiguration, ISessionConfigurationAdd) 27 27 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_doctests.py
r7193 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Register doctests for waeup. sirp.18 """Register doctests for waeup.kofa. 19 19 """ 20 from waeup. sirp.testing import get_doctest_suite20 from waeup.kofa.testing import get_doctest_suite 21 21 22 22 def test_suite(): -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_imagestorage.py
r7193 r7811 27 27 from zope.component.hooks import setSite 28 28 from zope.interface.verify import verifyClass, verifyObject 29 from waeup. sirp.app import University30 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase31 from waeup. sirp.imagestorage import (29 from waeup.kofa.app import University 30 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 31 from waeup.kofa.imagestorage import ( 32 32 FileStoreNameChooser, ExtFileStore, DefaultFileStoreHandler, 33 33 DefaultStorage) 34 from waeup. sirp.interfaces import (34 from waeup.kofa.interfaces import ( 35 35 IFileStoreNameChooser, IExtFileStore, IFileStoreHandler,) 36 36 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_interfaces.py
r7321 r7811 20 20 import grok 21 21 import unittest 22 from waeup. sirp.interfaces import DuplicationError, RoleSource23 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase22 from waeup.kofa.interfaces import DuplicationError, RoleSource 23 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 24 24 25 25 class DuplicationErrorTests(unittest.TestCase): … … 48 48 # Register a role not visible to waeup portal as its name does 49 49 # not start with 'waeup.' 50 class Non SIRPRole(grok.Role):50 class NonKOFARole(grok.Role): 51 51 grok.name('nonwaeup.testrole') 52 52 grok.title('Role not suitable for waeup') 53 53 grok.permissions('waeup.Public') 54 54 grok.testing.grok_component('SomeRole', SomeRole) 55 grok.testing.grok_component('Non SIRPRole', NonSIRPRole)55 grok.testing.grok_component('NonKOFARole', NonKOFARole) 56 56 return 57 57 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_objecthistory.py
r7372 r7811 25 25 from zope.security.management import newInteraction, endInteraction 26 26 from zope.security.testing import Principal, Participation 27 from waeup. sirp.app import University28 from waeup. sirp.interfaces import IObjectHistory, ISIRPObject29 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer30 from waeup. sirp.objecthistory import ObjectHistory27 from waeup.kofa.app import University 28 from waeup.kofa.interfaces import IObjectHistory, IKOFAObject 29 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 30 from waeup.kofa.objecthistory import ObjectHistory 31 31 32 32 class SampleObject(grok.Model): 33 grok.implements(I SIRPObject)33 grok.implements(IKOFAObject) 34 34 pass 35 35 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_schoolgrades.py
r7795 r7811 2 2 import unittest 3 3 from zope.interface.verify import verifyObject, verifyClass 4 from waeup. sirp.interfaces import IResultEntry, IResultEntryField5 from waeup. sirp.schoolgrades import ResultEntry, ResultEntryField4 from waeup.kofa.interfaces import IResultEntry, IResultEntryField 5 from waeup.kofa.schoolgrades import ResultEntry, ResultEntryField 6 6 7 7 class ResultEntryTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_smtp.py
r7506 r7811 27 27 from zope.component.hooks import setSite 28 28 from zope.sendmail.interfaces import IMailDelivery 29 from waeup. sirp.app import University30 from waeup. sirp.interfaces import IMailService31 from waeup. sirp.smtp import (29 from waeup.kofa.app import University 30 from waeup.kofa.interfaces import IMailService 31 from waeup.kofa.smtp import ( 32 32 encode_header_item, encode_address, encode_body, FakeSMTPDelivery, 33 33 send_mail) 34 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase34 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 35 35 36 36 # … … 328 328 'test program', 'no-reply@waeup.org', 329 329 'test mail receiver', EXTERNAL_MAIL_RECEIVER, 330 'Test Mail from WAeUP SIRP',330 'Test Mail from WAeUP KOFA', 331 331 'Hi from test mailer!\n\nRegards,\nTest Programme\n' 332 332 ) … … 345 345 'test program', 'no-reply@waeup.org', 346 346 'test mail receiver', EXTERNAL_MAIL_RECEIVER, 347 'Test Mail from WAeUP SIRP',347 'Test Mail from WAeUP KOFA', 348 348 'Hi from test mailer!\n\nRegards,\nTest Programme\n' 349 349 ) -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_waeup.py
r7193 r7811 17 17 ## 18 18 """ 19 Test setup for the waeup. sirppackage.19 Test setup for the waeup.kofa package. 20 20 """ 21 21 import grok … … 23 23 import zope.component.eventtesting 24 24 from zope.testing import renormalizing 25 from waeup. sirp.testing import FunctionalLayer25 from waeup.kofa.testing import FunctionalLayer 26 26 27 27 def setUpZope(test): … … 32 32 ]) 33 33 34 # Register all tests in the waeup. sirppackage34 # Register all tests in the waeup.kofa package 35 35 test_suite = grok.testing.register_all_tests( 36 'waeup. sirp', checker=checker, usetup=setUpZope,36 'waeup.kofa', checker=checker, usetup=setUpZope, 37 37 layer=FunctionalLayer) -
main/waeup.kofa/trunk/src/waeup/kofa/university/__init__.py
r7681 r7811 1 1 # Make this a package. 2 from waeup. sirp.university.course import Course3 from waeup. sirp.university.coursescontainer import CoursesContainer4 from waeup. sirp.university.certificate import Certificate5 from waeup. sirp.university.certificatescontainer import CertificatesContainer6 from waeup. sirp.university.faculty import Faculty7 from waeup. sirp.university.department import Department8 from waeup. sirp.university.facultiescontainer import FacultiesContainer2 from waeup.kofa.university.course import Course 3 from waeup.kofa.university.coursescontainer import CoursesContainer 4 from waeup.kofa.university.certificate import Certificate 5 from waeup.kofa.university.certificatescontainer import CertificatesContainer 6 from waeup.kofa.university.faculty import Faculty 7 from waeup.kofa.university.department import Department 8 from waeup.kofa.university.facultiescontainer import FacultiesContainer 9 9 __all__ = ( 10 10 'Course', 'CoursesContainer', -
main/waeup.kofa/trunk/src/waeup/kofa/university/api.txt
r7333 r7811 1 :mod:`waeup. sirp.university` -- academic components1 :mod:`waeup.kofa.university` -- academic components 2 2 *************************************************** 3 3 4 .. module:: waeup. sirp.university4 .. module:: waeup.kofa.university 5 5 6 6 Components that represent academic 'core' stuff like faculties, … … 9 9 ========== 10 10 11 The :mod:`waeup. sirp.university` module provides the following submodules:11 The :mod:`waeup.kofa.university` module provides the following submodules: 12 12 13 13 .. toctree:: -
main/waeup.kofa/trunk/src/waeup/kofa/university/batching.py
r7665 r7811 26 26 import grok 27 27 from zope.interface import Interface 28 from waeup. sirp.interfaces import IBatchProcessor29 from waeup. sirp.university.interfaces import (28 from waeup.kofa.interfaces import IBatchProcessor 29 from waeup.kofa.university.interfaces import ( 30 30 IFacultiesContainer, IFaculty, ICourse, IDepartment, ICertificate, 31 31 ICertificateCourse) 32 from waeup. sirp.utils.batching import BatchProcessor32 from waeup.kofa.utils.batching import BatchProcessor 33 33 34 34 class FacultyProcessor(BatchProcessor): -
main/waeup.kofa/trunk/src/waeup/kofa/university/catalog.py
r7641 r7811 26 26 from zope.index.text.parsetree import ParseError 27 27 from zope.intid import IIntIds 28 #from waeup. sirp.catalog import QueryResultItem29 from waeup. sirp.interfaces import IUniversity, IQueryResultItem30 from waeup. sirp.university.interfaces import (28 #from waeup.kofa.catalog import QueryResultItem 29 from waeup.kofa.interfaces import IUniversity, IQueryResultItem 30 from waeup.kofa.university.interfaces import ( 31 31 ICourse, ICertificateCourse, IDepartment, 32 32 ICertificate, -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.py
r7751 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ SIRPcertificates18 """KOFA certificates 19 19 """ 20 20 import grok … … 24 24 from zope.component.interfaces import IFactory, ComponentLookupError 25 25 from zope.interface import implementedBy 26 from waeup. sirp.university.interfaces import (26 from waeup.kofa.university.interfaces import ( 27 27 ICertificate, ICertificateAdd, ICertificateCourse) 28 from waeup. sirp.university.vocabularies import course_levels28 from waeup.kofa.university.vocabularies import course_levels 29 29 30 30 class Certificate(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt
r7665 r7811 1 :mod:`waeup. sirp.university.certificate` -- Certificates for SIRP1 :mod:`waeup.kofa.university.certificate` -- Certificates for KOFA 2 2 ****************************************************************** 3 3 4 .. module:: waeup. sirp.university.certificate4 .. module:: waeup.kofa.university.certificate 5 5 6 6 Components that represent and manage certificates. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 … … 25 25 All parameters are optional: 26 26 27 >>> from waeup. sirp.university.certificate import Certificate27 >>> from waeup.kofa.university.certificate import Certificate 28 28 >>> mycertificate = Certificate() 29 29 30 30 Certificates have the attributes required by the `ICertificate` interface: 31 31 32 >>> from waeup. sirp.university.interfaces import ICertificate32 >>> from waeup.kofa.university.interfaces import ICertificate 33 33 >>> ICertificate.providedBy(mycertificate) 34 34 True … … 99 99 100 100 Add a referrer of a course. A course is an object implementing 101 :class:`waeup. sirp.interfaces.ICourse`.101 :class:`waeup.kofa.interfaces.ICourse`. 102 102 103 103 Please don't be confused by the term 'referrer'. As course objects … … 159 159 >>> mycertificate = createObject(u'waeup.Certificate') 160 160 >>> mycertificate 161 <waeup. sirp.university.certificate.Certificate object at 0x...>161 <waeup.kofa.university.certificate.Certificate object at 0x...> 162 162 163 163 The factory complies with the specifications from the … … 166 166 >>> from zope.interface.verify import verifyClass 167 167 >>> from zope.component.interfaces import IFactory 168 >>> from waeup. sirp.university.certificate import CertificateFactory168 >>> from waeup.kofa.university.certificate import CertificateFactory 169 169 >>> verifyClass(IFactory, CertificateFactory) 170 170 True … … 175 175 >>> certificate_factory = CertificateFactory() 176 176 >>> certificate_factory.getInterfaces() 177 <implementedBy waeup. sirp.university.certificate.Certificate>177 <implementedBy waeup.kofa.university.certificate.Certificate> 178 178 179 179 … … 193 193 >>> mycertificatecourse = createObject(u'waeup.CertificateCourse') 194 194 >>> mycertificatecourse 195 <waeup. sirp.university.certificate.CertificateCourse object at 0x...>195 <waeup.kofa.university.certificate.CertificateCourse object at 0x...> 196 196 197 197 The factory complies with the specifications from the … … 200 200 >>> from zope.interface.verify import verifyClass 201 201 >>> from zope.component.interfaces import IFactory 202 >>> from waeup. sirp.university.certificate import CertificateCourseFactory202 >>> from waeup.kofa.university.certificate import CertificateCourseFactory 203 203 >>> verifyClass(IFactory, CertificateCourseFactory) 204 204 True … … 209 209 >>> certcourse_factory = CertificateCourseFactory() 210 210 >>> certcourse_factory.getInterfaces() 211 <implementedBy waeup. sirp.university.certificate.CertificateCourse>211 <implementedBy waeup.kofa.university.certificate.CertificateCourse> 212 212 213 213 … … 244 244 We can create certificates: 245 245 246 >>> from waeup. sirp.university.certificate import Certificate246 >>> from waeup.kofa.university.certificate import Certificate 247 247 >>> mycertificate = Certificate() 248 248 >>> mycertificate 249 <waeup. sirp.university.certificate.Certificate object at 0x...>249 <waeup.kofa.university.certificate.Certificate object at 0x...> 250 250 251 251 Another way to create certificates is by asking for a factory called … … 256 256 >>> mycertificate = createObject(u'waeup.Certificate') 257 257 >>> mycertificate 258 <waeup. sirp.university.certificate.Certificate object at 0x...>258 <waeup.kofa.university.certificate.Certificate object at 0x...> 259 259 260 260 CertificateCourses … … 264 264 :class:`ICertificateCourse` interface: 265 265 266 >>> from waeup. sirp.university.interfaces import ICertificateCourse267 >>> from waeup. sirp.university.certificate import CertificateCourse266 >>> from waeup.kofa.university.interfaces import ICertificateCourse 267 >>> from waeup.kofa.university.certificate import CertificateCourse 268 268 >>> mycertcourse = CertificateCourse(None, 200, False) 269 269 >>> ICertificateCourse.providedBy(mycertcourse) … … 280 280 >>> mycertcourse = createObject(u'waeup.CertificateCourse') 281 281 >>> mycertcourse 282 <waeup. sirp.university.certificate.CertificateCourse object at 0x...>282 <waeup.kofa.university.certificate.CertificateCourse object at 0x...> 283 283 284 284 .. _removecertificatecourses: -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.py
r7333 r7811 23 23 from zope.component import queryUtility 24 24 from zope.interface import implementedBy 25 from waeup. sirp.interfaces import DuplicationError26 from waeup. sirp.university.interfaces import (25 from waeup.kofa.interfaces import DuplicationError 26 from waeup.kofa.university.interfaces import ( 27 27 ICertificatesContainer, ICertificate) 28 28 … … 31 31 32 32 A :class:`CertificatesContainer` stores 33 :class:`waeup. sirp.university.Certificate` instances.33 :class:`waeup.kofa.university.Certificate` instances. 34 34 35 35 It is a :class:`grok.Container` basically acting like a standard … … 52 52 53 53 The `certificate` must be an object implementing 54 :class:`waeup. sirp.university.interfaces.ICertificate`. If54 :class:`waeup.kofa.university.interfaces.ICertificate`. If 55 55 not, a :exc:`TypeError` is raised. 56 56 … … 60 60 If the `code` attribute of `certificate` is already in use by 61 61 another certificate stored in the local site 62 (:class:`waeup. sirp.app.University` instance), then a63 :exc:`waeup. sirp.interfaces.DuplicationError` will be raised.62 (:class:`waeup.kofa.app.University` instance), then a 63 :exc:`waeup.kofa.interfaces.DuplicationError` will be raised. 64 64 65 65 If `name` is already used as a key, a :exc:`KeyError` will be … … 92 92 93 93 The certificate must be an object implementing 94 :class:`waeup. sirp.university.interfaces.ICertificate`. If94 :class:`waeup.kofa.university.interfaces.ICertificate`. If 95 95 not, a :exc:`TypeError` is raised. 96 96 … … 98 98 `code` attribute as key. If this key is already used for 99 99 another certificate stored in the local site 100 (:class:`waeup. sirp.app.University` instance), then a101 :exc:`waeup. sirp.interfaces.DuplicationError` will be raised.100 (:class:`waeup.kofa.app.University` instance), then a 101 :exc:`waeup.kofa.interfaces.DuplicationError` will be raised. 102 102 """ 103 103 self[getattr(certificate, 'code', None)] = certificate -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.txt
r7333 r7811 1 :mod:`waeup. sirp.university.certificatescontainer` -- Certificate containers1 :mod:`waeup.kofa.university.certificatescontainer` -- Certificate containers 2 2 **************************************************************************** 3 3 4 .. module:: waeup. sirp.university.certificatescontainer4 .. module:: waeup.kofa.university.certificatescontainer 5 5 6 6 Containers for certificates. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 … … 26 26 :class:`CertificatesContainer` instances are instances of 27 27 :class:`grok.Container` that hold and manage instances of 28 :class:`waeup. sirp.university.certificate.Certificate`.28 :class:`waeup.kofa.university.certificate.Certificate`. 29 29 30 >>> from waeup. sirp.university.certificatescontainer import CertificatesContainer30 >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer 31 31 >>> mycontainer = CertificatesContainer() 32 32 >>> mycontainer 33 <waeup. sirp.university.certificatescontainer.CertificatesContainer object at 0x...>33 <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...> 34 34 35 35 Certificate containers provide `ICertificatesContainer`: 36 36 37 >>> from waeup. sirp.university.interfaces import ICertificatesContainer37 >>> from waeup.kofa.university.interfaces import ICertificatesContainer 38 38 >>> ICertificatesContainer.providedBy(mycontainer) 39 39 True … … 57 57 58 58 *certificate* must be an instance of 59 :class:`waeup. sirp.university.certificate.Certificate`:59 :class:`waeup.kofa.university.certificate.Certificate`: 60 60 61 >>> from waeup. sirp.university.certificatescontainer import (61 >>> from waeup.kofa.university.certificatescontainer import ( 62 62 ... CertificatesContainer) 63 63 >>> mycontainer = CertificatesContainer() … … 69 69 The key of added items is the ``code`` attribute: 70 70 71 >>> from waeup. sirp.university.certificate import Certificate71 >>> from waeup.kofa.university.certificate import Certificate 72 72 >>> mycertificate = Certificate(code='CERTIFICATE1') 73 73 >>> mycontainer.addCertificate(mycertificate) … … 104 104 >>> mycertificatescontainer = createObject(u'waeup.CertificatesContainer') 105 105 >>> mycertificatescontainer 106 <waeup. sirp.university.certificatescontainer.CertificatesContainer object at 0x...>106 <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...> 107 107 108 108 The factory complies with the specifications from the … … 111 111 >>> from zope.interface.verify import verifyClass 112 112 >>> from zope.component.interfaces import IFactory 113 >>> from waeup. sirp.university.certificatescontainer import (113 >>> from waeup.kofa.university.certificatescontainer import ( 114 114 ... CertificatesContainerFactory) 115 115 >>> verifyClass(IFactory, CertificatesContainerFactory) … … 121 121 >>> certificatescontainer_factory = CertificatesContainerFactory() 122 122 >>> certificatescontainer_factory.getInterfaces() 123 <implementedBy waeup. sirp.university.certificatescontainer.CertificatesContainer>123 <implementedBy waeup.kofa.university.certificatescontainer.CertificatesContainer> 124 124 125 125 … … 132 132 We can easily create `CertificatesContainers`: 133 133 134 >>> from waeup. sirp.university.certificatescontainer import CertificatesContainer134 >>> from waeup.kofa.university.certificatescontainer import CertificatesContainer 135 135 >>> mycontainer = CertificatesContainer() 136 136 … … 143 143 >>> from zope.component import createObject 144 144 >>> createObject(u'waeup.CertificatesContainer') 145 <waeup. sirp.university.certificatescontainer.CertificatesContainer object at 0x...>145 <waeup.kofa.university.certificatescontainer.CertificatesContainer object at 0x...> 146 146 147 147 This way we get a thing that implements ICertificatesContainer without -
main/waeup.kofa/trunk/src/waeup/kofa/university/course.py
r7333 r7811 23 23 from zope.component import getUtility 24 24 from zope.component.interfaces import IFactory, ComponentLookupError 25 from waeup. sirp.university.interfaces import ICourse, ICourseAdd25 from waeup.kofa.university.interfaces import ICourse, ICourseAdd 26 26 27 27 class Course(grok.Model): -
main/waeup.kofa/trunk/src/waeup/kofa/university/course.txt
r7321 r7811 1 :mod:`waeup. sirp.university.course` -- Courses1 :mod:`waeup.kofa.university.course` -- Courses 2 2 ********************************************** 3 3 4 .. module:: waeup. sirp.university.course4 .. module:: waeup.kofa.university.course 5 5 6 6 Components that represent courses. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 Content Classes (models and containers) … … 23 23 All parameters are optional: 24 24 25 >>> from waeup. sirp.university.course import Course25 >>> from waeup.kofa.university.course import Course 26 26 >>> mycourse = Course() 27 27 >>> mycourse 28 <waeup. sirp.university.course.Course object at 0x...>28 <waeup.kofa.university.course.Course object at 0x...> 29 29 30 30 Course instances have the attributes required by the 31 :class:`waeup. sirp.interfaces.ICourse` interface:31 :class:`waeup.kofa.interfaces.ICourse` interface: 32 32 33 >>> from waeup. sirp.university.interfaces import ICourse33 >>> from waeup.kofa.university.interfaces import ICourse 34 34 >>> ICourse.providedBy(mycourse) 35 35 True … … 101 101 >>> mycourse = createObject(u'waeup.Course') 102 102 >>> mycourse 103 <waeup. sirp.university.course.Course object at 0x...>103 <waeup.kofa.university.course.Course object at 0x...> 104 104 105 105 The factory complies with the specifications from the … … 108 108 >>> from zope.interface.verify import verifyClass 109 109 >>> from zope.component.interfaces import IFactory 110 >>> from waeup. sirp.university.course import CourseFactory110 >>> from waeup.kofa.university.course import CourseFactory 111 111 >>> verifyClass(IFactory, CourseFactory) 112 112 True … … 117 117 >>> course_factory = CourseFactory() 118 118 >>> course_factory.getInterfaces() 119 <implementedBy waeup. sirp.university.course.Course>119 <implementedBy waeup.kofa.university.course.Course> 120 120 121 121 Examples … … 128 128 class and calling the constructor: 129 129 130 >>> from waeup. sirp.university.course import Course130 >>> from waeup.kofa.university.course import Course 131 131 >>> mycourse = Course() 132 132 >>> mycourse 133 <waeup. sirp.university.course.Course object at 0x...>133 <waeup.kofa.university.course.Course object at 0x...> 134 134 135 135 Another way to create courses is by asking for a factory called … … 140 140 >>> mycourse = createObject(u'waeup.Course') 141 141 >>> mycourse 142 <waeup. sirp.university.course.Course object at 0x...>142 <waeup.kofa.university.course.Course object at 0x...> 143 143 -
main/waeup.kofa/trunk/src/waeup/kofa/university/courserefs.txt
r6737 r7811 16 16 As correct deletion of referrer needs support of catalogs (we lookup 17 17 catalogs to find referrers), we need a fully blown ZODB here, 18 including an instance of :class:`waeup. sirp.app.University`, as this is our18 including an instance of :class:`waeup.kofa.app.University`, as this is our 19 19 `ISite` object where the catalogs are stored. 20 20 … … 23 23 and course certificates: 24 24 25 >>> from waeup. sirp.app import University25 >>> from waeup.kofa.app import University 26 26 >>> root = getRootFolder() 27 27 >>> root['app'] = University() -
main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.py
r7333 r7811 23 23 from zope.catalog.interfaces import ICatalog 24 24 from zope.component import queryUtility 25 from waeup. sirp.interfaces import DuplicationError26 from waeup. sirp.university.interfaces import ICoursesContainer, ICourse25 from waeup.kofa.interfaces import DuplicationError 26 from waeup.kofa.university.interfaces import ICoursesContainer, ICourse 27 27 28 28 class CoursesContainer(grok.Container): -
main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.txt
r7333 r7811 1 :mod:`waeup. sirp.university.coursescontainer` -- Course containers1 :mod:`waeup.kofa.university.coursescontainer` -- Course containers 2 2 ****************************************************************** 3 3 4 .. module:: waeup. sirp.university.coursescontainer4 .. module:: waeup.kofa.university.coursescontainer 5 5 6 6 Containers for courses. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 … … 26 26 :class:`CoursesContainer` instances are instances of 27 27 :class:`grok.Container` that hold and manage instances of 28 :class:`waeup. sirp.university.course.Course`.28 :class:`waeup.kofa.university.course.Course`. 29 29 30 >>> from waeup. sirp.university.coursescontainer import CoursesContainer30 >>> from waeup.kofa.university.coursescontainer import CoursesContainer 31 31 >>> mycontainer = CoursesContainer() 32 32 >>> mycontainer 33 <waeup. sirp.university.coursescontainer.CoursesContainer object at 0x...>33 <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...> 34 34 35 35 Course containers provide `ICoursesContainer`: 36 36 37 >>> from waeup. sirp.university.interfaces import ICoursesContainer37 >>> from waeup.kofa.university.interfaces import ICoursesContainer 38 38 >>> ICoursesContainer.providedBy(mycontainer) 39 39 True … … 57 57 58 58 *course* must be an instance of 59 :class:`waeup. sirp.university.course.Course`:59 :class:`waeup.kofa.university.course.Course`: 60 60 61 >>> from waeup. sirp.university.coursescontainer import CoursesContainer61 >>> from waeup.kofa.university.coursescontainer import CoursesContainer 62 62 >>> mycontainer = CoursesContainer() 63 63 >>> mycontainer.addCourse('blah') … … 68 68 The key of added items is the ``code`` attribute: 69 69 70 >>> from waeup. sirp.university.course import Course70 >>> from waeup.kofa.university.course import Course 71 71 >>> mycourse = Course(code='COURSE1') 72 72 >>> mycontainer.addCourse(mycourse) … … 103 103 >>> mycoursescontainer = createObject(u'waeup.CoursesContainer') 104 104 >>> mycoursescontainer 105 <waeup. sirp.university.coursescontainer.CoursesContainer object at 0x...>105 <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...> 106 106 107 107 The factory complies with the specifications from the … … 110 110 >>> from zope.interface.verify import verifyClass 111 111 >>> from zope.component.interfaces import IFactory 112 >>> from waeup. sirp.university.coursescontainer import CoursesContainerFactory112 >>> from waeup.kofa.university.coursescontainer import CoursesContainerFactory 113 113 >>> verifyClass(IFactory, CoursesContainerFactory) 114 114 True … … 119 119 >>> coursescontainer_factory = CoursesContainerFactory() 120 120 >>> coursescontainer_factory.getInterfaces() 121 <implementedBy waeup. sirp.university.coursescontainer.CoursesContainer>121 <implementedBy waeup.kofa.university.coursescontainer.CoursesContainer> 122 122 123 123 … … 130 130 We can easily create `CoursesContainers`: 131 131 132 >>> from waeup. sirp.university.coursescontainer import CoursesContainer132 >>> from waeup.kofa.university.coursescontainer import CoursesContainer 133 133 >>> mycontainer = CoursesContainer() 134 134 … … 141 141 >>> from zope.component import createObject 142 142 >>> createObject(u'waeup.CoursesContainer') 143 <waeup. sirp.university.coursescontainer.CoursesContainer object at 0x...>143 <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...> 144 144 145 145 This way we get a thing that implements ICoursesContainer without -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r7733 r7811 22 22 from zope.interface import implementedBy 23 23 from zope.component import getUtility 24 from waeup. sirp.university.coursescontainer import CoursesContainer25 from waeup. sirp.university.certificatescontainer import CertificatesContainer26 from waeup. sirp.interfaces import ISIRPUtils27 from waeup. sirp.university.interfaces import IDepartment, IDepartmentAdd24 from waeup.kofa.university.coursescontainer import CoursesContainer 25 from waeup.kofa.university.certificatescontainer import CertificatesContainer 26 from waeup.kofa.interfaces import IKOFAUtils 27 from waeup.kofa.university.interfaces import IDepartment, IDepartmentAdd 28 28 29 29 class Department(grok.Container): … … 73 73 74 74 def longtitle(self): 75 insttypes_dict = getUtility(I SIRPUtils).getInstTypeDict()75 insttypes_dict = getUtility(IKOFAUtils).getInstTypeDict() 76 76 return "%s %s (%s)" % ( 77 77 insttypes_dict[self.title_prefix], -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.txt
r7333 r7811 1 :mod:`waeup. sirp.university.department` -- Departments1 :mod:`waeup.kofa.university.department` -- Departments 2 2 ****************************************************** 3 3 4 .. module:: waeup. sirp.university.department4 .. module:: waeup.kofa.university.department 5 5 6 6 Components that represent university departments. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 Content Classes (models and containers) … … 20 20 Create a representation of a university department: 21 21 22 >>> from waeup. sirp.university.department import Department22 >>> from waeup.kofa.university.department import Department 23 23 >>> mydept = Department() 24 24 >>> mydept 25 <waeup. sirp.university.department.Department object at 0x...>25 <waeup.kofa.university.department.Department object at 0x...> 26 26 27 27 Another way to create :class:`Department` instances is by asking 28 for a factory called ``waeup. sirp.Department``. This way we can create a28 for a factory called ``waeup.kofa.Department``. This way we can create a 29 29 department without importing a class: 30 30 … … 32 32 >>> mydept = createObject(u'waeup.Department') 33 33 >>> mydept 34 <waeup. sirp.university.department.Department object at 0x...>34 <waeup.kofa.university.department.Department object at 0x...> 35 35 36 36 :class:`Department` instances have the attributes required by the 37 37 `IDepartment` interface: 38 38 39 >>> from waeup. sirp.university.interfaces import IDepartment39 >>> from waeup.kofa.university.interfaces import IDepartment 40 40 >>> IDepartment.providedBy(mydept) 41 41 True … … 86 86 87 87 >>> mydept.courses 88 <waeup. sirp.university.coursescontainer.CoursesContainer object at 0x...>88 <waeup.kofa.university.coursescontainer.CoursesContainer object at 0x...> 89 89 90 90 … … 97 97 98 98 >>> mydept.certificates 99 <waeup. sirp...certificatescontainer.CertificatesContainer object at 0x...>99 <waeup.kofa...certificatescontainer.CertificatesContainer object at 0x...> 100 100 101 101 Utilities … … 117 117 >>> mydepartment = createObject(u'waeup.Department') 118 118 >>> mydepartment 119 <waeup. sirp.university.department.Department object at 0x...>119 <waeup.kofa.university.department.Department object at 0x...> 120 120 121 121 The factory complies with the specifications from the … … 124 124 >>> from zope.interface.verify import verifyClass 125 125 >>> from zope.component.interfaces import IFactory 126 >>> from waeup. sirp.university.department import DepartmentFactory126 >>> from waeup.kofa.university.department import DepartmentFactory 127 127 >>> verifyClass(IFactory, DepartmentFactory) 128 128 True … … 133 133 >>> department_factory = DepartmentFactory() 134 134 >>> department_factory.getInterfaces() 135 <implementedBy waeup. sirp.university.department.Department>135 <implementedBy waeup.kofa.university.department.Department> -
main/waeup.kofa/trunk/src/waeup/kofa/university/export.py
r7757 r7811 21 21 import grok 22 22 from cStringIO import StringIO 23 from waeup. sirp.interfaces import ICSVExporter23 from waeup.kofa.interfaces import ICSVExporter 24 24 25 25 class FacultyExporter(grok.GlobalUtility): -
main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.py
r7725 r7811 19 19 from zope.component.interfaces import IFactory 20 20 from zope.interface import implementedBy 21 from waeup. sirp.interfaces import ISIRPPluggable22 from waeup. sirp.university.interfaces import IFacultiesContainer, IFaculty21 from waeup.kofa.interfaces import IKOFAPluggable 22 from waeup.kofa.university.interfaces import IFacultiesContainer, IFaculty 23 23 24 24 class FacultiesContainer(grok.Container): … … 52 52 """A plugin that creates container for faculties inside a university. 53 53 """ 54 grok.implements(I SIRPPluggable)54 grok.implements(IKOFAPluggable) 55 55 grok.name('faculties') 56 56 57 57 def setup(self, site, name, logger): 58 58 if 'faculties' in site.keys(): 59 logger.warn('Could not create container for faculties in SIRP.')59 logger.warn('Could not create container for faculties in KOFA.') 60 60 return 61 61 site['faculties'] = FacultiesContainer() -
main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.txt
r7333 r7811 1 :mod:`waeup. sirp.university.facultiescontainer` -- Faculty Containers1 :mod:`waeup.kofa.university.facultiescontainer` -- Faculty Containers 2 2 ********************************************************************* 3 3 4 .. module:: waeup. sirp.university.facultiescontainer4 .. module:: waeup.kofa.university.facultiescontainer 5 5 6 6 Components that represent faculty containers. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 … … 20 20 Create a faculty container: 21 21 22 >>> from waeup. sirp.university.facultiescontainer import FacultiesContainer22 >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer 23 23 >>> mycontainer = FacultiesContainer() 24 24 >>> mycontainer 25 <waeup. sirp.university.facultiescontainer.FacultiesContainer object at 0x...>25 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 26 26 27 27 Another way to create :class:`FacultiesContainer` instances is by asking … … 32 32 >>> mycontainer = createObject(u'waeup.FacultiesContainer') 33 33 >>> mycontainer 34 <waeup. sirp.university.facultiescontainer.FacultiesContainer object at 0x...>34 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 35 35 36 36 :class:`FacultiesContainer` instances have the attributes required by the 37 37 `IFacultiesContainer` interface: 38 38 39 >>> from waeup. sirp.university.interfaces import IFacultiesContainer39 >>> from waeup.kofa.university.interfaces import IFacultiesContainer 40 40 >>> IFacultiesContainer.providedBy(mycontainer) 41 41 True … … 60 60 Regular faculties are accepted: 61 61 62 >>> from waeup. sirp.university.faculty import Faculty62 >>> from waeup.kofa.university.faculty import Faculty 63 63 >>> mycontainer.addFaculty(Faculty(title='Physics', 64 64 ... code='FP')) 65 65 66 66 >>> list(mycontainer.items()) 67 [(u'FP', <waeup. sirp.university.faculty.Faculty object at 0x...>)]67 [(u'FP', <waeup.kofa.university.faculty.Faculty object at 0x...>)] 68 68 69 69 … … 77 77 .. class:: AcademicsPlugin() 78 78 79 .. attribute:: grok.implements(I SIRPPluggable)79 .. attribute:: grok.implements(IKOFAPluggable) 80 80 81 81 This plugin component tells under which name (``faculties``) an 82 instance of academics stuff should be created in plain SIRP82 instance of academics stuff should be created in plain KOFA 83 83 instances. It also tells the factory name for FacultiesContainer 84 instances, which serve as root object for academics stuff in SIRPapps.84 instances, which serve as root object for academics stuff in KOFA apps. 85 85 86 86 … … 100 100 >>> mycontainer = createObject(u'waeup.FacultiesContainer') 101 101 >>> mycontainer 102 <waeup. sirp.university.facultiescontainer.FacultiesContainer object at 0x...>102 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 103 103 104 104 The factory complies with the specifications from the … … 107 107 >>> from zope.interface.verify import verifyClass 108 108 >>> from zope.component.interfaces import IFactory 109 >>> from waeup. sirp.university.facultiescontainer import (109 >>> from waeup.kofa.university.facultiescontainer import ( 110 110 ... FacultiesContainerFactory) 111 111 >>> verifyClass(IFactory, FacultiesContainerFactory) … … 117 117 >>> fac_container_factory = FacultiesContainerFactory() 118 118 >>> fac_container_factory.getInterfaces() 119 <implementedBy waeup. sirp.university.facultiescontainer.FacultiesContainer>119 <implementedBy waeup.kofa.university.facultiescontainer.FacultiesContainer> 120 120 121 121 Examples … … 124 124 We can easily create `FacultiesContainers`: 125 125 126 >>> from waeup. sirp.university.facultiescontainer import FacultiesContainer126 >>> from waeup.kofa.university.facultiescontainer import FacultiesContainer 127 127 >>> mycontainer = FacultiesContainer() 128 128 129 129 Faculty containers provide `IFacultiesContainer`: 130 130 131 >>> from waeup. sirp.university.interfaces import IFacultiesContainer131 >>> from waeup.kofa.university.interfaces import IFacultiesContainer 132 132 >>> IFacultiesContainer.providedBy(mycontainer) 133 133 True … … 139 139 >>> from zope.component import createObject 140 140 >>> createObject(u'waeup.FacultiesContainer') 141 <waeup. sirp.university.facultiescontainer.FacultiesContainer object at 0x...>141 <waeup.kofa.university.facultiescontainer.FacultiesContainer object at 0x...> 142 142 143 143 This way we get a thing that implements IFacultiesContainer without … … 165 165 Okay, so we have to get a faculty first:: 166 166 167 >>> from waeup. sirp.university.faculty import Faculty167 >>> from waeup.kofa.university.faculty import Faculty 168 168 >>> myfaculty = Faculty() 169 169 -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py
r7729 r7811 23 23 from zope.interface import implementedBy 24 24 from zope.component import getUtility 25 from waeup. sirp.interfaces import ISIRPUtils26 from waeup. sirp.university.interfaces import (25 from waeup.kofa.interfaces import IKOFAUtils 26 from waeup.kofa.university.interfaces import ( 27 27 IFaculty, IFacultyAdd, IDepartment) 28 28 … … 61 61 62 62 def longtitle(self): 63 insttypes_dict = getUtility(I SIRPUtils).getInstTypeDict()63 insttypes_dict = getUtility(IKOFAUtils).getInstTypeDict() 64 64 result = "%s %s (%s)" % ( 65 65 insttypes_dict[self.title_prefix], -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.txt
r7321 r7811 1 :mod:`waeup. sirp.university.faculty` -- Faculties1 :mod:`waeup.kofa.university.faculty` -- Faculties 2 2 ************************************************* 3 3 4 .. module:: waeup. sirp.university.faculty4 .. module:: waeup.kofa.university.faculty 5 5 6 6 Components that represent university faculties. 7 7 8 8 .. :doctest: 9 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer9 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 10 10 11 11 … … 21 21 Create a representation of a university faculty: 22 22 23 >>> from waeup. sirp.university.faculty import Faculty23 >>> from waeup.kofa.university.faculty import Faculty 24 24 >>> myfac = Faculty() 25 25 >>> myfac 26 <waeup. sirp.university.faculty.Faculty object at 0x...>26 <waeup.kofa.university.faculty.Faculty object at 0x...> 27 27 28 28 Another way to create :class:`Faculty` instances is by asking … … 33 33 >>> myfac = createObject(u'waeup.Faculty') 34 34 >>> myfac 35 <waeup. sirp.university.faculty.Faculty object at 0x...>35 <waeup.kofa.university.faculty.Faculty object at 0x...> 36 36 37 37 :class:`Faculty` instances have the attributes required by the 38 38 `IFaculty` interface: 39 39 40 >>> from waeup. sirp.university.interfaces import IFaculty40 >>> from waeup.kofa.university.interfaces import IFaculty 41 41 >>> IFaculty.providedBy(myfac) 42 42 True … … 62 62 Regular departments are accepted: 63 63 64 >>> from waeup. sirp.university.department import Department64 >>> from waeup.kofa.university.department import Department 65 65 >>> myfac.addDepartment(Department(title='Physics', 66 66 ... code='DP')) 67 67 68 68 >>> list(myfac.items()) 69 [(u'DP', <waeup. sirp.university.department.Department object at 0x...>)]69 [(u'DP', <waeup.kofa.university.department.Department object at 0x...>)] 70 70 71 71 … … 121 121 >>> myfaculty = createObject(u'waeup.Faculty') 122 122 >>> myfaculty 123 <waeup. sirp.university.faculty.Faculty object at 0x...>123 <waeup.kofa.university.faculty.Faculty object at 0x...> 124 124 125 125 The factory complies with the specifications from the … … 128 128 >>> from zope.interface.verify import verifyClass 129 129 >>> from zope.component.interfaces import IFactory 130 >>> from waeup. sirp.university.faculty import FacultyFactory130 >>> from waeup.kofa.university.faculty import FacultyFactory 131 131 >>> verifyClass(IFactory, FacultyFactory) 132 132 True … … 137 137 >>> faculty_factory = FacultyFactory() 138 138 >>> faculty_factory.getInterfaces() 139 <implementedBy waeup. sirp.university.faculty.Faculty>139 <implementedBy waeup.kofa.university.faculty.Faculty> 140 140 141 141 … … 145 145 We can create faculties: 146 146 147 >>> from waeup. sirp.university.faculty import Faculty147 >>> from waeup.kofa.university.faculty import Faculty 148 148 >>> myfaculty = Faculty() 149 149 >>> myfaculty 150 <waeup. sirp.university.faculty.Faculty object at 0x...>150 <waeup.kofa.university.faculty.Faculty object at 0x...> 151 151 152 152 Another way to create faculties is by asking for a factory called … … 157 157 >>> myfaculty = createObject(u'waeup.Faculty') 158 158 >>> myfaculty 159 <waeup. sirp.university.faculty.Faculty object at 0x...>159 <waeup.kofa.university.faculty.Faculty object at 0x...> 160 160 161 161 Faculty attributes … … 164 164 Faculties have the attributes required by the `IFaculty` interface: 165 165 166 >>> from waeup. sirp.university.interfaces import IFaculty166 >>> from waeup.kofa.university.interfaces import IFaculty 167 167 >>> IFaculty.providedBy(myfaculty) 168 168 True -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r7707 r7811 21 21 from zope import schema 22 22 from zope.interface import Attribute 23 from waeup. sirp.interfaces import (ISIRPObject, ISIRPContainer)24 from waeup. sirp.interfaces import MessageFactory as _25 from waeup. sirp.university.vocabularies import (23 from waeup.kofa.interfaces import (IKOFAObject, IKOFAContainer) 24 from waeup.kofa.interfaces import MessageFactory as _ 25 from waeup.kofa.university.vocabularies import ( 26 26 course_levels, 27 27 CourseSource, … … 32 32 ) 33 33 34 class IFaculty(I SIRPContainer):34 class IFaculty(IKOFAContainer): 35 35 """Representation of a university faculty. 36 36 """ … … 73 73 IFacultyAdd['code'].order = IFaculty['code'].order 74 74 75 class IFacultiesContainer(I SIRPContainer):75 class IFacultiesContainer(IKOFAContainer): 76 76 """A container for faculties. 77 77 """ … … 80 80 81 81 """ 82 class IDepartment(I SIRPObject):82 class IDepartment(IKOFAObject): 83 83 """Representation of a department. 84 84 """ … … 124 124 IDepartmentAdd['code'].order = IDepartment['code'].order 125 125 126 class ICoursesContainer(I SIRPContainer):126 class ICoursesContainer(IKOFAContainer): 127 127 """A container for faculties. 128 128 """ … … 133 133 """ 134 134 135 class ICourse(I SIRPObject):135 class ICourse(IKOFAObject): 136 136 """Representation of a course. 137 137 """ … … 186 186 ICourseAdd['code'].order = ICourse['code'].order 187 187 188 class ICertificate(I SIRPObject):188 class ICertificate(IKOFAObject): 189 189 """Representation of a certificate. 190 190 """ … … 248 248 ICertificateAdd['code'].order = ICertificate['code'].order 249 249 250 class ICertificatesContainer(I SIRPContainer):250 class ICertificatesContainer(IKOFAContainer): 251 251 """A container for certificates. 252 252 """ … … 257 257 """ 258 258 259 class ICertificateCourse(I SIRPObject):259 class ICertificateCourse(IKOFAObject): 260 260 """A certificatecourse is referring a course and provides some own 261 261 attributes. -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_batching.py
r7195 r7811 21 21 22 22 from zope.interface.verify import verifyClass, verifyObject 23 from waeup. sirp.interfaces import IBatchProcessor24 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer25 from waeup. sirp.university.batching import (23 from waeup.kofa.interfaces import IBatchProcessor 24 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 25 from waeup.kofa.university.batching import ( 26 26 FacultyProcessor, DepartmentProcessor, CourseProcessor, 27 27 CertificateProcessor, CertificateCourseProcessor) 28 from waeup. sirp.university.certificate import Certificate, CertificateCourse29 from waeup. sirp.university.course import Course30 from waeup. sirp.university.department import Department28 from waeup.kofa.university.certificate import Certificate, CertificateCourse 29 from waeup.kofa.university.course import Course 30 from waeup.kofa.university.department import Department 31 31 32 32 -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_certificatescontainer.py
r7333 r7811 25 25 from zope.interface.verify import verifyClass, verifyObject 26 26 27 from waeup. sirp.app import University28 from waeup. sirp.interfaces import DuplicationError29 from waeup. sirp.testing import (27 from waeup.kofa.app import University 28 from waeup.kofa.interfaces import DuplicationError 29 from waeup.kofa.testing import ( 30 30 FunctionalLayer, doctestsuite_for_module, FunctionalTestCase) 31 from waeup. sirp.university.certificate import Certificate32 from waeup. sirp.university.certificatescontainer import CertificatesContainer33 from waeup. sirp.university.interfaces import ICertificatesContainer31 from waeup.kofa.university.certificate import Certificate 32 from waeup.kofa.university.certificatescontainer import CertificatesContainer 33 from waeup.kofa.university.interfaces import ICertificatesContainer 34 34 35 35 … … 132 132 unittest.makeSuite(CertificatesContainerTests), 133 133 doctestsuite_for_module( 134 'waeup. sirp.university.certificatescontainer'),134 'waeup.kofa.university.certificatescontainer'), 135 135 )) 136 136 return suite -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_coursescontainer.py
r7333 r7811 21 21 import unittest 22 22 from zope.interface.verify import verifyClass, verifyObject 23 from waeup. sirp.university.interfaces import ICoursesContainer24 from waeup. sirp.university import CoursesContainer, Course23 from waeup.kofa.university.interfaces import ICoursesContainer 24 from waeup.kofa.university import CoursesContainer, Course 25 25 26 26 class CoursesContainerTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_export.py
r7757 r7811 22 22 from zope.component import queryUtility 23 23 from zope.interface.verify import verifyObject, verifyClass 24 from waeup. sirp.interfaces import ICSVExporter25 from waeup. sirp.testing import SIRPUnitTestLayer26 from waeup. sirp.university import (24 from waeup.kofa.interfaces import ICSVExporter 25 from waeup.kofa.testing import KOFAUnitTestLayer 26 from waeup.kofa.university import ( 27 27 FacultiesContainer, Faculty, Department, Course, Certificate, 28 28 ) 29 from waeup. sirp.university.export import (29 from waeup.kofa.university.export import ( 30 30 FacultyExporter, DepartmentExporter, CourseExporter, 31 31 CertificateExporter, CertificateCourseExporter, … … 34 34 class FacultyExporterTest(unittest.TestCase): 35 35 36 layer = SIRPUnitTestLayer36 layer = KOFAUnitTestLayer 37 37 38 38 def setUp(self): … … 123 123 # Tests for DepartmentExporter 124 124 125 layer = SIRPUnitTestLayer125 layer = KOFAUnitTestLayer 126 126 127 127 def setUp(self): … … 214 214 # Tests for CourseExporter 215 215 216 layer = SIRPUnitTestLayer216 layer = KOFAUnitTestLayer 217 217 218 218 def setUp(self): … … 307 307 # Tests for CertificateExporter 308 308 309 layer = SIRPUnitTestLayer309 layer = KOFAUnitTestLayer 310 310 311 311 def setUp(self): … … 412 412 # Tests for CertificateCourseExporter 413 413 414 layer = SIRPUnitTestLayer414 layer = KOFAUnitTestLayer 415 415 416 416 def setUp(self): -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_facultiescontainer.py
r7333 r7811 22 22 from StringIO import StringIO 23 23 from zope.interface.verify import verifyObject, verifyClass 24 from waeup. sirp.testing import FunctionalTestCase, FunctionalLayer25 from waeup. sirp.university.interfaces import IFacultiesContainer26 from waeup. sirp.university import FacultiesContainer27 from waeup. sirp.university.facultiescontainer import AcademicsPlugin24 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 25 from waeup.kofa.university.interfaces import IFacultiesContainer 26 from waeup.kofa.university import FacultiesContainer 27 from waeup.kofa.university.facultiescontainer import AcademicsPlugin 28 28 29 29 class FakeLogger(object): … … 90 90 self.assertEqual( 91 91 self._logger_factory.get_messages(), 92 'Could not create container for faculties in SIRP.\n'92 'Could not create container for faculties in KOFA.\n' 93 93 ) 94 94 -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_faculty.py
r7681 r7811 22 22 import unittest 23 23 from zope.interface.verify import verifyObject, verifyClass 24 from waeup. sirp.university import Faculty, Department25 from waeup. sirp.university.interfaces import IFaculty, IDepartment24 from waeup.kofa.university import Faculty, Department 25 from waeup.kofa.university.interfaces import IFaculty, IDepartment 26 26 27 27 class FacultyAndDepartmentTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_university.py
r7333 r7811 19 19 # Test the public API part of the university subpackage 20 20 import unittest 21 from waeup. sirp.university import *22 from waeup. sirp.testing import get_doctest_suite21 from waeup.kofa.university import * 22 from waeup.kofa.testing import get_doctest_suite 23 23 24 24 class UniversitySubpackageTests(unittest.TestCase): -
main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py
r7688 r7811 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zope.component import getUtility 24 from waeup. sirp.interfaces import SimpleSIRPVocabulary, ISIRPUtils25 from waeup. sirp.interfaces import MessageFactory as _24 from waeup.kofa.interfaces import SimpleKOFAVocabulary, IKOFAUtils 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 27 course_levels = Simple SIRPVocabulary(27 course_levels = SimpleKOFAVocabulary( 28 28 (_('Pre-Studies'),10), 29 29 (_('100 (Year 1)'),100), … … 41 41 """ 42 42 def getValues(self, context): 43 semesters_dict = getUtility(I SIRPUtils).getSemesterDict()43 semesters_dict = getUtility(IKOFAUtils).getSemesterDict() 44 44 return semesters_dict.keys() 45 45 … … 48 48 49 49 def getTitle(self, context, value): 50 semesters_dict = getUtility(I SIRPUtils).getSemesterDict()50 semesters_dict = getUtility(IKOFAUtils).getSemesterDict() 51 51 return semesters_dict[value] 52 52 … … 56 56 """ 57 57 def getValues(self, context): 58 insttypes_dict = getUtility(I SIRPUtils).getInstTypeDict()58 insttypes_dict = getUtility(IKOFAUtils).getInstTypeDict() 59 59 return sorted(insttypes_dict.keys()) 60 60 … … 63 63 64 64 def getTitle(self, context, value): 65 insttypes_dict = getUtility(I SIRPUtils).getInstTypeDict()65 insttypes_dict = getUtility(IKOFAUtils).getInstTypeDict() 66 66 return insttypes_dict[value] 67 67 … … 71 71 """ 72 72 def getValues(self, context): 73 appcats_dict = getUtility(I SIRPUtils).getAppCatDict()73 appcats_dict = getUtility(IKOFAUtils).getAppCatDict() 74 74 return sorted(appcats_dict.keys()) 75 75 … … 78 78 79 79 def getTitle(self, context, value): 80 appcats_dict = getUtility(I SIRPUtils).getAppCatDict()80 appcats_dict = getUtility(IKOFAUtils).getAppCatDict() 81 81 return appcats_dict[value] 82 82 … … 86 86 """ 87 87 def getValues(self, context): 88 studymodes_dict = getUtility(I SIRPUtils).getStudyModesDict()88 studymodes_dict = getUtility(IKOFAUtils).getStudyModesDict() 89 89 return sorted(studymodes_dict.keys()) 90 90 … … 93 93 94 94 def getTitle(self, context, value): 95 studymodes_dict = getUtility(I SIRPUtils).getStudyModesDict()95 studymodes_dict = getUtility(IKOFAUtils).getStudyModesDict() 96 96 return studymodes_dict[value] 97 97 -
main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.py
r7653 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Users container for the SIRPportal.18 """Users container for the KOFA portal. 19 19 """ 20 20 import grok 21 21 from zope.event import notify 22 from waeup. sirp.authentication import Account23 from waeup. sirp.interfaces import IUsersContainer24 from waeup. sirp.utils.logger import Logger22 from waeup.kofa.authentication import Account 23 from waeup.kofa.interfaces import IUsersContainer 24 from waeup.kofa.utils.logger import Logger 25 25 26 26 class UsersContainer(grok.Container, Logger): -
main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt
r7321 r7811 1 User container for the SIRP1 User container for the KOFA 2 2 *************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer5 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 6 6 7 7 Before we can start, we need some password managers available: … … 14 14 us: 15 15 16 >>> from waeup. sirp.userscontainer import UsersContainer16 >>> from waeup.kofa.userscontainer import UsersContainer 17 17 >>> myusers = UsersContainer() 18 18 … … 31 31 >>> bob = myusers['bob'] 32 32 >>> bob 33 <waeup. sirp.authentication.Account object at 0x...>33 <waeup.kofa.authentication.Account object at 0x...> 34 34 35 35 >>> bob.name -
main/waeup.kofa/trunk/src/waeup/kofa/utils/api.txt
r4973 r7811 1 :mod:`waeup. sirp.utils` -- misc. helpers1 :mod:`waeup.kofa.utils` -- misc. helpers 2 2 **************************************** 3 3 4 .. module:: waeup. sirp.utils4 .. module:: waeup.kofa.utils 5 5 6 6 Components and other stuff of general interest. … … 9 9 ========== 10 10 11 The :mod:`waeup. sirp.utils` module provides the following submodules:11 The :mod:`waeup.kofa.utils` module provides the following submodules: 12 12 13 13 .. toctree:: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r7649 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ SIRPcomponents for batch processing.18 """KOFA components for batch processing. 19 19 20 20 Batch processors eat CSV files to add, update or remove large numbers … … 31 31 from zope.interface import Interface 32 32 from zope.schema import getFields 33 from waeup. sirp.interfaces import (33 from waeup.kofa.interfaces import ( 34 34 IBatchProcessor, FatalCSVError, DuplicationError, IObjectConverter) 35 35 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.txt
r6824 r7811 1 :mod:`waeup. sirp.utils.batching` -- Batch processing1 :mod:`waeup.kofa.utils.batching` -- Batch processing 2 2 **************************************************** 3 3 … … 188 188 All we need, is a batch processor now. 189 189 190 >>> from waeup. sirp.utils.batching import BatchProcessor190 >>> from waeup.kofa.utils.batching import BatchProcessor 191 191 >>> class CaveProcessor(BatchProcessor): 192 192 ... util_name = 'caveprocessor' -
main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.py
r7709 r7811 27 27 from zope.interface import Interface 28 28 from zope.publisher.browser import TestRequest 29 from waeup. sirp.interfaces import IObjectConverter29 from waeup.kofa.interfaces import IObjectConverter 30 30 31 31 class ExtendedCheckBoxWidget(CheckBoxWidget): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.txt
r7321 r7811 1 :mod:`waeup. sirp.utils.converters` -- Converters1 :mod:`waeup.kofa.utils.converters` -- Converters 2 2 ************************************************ 3 3 4 .. module:: waeup. sirp.utils.converters4 .. module:: waeup.kofa.utils.converters 5 5 6 6 Converters for :mod:`zope.schema` based data. … … 10 10 11 11 .. :NOdoctest: 12 .. :NOlayer: waeup. sirp.testing.SIRPUnitTestLayer12 .. :NOlayer: waeup.kofa.testing.KOFAUnitTestLayer 13 13 14 14 … … 21 21 'non-values'. Current setting is: 22 22 23 >>> from waeup. sirp.utils.converters import NONE_STRING_VALUE23 >>> from waeup.kofa.utils.converters import NONE_STRING_VALUE 24 24 >>> NONE_STRING_VALUE 25 25 '' … … 32 32 ======== 33 33 34 The :mod:`waeup. sirp.utils.converters` module is basically a collection of34 The :mod:`waeup.kofa.utils.converters` module is basically a collection of 35 35 adapters for field types of :mod:`zope.schema`. 36 36 … … 48 48 `zope.schema.Choice` or similar. 49 49 50 .. method:: provides(waeup. sirp.interfaces.ISchemaTypeConverter)50 .. method:: provides(waeup.kofa.interfaces.ISchemaTypeConverter) 51 51 52 52 .. method:: _convertValueFromString(string) … … 111 111 .. method:: adapts(zope.schema.IText) 112 112 113 .. method:: provides(waeup. sirp.interfaces.ISchemaTypeConverter)113 .. method:: provides(waeup.kofa.interfaces.ISchemaTypeConverter) 114 114 115 115 .. method:: fromString(string[, strict=True]) … … 150 150 .. method:: adapts(zope.schema.IBool) 151 151 152 .. method:: provides(waeup. sirp.interfaces.ISchemaTypeConverter)152 .. method:: provides(waeup.kofa.interfaces.ISchemaTypeConverter) 153 153 154 154 .. method:: fromString(string[, strict=True]) … … 191 191 .. method:: adapts(zope.schema.IInt) 192 192 193 .. method:: provides(waeup. sirp.interfaces.ISchemaTypeConverter)193 .. method:: provides(waeup.kofa.interfaces.ISchemaTypeConverter) 194 194 195 195 .. method:: fromString(string[, strict=True]) … … 232 232 .. method:: adapts(zope.schema.IChoice) 233 233 234 .. method:: provides(waeup. sirp.interfaces.ISchemaTypeConverter)234 .. method:: provides(waeup.kofa.interfaces.ISchemaTypeConverter) 235 235 236 236 .. method:: fromString(string[, strict=False]) … … 272 272 ---------------------- 273 273 274 .. autoclass:: waeup. sirp.utils.converters.DateConverter274 .. autoclass:: waeup.kofa.utils.converters.DateConverter 275 275 :members: 276 276 :inherited-members: … … 294 294 :class:`TextConverter` instance: 295 295 296 >>> from waeup. sirp.utils.converters import TextConverter296 >>> from waeup.kofa.utils.converters import TextConverter 297 297 >>> converter = TextConverter(field) 298 298 299 299 Or we can just grab a registered adapter: 300 300 301 >>> from waeup. sirp.interfaces import ISchemaTypeConverter301 >>> from waeup.kofa.interfaces import ISchemaTypeConverter 302 302 >>> converter = ISchemaTypeConverter(field) 303 303 … … 305 305 306 306 >>> converter 307 <waeup. sirp.utils.converters.TextConverter object at 0x...>307 <waeup.kofa.utils.converters.TextConverter object at 0x...> 308 308 309 309 Now we can convert strings to this type: … … 382 382 :class:`BoolConverter` instance: 383 383 384 >>> from waeup. sirp.utils.converters import BoolConverter384 >>> from waeup.kofa.utils.converters import BoolConverter 385 385 >>> converter = BoolConverter(field) 386 386 387 387 Or we can just grab a registered adapter: 388 388 389 >>> from waeup. sirp.interfaces import ISchemaTypeConverter389 >>> from waeup.kofa.interfaces import ISchemaTypeConverter 390 390 >>> converter = ISchemaTypeConverter(field) 391 391 … … 393 393 394 394 >>> converter 395 <waeup. sirp.utils.converters.BoolConverter object at 0x...>395 <waeup.kofa.utils.converters.BoolConverter object at 0x...> 396 396 397 397 Now we can convert strings to this type: … … 494 494 :class:`IntConverter` instance: 495 495 496 >>> from waeup. sirp.utils.converters import IntConverter496 >>> from waeup.kofa.utils.converters import IntConverter 497 497 >>> converter = IntConverter(field) 498 498 499 499 Or we can just grab a registered adapter: 500 500 501 >>> from waeup. sirp.interfaces import ISchemaTypeConverter501 >>> from waeup.kofa.interfaces import ISchemaTypeConverter 502 502 >>> converter = ISchemaTypeConverter(field) 503 503 … … 505 505 506 506 >>> converter 507 <waeup. sirp.utils.converters.IntConverter object at 0x...>507 <waeup.kofa.utils.converters.IntConverter object at 0x...> 508 508 509 509 Now we can convert strings to this type: … … 597 597 :class:`ChoiceConverter` instance: 598 598 599 >>> from waeup. sirp.utils.converters import ChoiceConverter599 >>> from waeup.kofa.utils.converters import ChoiceConverter 600 600 >>> converter = ChoiceConverter(field) 601 601 602 602 Or we can just grab a registered adapter: 603 603 604 >>> from waeup. sirp.interfaces import ISchemaTypeConverter604 >>> from waeup.kofa.interfaces import ISchemaTypeConverter 605 605 >>> converter = ISchemaTypeConverter(field) 606 606 … … 608 608 609 609 >>> converter 610 <waeup. sirp.utils.converters.ChoiceConverter object at 0x...>610 <waeup.kofa.utils.converters.ChoiceConverter object at 0x...> 611 611 612 612 Now we can convert strings to this type: … … 672 672 '1' 673 673 674 >>> from waeup. sirp.interfaces import SimpleSIRPVocabulary674 >>> from waeup.kofa.interfaces import SimpleKOFAVocabulary 675 675 >>> field = Choice( 676 676 ... title = u'Favourite Dish', 677 677 ... default = 0, 678 ... vocabulary = Simple SIRPVocabulary(678 ... vocabulary = SimpleKOFAVocabulary( 679 679 ... ('N/A', 0), ('Pizza', 1), 680 680 ... ('Cake', 2), ('Muffins', 3)), … … 730 730 731 731 We get a converter for this field in the usual way. The 732 :meth:`waeup. sirp.utils.converters.fromString()` method will return one of732 :meth:`waeup.kofa.utils.converters.fromString()` method will return one of 733 733 the objects if we feed it with ``'Wilma'`` or ``'Fred'``: 734 734 … … 763 763 :class:`IntConverter` instance: 764 764 765 >>> from waeup. sirp.utils.converters import DateConverter765 >>> from waeup.kofa.utils.converters import DateConverter 766 766 >>> converter = DateConverter(field) 767 767 768 768 Or we can just grab a registered adapter: 769 769 770 >>> from waeup. sirp.interfaces import ISchemaTypeConverter770 >>> from waeup.kofa.interfaces import ISchemaTypeConverter 771 771 >>> converter = ISchemaTypeConverter(field) 772 772 … … 774 774 775 775 >>> converter 776 <waeup. sirp.utils.converters.DateConverter object at 0x...>776 <waeup.kofa.utils.converters.DateConverter object at 0x...> 777 777 778 778 Now we can convert strings to this type: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r7359 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper functions for SIRP.18 """General helper functions for KOFA. 19 19 """ 20 20 import os … … 151 151 instances of certain classes when called. 152 152 153 In :mod:`waeup. sirp` we use factories extensively for153 In :mod:`waeup.kofa` we use factories extensively for 154 154 batching. While processing a batch some importer looks up a 155 155 factory to create real-world instances that then get filled with … … 163 163 164 164 >>> import grok 165 >>> from waeup. sirp.utils.helpers import FactoryBase165 >>> from waeup.kofa.utils.helpers import FactoryBase 166 166 >>> class MyObject(object): 167 167 ... # Some class we want to get instances of. … … 169 169 >>> class MyObjectFactory(FactoryBase): 170 170 ... # This is the factory for MyObject instances 171 ... grok.name(u'waeup. sirp.factory.MyObject')171 ... grok.name(u'waeup.kofa.factory.MyObject') 172 172 ... factory = MyObject 173 173 … … 176 176 called. The given name must even be unique amongst all utilities 177 177 registered during runtime. While you can pick any name you like 178 you might want to prepend ``waeup. sirp.factory.`` to the name178 you might want to prepend ``waeup.kofa.factory.`` to the name 179 179 string to make sure it does not clash with names of other 180 180 utilities one day. … … 183 183 freshly defined factory. This executes all the component 184 184 registration stuff we don't want to do ourselves. In daily use 185 this is done automatically on startup of a :mod:`waeup. sirp`185 this is done automatically on startup of a :mod:`waeup.kofa` 186 186 system. 187 187 188 >>> grok.testing.grok('waeup. sirp.utils.helpers')188 >>> grok.testing.grok('waeup.kofa.utils.helpers') 189 189 >>> grok.testing.grok_component( 190 190 ... 'MyObjectFactory', MyObjectFactory … … 197 197 198 198 >>> from zope.component import createObject 199 >>> obj = createObject('waeup. sirp.factory.MyObject')199 >>> obj = createObject('waeup.kofa.factory.MyObject') 200 200 >>> isinstance(obj, MyObject) 201 201 True … … 207 207 >>> from zope.component.interfaces import IFactory 208 208 >>> factory = getUtility( 209 ... IFactory, name='waeup. sirp.factory.MyObject'209 ... IFactory, name='waeup.kofa.factory.MyObject' 210 210 ... ) 211 211 >>> isinstance(factory, MyObjectFactory) … … 251 251 HTML code: 252 252 253 >>> from waeup. sirp.utils.helpers import ReST2HTML253 >>> from waeup.kofa.utils.helpers import ReST2HTML 254 254 >>> source = ''' 255 255 ... Headline -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.txt
r7496 r7811 1 :mod:`waeup. sirp.utils.helpers` -- Helpers for SIRP1 :mod:`waeup.kofa.utils.helpers` -- Helpers for KOFA 2 2 *************************************************** 3 3 4 .. module:: waeup. sirp.utils.helpers5 6 Helper functions for SIRP.4 .. module:: waeup.kofa.utils.helpers 5 6 Helper functions for KOFA. 7 7 8 8 .. :doctest: … … 21 21 >>> os.chdir(new_location) 22 22 23 >>> from waeup. sirp.utils.helpers import remove_file_or_directory23 >>> from waeup.kofa.utils.helpers import remove_file_or_directory 24 24 >>> open('blah', 'wb').write('nonsense') 25 25 >>> 'blah' in os.listdir('.') … … 72 72 >>> open(os.path.join('src', 'blah'), 'wb').write('nonsense') 73 73 74 >>> from waeup. sirp.utils.helpers import copy_filesystem_tree74 >>> from waeup.kofa.utils.helpers import copy_filesystem_tree 75 75 >>> result = copy_filesystem_tree('src', 'dst') 76 76 … … 179 179 returned with all preceeding/following stuff stripped: 180 180 181 >>> from waeup. sirp.utils.helpers import get_inner_HTML_part181 >>> from waeup.kofa.utils.helpers import get_inner_HTML_part 182 182 >>> print get_inner_HTML_part("""<html> 183 183 ... <head> -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.py
r7321 r7811 22 22 from cStringIO import StringIO 23 23 from zope.interface import Interface 24 from waeup. sirp.interfaces import (ISIRPObject, ISIRPExporter,25 I SIRPXMLExporter, ISIRPXMLImporter)24 from waeup.kofa.interfaces import (IKOFAObject, IKOFAExporter, 25 IKOFAXMLExporter, IKOFAXMLImporter) 26 26 27 27 def readFile(f): … … 40 40 41 41 class Exporter(grok.Adapter): 42 """Export a SIRPobject as pickle.42 """Export a KOFA object as pickle. 43 43 44 44 This all-purpose exporter exports attributes defined in schemata 45 45 and contained objects (if the exported thing is a container). 46 46 """ 47 grok.context(I SIRPObject)48 grok.provides(I SIRPExporter)47 grok.context(IKOFAObject) 48 grok.provides(IKOFAExporter) 49 49 50 50 def __init__(self, context): … … 61 61 62 62 class XMLExporter(grok.Adapter): 63 """Export a SIRPobject as XML.63 """Export a KOFA object as XML. 64 64 65 65 This all-purpose exporter exports XML representations of pickable … … 67 67 """ 68 68 grok.context(Interface) 69 grok.provides(I SIRPXMLExporter)69 grok.provides(IKOFAXMLExporter) 70 70 71 71 def __init__(self, context): 72 72 self.context = context 73 73 74 74 def export(self, filepath=None): 75 75 pickled_obj = cPickle.dumps(self.context) … … 84 84 85 85 class XMLImporter(grok.Adapter): 86 """Import a SIRPobject from XML.86 """Import a KOFA object from XML. 87 87 """ 88 88 grok.context(Interface) 89 grok.provides(I SIRPXMLImporter)89 grok.provides(IKOFAXMLImporter) 90 90 91 91 def __init__(self, context): 92 92 self.context = context 93 93 94 94 def doImport(self, filepath): 95 95 xml = None -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.txt
r7321 r7811 6 6 7 7 .. :doctest: 8 .. :layer: waeup. sirp.testing.SIRPUnitTestLayer8 .. :layer: waeup.kofa.testing.KOFAUnitTestLayer 9 9 10 10 As imports and exports of data are a cruical point when doing updates … … 60 60 an exporter:: 61 61 62 >>> from waeup. sirp.interfaces import ISIRPXMLExporter63 >>> exporter = I SIRPXMLExporter(mycave)62 >>> from waeup.kofa.interfaces import IKOFAXMLExporter 63 >>> exporter = IKOFAXMLExporter(mycave) 64 64 >>> exporter 65 <waeup. sirp.utils.importexport.XMLExporter object at 0x...>65 <waeup.kofa.utils.importexport.XMLExporter object at 0x...> 66 66 67 67 All exporters provide an ``export(<obj>)`` method:: … … 101 101 Now we create an importer for that object: 102 102 103 >>> from waeup. sirp.interfaces import ISIRPXMLImporter104 >>> importer = I SIRPXMLImporter(mycave)103 >>> from waeup.kofa.interfaces import IKOFAXMLImporter 104 >>> importer = IKOFAXMLImporter(mycave) 105 105 106 106 Importing from filenames -
main/waeup.kofa/trunk/src/waeup/kofa/utils/logger.py
r7651 r7811 19 19 Convenience stuff for logging. 20 20 21 Main component of :mod:`waeup. sirp.utils.logging` is a mix-in class22 :class:`waeup. sirp.utils.logging.Logger`. Classes derived (also) from21 Main component of :mod:`waeup.kofa.utils.logging` is a mix-in class 22 :class:`waeup.kofa.utils.logging.Logger`. Classes derived (also) from 23 23 that mix-in provide a `logger` attribute that returns a regular Python 24 24 logger logging to a rotating log file stored in the datacenter storage … … 30 30 The `logger_name` tells under which name the logger should be 31 31 registered Python-wise. This is usually a dotted name string like 32 ``waeup. sirp.${sitename}.mycomponent`` which should be unique. If you32 ``waeup.kofa.${sitename}.mycomponent`` which should be unique. If you 33 33 pick a name already used by another component, trouble is ahead. The 34 34 ``${sitename}`` chunk of the name can be set literally like this. The … … 46 46 your `logger_name` and `logger_filename` attribute and off you go:: 47 47 48 from waeup. sirp.utils.logger import Logger48 from waeup.kofa.utils.logger import Logger 49 49 50 50 class MyComponent(object, Logger): 51 51 # Yes that's a complete working class 52 logger_name = 'waeup. sirp.${sitename}.mycomponent52 logger_name = 'waeup.kofa.${sitename}.mycomponent 53 53 logger_filename = 'mycomponent.log' 54 54 … … 67 67 68 68 The datacenter and its storage are created automatically when you 69 create a :class:`waeup. sirp.app.University`. This also means that69 create a :class:`waeup.kofa.app.University`. This also means that 70 70 logging with the `Logger` mix-in will work only inside so-called sites 71 71 (`University` instances put into ZODB are such `sites`). … … 80 80 from zope.component import queryUtility 81 81 from zope.interface import Interface, Attribute, implements 82 from waeup. sirp.interfaces import (82 from waeup.kofa.interfaces import ( 83 83 IDataCenter, IDataCenterStorageMovedEvent, ILoggerCollector) 84 from waeup. sirp.utils.helpers import get_current_principal84 from waeup.kofa.utils.helpers import get_current_principal 85 85 86 86 #: Default logfile size (5 KB) … … 152 152 153 153 #: The Python logger name used when 154 #: logging. ``'waeup. sirp.${sitename}'`` by default. You can use the154 #: logging. ``'waeup.kofa.${sitename}'`` by default. You can use the 155 155 #: ``${sitename}`` placeholder in that string, which will be 156 156 #: replaced by the actual used site name. 157 logger_name = 'waeup. sirp.${sitename}'157 logger_name = 'waeup.kofa.${sitename}' 158 158 implements(ILogger) 159 159 … … 378 378 return 379 379 380 from waeup. sirp.interfaces import IUniversity380 from waeup.kofa.interfaces import IUniversity 381 381 @grok.subscribe(IUniversity, grok.IObjectRemovedEvent) 382 382 def handle_site_removed(obj, event): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_batching.py
r7196 r7811 27 27 from zope.component.interfaces import IFactory 28 28 from zope.interface import Interface, implements 29 from waeup. sirp.app import University30 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase29 from waeup.kofa.app import University 30 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 31 31 32 32 optionflags = ( … … 71 71 stoneville = dict 72 72 73 from waeup. sirp.utils.batching import BatchProcessor73 from waeup.kofa.utils.batching import BatchProcessor 74 74 class CaveProcessor(BatchProcessor): 75 75 util_name = 'caveprocessor' -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_converters.py
r7649 r7811 31 31 Interface, implements, invariant, Invalid, implementedBy) 32 32 33 from waeup. sirp.app import University34 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase35 from waeup. sirp.university import Faculty36 from waeup. sirp.utils.converters import IObjectConverter37 from waeup. sirp.utils.helpers import attrs_to_fields38 from waeup. sirp.interfaces import SimpleSIRPVocabulary39 40 colors = Simple SIRPVocabulary(33 from waeup.kofa.app import University 34 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 35 from waeup.kofa.university import Faculty 36 from waeup.kofa.utils.converters import IObjectConverter 37 from waeup.kofa.utils.helpers import attrs_to_fields 38 from waeup.kofa.interfaces import SimpleKOFAVocabulary 39 40 colors = SimpleKOFAVocabulary( 41 41 ('Red', u'red'), 42 42 ('Green', u'green'), 43 43 ('Blue', u'blue'), 44 44 ) 45 car_nums = Simple SIRPVocabulary(45 car_nums = SimpleKOFAVocabulary( 46 46 ('None', 0), 47 47 ('One', 1), -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_doctests.py
r7196 r7811 18 18 """Register doctests from utils subpackage. 19 19 """ 20 from waeup. sirp.testing import get_doctest_suite20 from waeup.kofa.testing import get_doctest_suite 21 21 22 22 def test_suite(): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_helpers.py
r7196 r7811 27 27 from zope.security.testing import Principal, Participation 28 28 from zope.security.management import newInteraction, endInteraction 29 from waeup. sirp.utils import helpers29 from waeup.kofa.utils import helpers 30 30 31 31 from zope.interface import Interface, implements -
main/waeup.kofa/trunk/src/waeup/kofa/utils/tests/test_logger.py
r7651 r7811 17 17 ## 18 18 19 # Tests for waeup. sirp.utils.logger19 # Tests for waeup.kofa.utils.logger 20 20 import logging 21 21 import os … … 25 25 from zope.component.hooks import setSite, clearSite 26 26 from zope.interface.verify import verifyClass, verifyObject 27 from waeup. sirp.app import University28 from waeup. sirp.testing import FunctionalLayer, FunctionalTestCase29 30 from waeup. sirp.utils.logger import (27 from waeup.kofa.app import University 28 from waeup.kofa.testing import FunctionalLayer, FunctionalTestCase 29 30 from waeup.kofa.utils.logger import ( 31 31 Logger, MAX_BYTES, BACKUP_COUNT, ILoggerCollector, LoggerCollector, 32 32 ILogger) -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r7744 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper utilities for SIRP.18 """General helper utilities for KOFA. 19 19 """ 20 20 import os … … 23 23 from zope.i18n import translate 24 24 from random import SystemRandom as r 25 from waeup. sirp.interfaces import ISIRPUtils26 from waeup. sirp.interfaces import MessageFactory as _27 from waeup. sirp.smtp import send_mail as send_mail_internally25 from waeup.kofa.interfaces import IKOFAUtils 26 from waeup.kofa.interfaces import MessageFactory as _ 27 from waeup.kofa.smtp import send_mail as send_mail_internally 28 28 29 29 def send_mail(from_name,from_addr,rcpt_name,rcpt_addr,subject,body,config): 30 """Wrapper for the real SMTP functionality in :mod:`waeup. sirp.smtp`.30 """Wrapper for the real SMTP functionality in :mod:`waeup.kofa.smtp`. 31 31 32 32 Merely here to stay compatible with lots of calls to this place. … … 37 37 return True 38 38 39 class SIRPUtils(grok.GlobalUtility):39 class KOFAUtils(grok.GlobalUtility): 40 40 """A collection of parameters and methods subject to customization. 41 41 """ 42 grok.implements(I SIRPUtils)42 grok.implements(IKOFAUtils) 43 43 # This the only place where we define the portal language 44 44 # which is used for the translation of system messages … … 131 131 'd':portal, 132 132 'e':body}) 133 body = translate(text, 'waeup. sirp',133 body = translate(text, 'waeup.kofa', 134 134 target_language=self.PORTAL_LANGUAGE) 135 135 return send_mail( … … 161 161 Returns True or False to indicate successful operation. 162 162 """ 163 subject = 'Your SIRPcredentials'163 subject = 'Your KOFA credentials' 164 164 text = _(u"""Dear ${a}, 165 165 … … 193 193 'f':login_url}) 194 194 195 body = translate(text, 'waeup. sirp',195 body = translate(text, 'waeup.kofa', 196 196 target_language=self.PORTAL_LANGUAGE) 197 197 return send_mail( -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/objectwidget.py
r7795 r7811 25 25 from zope.schema import getFieldNamesInOrder 26 26 27 class SIRPObjectWidgetView(ObjectWidgetView):27 class KOFAObjectWidgetView(ObjectWidgetView): 28 28 template = ViewPageTemplateFile('objectwidget.pt') 29 29 30 class SIRPObjectWidget(ObjectWidget):30 class KOFAObjectWidget(ObjectWidget): 31 31 32 32 def __init__(self, context, request, factory, **kw): … … 58 58 59 59 def _getView(self, request): 60 return SIRPObjectWidgetView(self, request)60 return KOFAObjectWidgetView(self, request) 61 61 62 62 63 class SIRPObjectDisplayWidget(SIRPObjectWidget):63 class KOFAObjectDisplayWidget(KOFAObjectWidget): 64 64 65 65 implementsOnly(IDisplayWidget) -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/phonewidget.py
r7670 r7811 31 31 import re 32 32 import copy 33 from waeup. sirp.interfaces import MessageFactory as _33 from waeup.kofa.interfaces import MessageFactory as _ 34 34 from zope import schema 35 35 from zope.browserpage import ViewPageTemplateFile -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/restwidget.py
r7705 r7811 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """A widget that renders restructured text. 18 """A widget that renders restructured text. 19 19 """ 20 20 from zope.component import getUtility 21 21 from zope.formlib.widget import renderElement, DisplayWidget 22 from waeup. sirp.utils.helpers import ReST2HTML23 from waeup. sirp.interfaces import ISIRPUtils22 from waeup.kofa.utils.helpers import ReST2HTML 23 from waeup.kofa.interfaces import IKOFAUtils 24 24 25 25 … … 36 36 language separator - usually the first part has no language 37 37 descriptor - are interpreted as texts in the portal's language. 38 The latter can be configured in waeup.srp.utils.utils. SIRPUtils.38 The latter can be configured in waeup.srp.utils.utils.KOFAUtils. 39 39 """ 40 40 if self._renderedValueSet(): … … 46 46 parts = value.split('>>') 47 47 elements = {} 48 lang = getUtility(I SIRPUtils).PORTAL_LANGUAGE48 lang = getUtility(IKOFAUtils).PORTAL_LANGUAGE 49 49 for part in parts: 50 50 if part[2:4] == u'<<': -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/sequencewidget.pt
r7798 r7811 1 1 <table border="0" class="sequencewidget" 2 i18n:domain="waeup. sirp">2 i18n:domain="waeup.kofa"> 3 3 <tr tal:repeat="widget view/widgets"> 4 4 <td> -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/sequencewidget.py
r7802 r7811 29 29 from zope.schema.interfaces import IField, IList 30 30 31 class SIRPSequenceWidget(ListSequenceWidget):31 class KOFASequenceWidget(ListSequenceWidget): 32 32 """A sequence widget for lists. 33 33 … … 51 51 @grok.implementer(IInputWidget) 52 52 def seq_input_widget(obj, field, req, *args, **kw): 53 return SIRPSequenceWidget(obj, field, req, *args, **kw)53 return KOFASequenceWidget(obj, field, req, *args, **kw) 54 54 55 55 @grok.adapter(IList, IField, IBrowserRequest) -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/tests/test_datewidget.py
r7501 r7811 27 27 SimpleInputWidgetTest, BrowserWidgetTest, ) 28 28 from zope.formlib.interfaces import IInputWidget, IDisplayWidget 29 from waeup. sirp.widgets.datewidget import (29 from waeup.kofa.widgets.datewidget import ( 30 30 FormattedDateWidget, FormattedDateDisplayWidget, ) 31 31 from zope.formlib.widgets import DateI18nWidget -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/tests/test_objectwidget.py
r7803 r7811 37 37 from zope.formlib.interfaces import IWidgetInputErrorView 38 38 39 from waeup. sirp.widgets.objectwidget import SIRPObjectWidget as ObjectWidget40 from waeup. sirp.widgets.objectwidget import (41 SIRPObjectDisplayWidget as ObjectDisplayWidget)39 from waeup.kofa.widgets.objectwidget import KOFAObjectWidget as ObjectWidget 40 from waeup.kofa.widgets.objectwidget import ( 41 KOFAObjectDisplayWidget as ObjectDisplayWidget) 42 42 43 43 class ITestContact(Interface): -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/tests/test_phonewidget.py
r7494 r7811 36 36 from zope.publisher.interfaces.browser import IDefaultBrowserLayer 37 37 from zope.schema.interfaces import ITextLine 38 from waeup. sirp.widgets.phonewidget import PhoneWidget38 from waeup.kofa.widgets.phonewidget import PhoneWidget 39 39 40 40 # Dummy content -
main/waeup.kofa/trunk/src/waeup/kofa/workflow.py
r7321 r7811 25 25 from zope.security.interfaces import NoInteraction 26 26 from zope.security.management import getInteraction 27 from waeup. sirp.interfaces import ISIRPWorkflowInfo27 from waeup.kofa.interfaces import IKOFAWorkflowInfo 28 28 29 class SIRPWorkflow(Workflow):29 class KOFAWorkflow(Workflow): 30 30 """A :mod:`hurry.workflow` workflow with more appropriate error 31 31 messages. … … 71 71 return False 72 72 73 class SIRPWorkflowInfo(WorkflowInfo):73 class KOFAWorkflowInfo(WorkflowInfo): 74 74 """A workflow info that provides a convenience transition getter. 75 75 """ 76 76 77 grok.provides(I SIRPWorkflowInfo)77 grok.provides(IKOFAWorkflowInfo) 78 78 79 79 def getManualTransitions(self): -
main/waeup.kofa/trunk/src/waeup/kofa/zcml.py
r7576 r7811 21 21 ## 22 22 from zope.component.zcml import handler 23 from waeup. sirp.interfaces import IDataCenterConfig23 from waeup.kofa.interfaces import IDataCenterConfig 24 24 25 25 def data_center_conf(context, path): … … 32 32 33 33 - Add to the header: 34 ``xmlns: sirp="http://namespaces.waeup.org/sirp"``34 ``xmlns:kofa="http://namespaces.waeup.org/kofa"`` 35 35 36 - Then, after including waeup. sirp:37 ``< sirp:datacenter path="some/existing/file/path" />``36 - Then, after including waeup.kofa: 37 ``<kofa:datacenter path="some/existing/file/path" />`` 38 38 39 39 In a running instance (where some directive like above was … … 41 41 IDataCenterConfig utility: 42 42 43 >>> from waeup. sirp.interfaces import IDataCenterConfig43 >>> from waeup.kofa.interfaces import IDataCenterConfig 44 44 >>> from zope.component import getUtility 45 45 >>> getUtility(IDataCenterConfig)
Note: See TracChangeset for help on using the changeset viewer.