Changeset 7819
- Timestamp:
- 8 Mar 2012, 22:28:46 (13 years ago)
- Location:
- main/waeup.kofa/trunk
- Files:
-
- 98 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/README.txt
r7808 r7819 1 What is WAeUP.K OFA?1 What is WAeUP.Kofa ? 2 2 ******************** 3 3 4 The WAeUP Student Information and Registration Portal (WAeUP.K OFA) is4 The WAeUP Student Information and Registration Portal (WAeUP.Kofa) is 5 5 a web-based management tool for managing universities and schools. 6 6 -
main/waeup.kofa/trunk/src/waeup/kofa/__init__.py
r7811 r7819 1 1 import grok 2 from waeup.kofa.interfaces import IK OFAObject2 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 K OFAAttributeAnnotations(AttributeAnnotations, grok.Adapter):7 """An adapter to IAnnotations for any K OFAObject.6 class KofaAttributeAnnotations(AttributeAnnotations, grok.Adapter): 7 """An adapter to IAnnotations for any KofaObject. 8 8 9 Providing this adapter, each K OFAobject becomes (attribute)9 Providing this adapter, each Kofa object becomes (attribute) 10 10 annotatable. 11 11 """ 12 12 grok.provides(IAnnotations) 13 grok.context(IK OFAObject)13 grok.context(IKofaObject) -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/accesscode.py
r7811 r7819 31 31 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 32 32 from random import SystemRandom as random 33 from waeup.kofa.interfaces import IK OFAPluggable, IObjectHistory33 from waeup.kofa.interfaces import IKofaPluggable, IObjectHistory 34 34 from waeup.kofa.utils.logger import Logger 35 35 from waeup.kofa.accesscodes.interfaces import ( … … 415 415 class AccessCodePlugin(grok.GlobalUtility): 416 416 grok.name('accesscodes') 417 grok.implements(IK OFAPluggable)417 grok.implements(IKofaPluggable) 418 418 419 419 def setup(self, site, name, logger): -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/accesscode.txt
r7811 r7819 7 7 8 8 .. :NOdoctest: 9 .. :NOlayer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :NOlayer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 About access-codes … … 591 591 .. class:: AccessCodePlugin 592 592 593 A `waeup.kofa` plugin that updates existing K OFAuniversity593 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(IK OFAPluggable)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 IK OFAPluggable 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.kofa.interfaces import IK OFAPluggable618 >>> plugin = getUtility(IK OFAPluggable, name='accesscodes')617 >>> from waeup.kofa.interfaces import IKofaPluggable 618 >>> plugin = getUtility(IKofaPluggable, name='accesscodes') 619 619 >>> plugin 620 620 <waeup.kofa.accesscodes.accesscodes.AccessCodePlugin object at 0x...> -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.py
r7811 r7819 22 22 from hurry.workflow.interfaces import InvalidTransitionError 23 23 from waeup.kofa.browser.resources import datatable 24 from waeup.kofa.browser import K OFAPage, KOFAAddFormPage, NullValidator24 from waeup.kofa.browser import KofaPage, KofaAddFormPage, NullValidator 25 25 from waeup.kofa.browser.breadcrumbs import Breadcrumb 26 26 from waeup.kofa.browser.viewlets import ( 27 27 AdminTask, AddActionButton, SearchActionButton, BatchOpButton, ManageLink) 28 from waeup.kofa.interfaces import IK OFAObject28 from waeup.kofa.interfaces import IKofaObject 29 29 from waeup.kofa.interfaces import MessageFactory as _ 30 30 from waeup.kofa.accesscodes.interfaces import ( … … 34 34 from waeup.kofa.browser.layout import action 35 35 36 grok.context(IK OFAObject)37 38 class BatchContainerPage(K OFAPage):36 grok.context(IKofaObject) 37 38 class BatchContainerPage(KofaPage): 39 39 grok.name('index') 40 40 grok.context(IAccessCodeBatchContainer) … … 70 70 self.context.logger_info(ob_class, message) 71 71 72 class AddBatchPage(K OFAAddFormPage):72 class AddBatchPage(KofaAddFormPage): 73 73 grok.name('add') 74 74 grok.context(IAccessCodeBatchContainer) … … 103 103 self.redirect(self.url(self.context)) 104 104 105 class ReimportBatchPage(K OFAPage):105 class ReimportBatchPage(KofaPage): 106 106 """Screen for reimporting AC batches. 107 107 """ … … 144 144 self.redirect(self.url(self.context)) 145 145 146 class BatchContainerSearchPage(K OFAPage):146 class BatchContainerSearchPage(KofaPage): 147 147 grok.name('search') 148 148 grok.context(IAccessCodeBatchContainer) -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/browser.txt
r7811 r7819 4 4 .. module:: waeup.kofa.accesscodes.browser 5 5 6 Here we visit the access-code related parts of a K OFAsite using6 Here we visit the access-code related parts of a Kofa site using 7 7 a virtual browser. 8 8 -
main/waeup.kofa/trunk/src/waeup/kofa/accesscodes/interfaces.py
r7811 r7819 20 20 from zope import schema 21 21 from zope.interface import Interface 22 from waeup.kofa.interfaces import IK OFAObject22 from waeup.kofa.interfaces import IKofaObject 23 23 from waeup.kofa.interfaces import MessageFactory as _ 24 24 25 class IAccessCode(IK OFAObject):25 class IAccessCode(IKofaObject): 26 26 """An access code. 27 27 """ … … 92 92 ) 93 93 94 class IAccessCodeBatchContainer(IK OFAObject):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
r7811 r7819 29 29 from zope.testing import renormalizing 30 30 from waeup.kofa.app import University 31 from waeup.kofa.interfaces import IObjectHistory, IK OFAPluggable31 from waeup.kofa.interfaces import IObjectHistory, IKofaPluggable 32 32 from waeup.kofa.testing import ( 33 33 FunctionalLayer, FunctionalTestCase, setUp, tearDown, getRootFolder) … … 412 412 def test_iface(self): 413 413 plugin = AccessCodePlugin() 414 assert verifyObject(IK OFAPluggable, plugin)415 assert verifyClass(IK OFAPluggable, 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/workflow.py
r7811 r7819 26 26 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 27 27 from waeup.kofa.accesscodes.interfaces import IAccessCode 28 from waeup.kofa.interfaces import IObjectHistory, IK OFAWorkflowInfo28 from waeup.kofa.interfaces import IObjectHistory, IKofaWorkflowInfo 29 29 from waeup.kofa.interfaces import MessageFactory as _ 30 from waeup.kofa.workflow import K OFAWorkflow, KOFAWorkflowInfo30 from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo 31 31 32 32 INITIALIZED = 'initialized' … … 113 113 ) 114 114 115 accesscode_workflow = K OFAWorkflow(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(K OFAWorkflowInfo, grok.Adapter):124 class AccessCodeWorkflowInfo(KofaWorkflowInfo, grok.Adapter): 125 125 grok.context(IAccessCode) 126 grok.provides(IK OFAWorkflowInfo)126 grok.provides(IKofaWorkflowInfo) 127 127 128 128 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/app.py
r7811 r7819 26 26 from waeup.kofa.hostels.container import HostelsContainer 27 27 from waeup.kofa.interfaces import ( 28 IUniversity, IK OFAPluggable, IObjectUpgradeEvent, )28 IUniversity, IKofaPluggable, IObjectUpgradeEvent, ) 29 29 from waeup.kofa.userscontainer import UsersContainer 30 30 from waeup.kofa.utils.logger import Logger … … 64 64 """Create instances of all plugins defined somewhere. 65 65 """ 66 for name, plugin in getUtilitiesFor(IK OFAPluggable):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(IK OFAPluggable):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
r7811 r7819 1 :mod:`waeup.kofa.app` -- central components for K OFA1 :mod:`waeup.kofa.app` -- central components for Kofa 2 2 **************************************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer5 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 6 6 7 7 .. module:: waeup.kofa.app … … 9 9 .. class:: University 10 10 11 The main K OFAapplication object is given with11 The main Kofa application object is given with 12 12 :class:`University`. It provides the main containers as faculties, 13 13 hostels, etc. … … 76 76 first:: 77 77 78 >>> from waeup.kofa.interfaces import IK OFAExporter79 >>> exporter = IK OFAExporter(myuniversity)78 >>> from waeup.kofa.interfaces import IKofaExporter 79 >>> exporter = IKofaExporter(myuniversity) 80 80 >>> exporter 81 81 <waeup.kofa.utils.importexport.Exporter object at 0x...> … … 90 90 memory file:: 91 91 92 >>> from waeup.kofa.interfaces import IK OFAXMLExporter93 >>> exporter = IK OFAXMLExporter(myuniversity)92 >>> from waeup.kofa.interfaces import IKofaXMLExporter 93 >>> exporter = IKofaXMLExporter(myuniversity) 94 94 >>> f = exporter.export() 95 95 >>> f … … 103 103 </pickle> 104 104 105 K OFAplugins105 Kofa plugins 106 106 ============ 107 107 108 108 waeup.kofa provides an API to 'plugin' components. Things that should 109 be setup at creation time of a K OFAapplication can indicate110 that by providing a utility providing IK OFAPlugin.109 be setup at creation time of a Kofa application can indicate 110 that by providing a utility providing IKofaPlugin. 111 111 112 112 The plugins are looked up by an created app, which then will call the 113 113 ``setup()`` method of each plugin. 114 114 115 >>> from waeup.kofa.interfaces import IK OFAPluggable115 >>> from waeup.kofa.interfaces import IKofaPluggable 116 116 >>> from zope.component import getAdapters, getUtilitiesFor 117 >>> sorted(list(getUtilitiesFor(IK OFAPluggable)))117 >>> sorted(list(getUtilitiesFor(IKofaPluggable))) 118 118 [(u'accesscodes', <waeup.kofa.accesscodes...AccessCodePlugin ...)] 119 119 … … 122 122 123 123 >>> import grok 124 >>> from waeup.kofa.interfaces import IK OFAPluggable124 >>> from waeup.kofa.interfaces import IKofaPluggable 125 125 >>> class MyPlugin(grok.GlobalUtility): 126 ... grok.implements(IK OFAPluggable)126 ... grok.implements(IKofaPluggable) 127 127 ... def setup(self, site, name, logger): 128 128 ... print "Setup was called for" … … 136 136 True 137 137 138 and setup a new K OFAinstance, we will get a message:138 and setup a new Kofa instance, we will get a message: 139 139 140 140 >>> from waeup.kofa.app import University -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/applicant.py
r7811 r7819 27 27 from hurry.workflow.interfaces import IWorkflowInfo, IWorkflowState 28 28 from waeup.kofa.app import University 29 from waeup.kofa.image import K OFAImageFile29 from waeup.kofa.image import KofaImageFile 30 30 from waeup.kofa.imagestorage import DefaultFileStoreHandler 31 31 from waeup.kofa.interfaces import ( 32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IK OFAUtils,32 IObjectHistory, IFileStoreHandler, IFileStoreNameChooser, IKofaUtils, 33 33 IExtFileStore, IPDF, IUserAccount) 34 34 from waeup.kofa.students.vocabularies import RegNumNotInSource … … 76 76 def display_fullname(self): 77 77 middlename = getattr(self, 'middlename', None) 78 kofa_utils = getUtility(IK OFAUtils)78 kofa_utils = getUtility(IKofaUtils) 79 79 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 80 80 … … 291 291 ApplicantImageStoreHandler, self).createFile( 292 292 store, root, filename, file_id, file) 293 return file, path, K OFAImageFile(293 return file, path, KofaImageFile( 294 294 file_obj.filename, file_obj.data) 295 295 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
r7811 r7819 35 35 from waeup.kofa.applicants.workflow import INITIALIZED, STARTED, PAID, SUBMITTED 36 36 from waeup.kofa.browser import ( 37 K OFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,37 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 38 38 DEFAULT_PASSPORT_IMAGE_PATH) 39 39 from waeup.kofa.browser.interfaces import ICaptchaManager … … 44 44 from waeup.kofa.browser.resources import datepicker, tabs, datatable, warning 45 45 from waeup.kofa.interfaces import ( 46 IK OFAObject, ILocalRolesAssignable, IExtFileStore, IPDF,47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, IK OFAUtils)46 IKofaObject, ILocalRolesAssignable, IExtFileStore, IPDF, 47 IFileStoreNameChooser, IPasswordValidator, IUserAccount, IKofaUtils) 48 48 from waeup.kofa.interfaces import MessageFactory as _ 49 49 from waeup.kofa.permissions import get_users_with_local_roles … … 56 56 from waeup.kofa.widgets.restwidget import ReSTDisplayWidget 57 57 58 grok.context(IK OFAObject) # Make IKOFAObject the default context59 60 class ApplicantsRootPage(K OFAPage):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(K OFAEditFormPage):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(K OFAAddFormPage):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(K OFADisplayFormPage):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(IK OFAUtils).PORTAL_LANGUAGE234 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 235 235 lang = self.request.cookies.get('kofa.language', portal_language) 236 236 html = self.context.description_dict.get(lang,'') … … 246 246 return "%s" % self.context.title 247 247 248 class ApplicantsContainerManageFormPage(K OFAEditFormPage):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(K OFAAddFormPage):351 class ApplicantAddFormPage(KofaAddFormPage): 352 352 """Add-form to add an applicant. 353 353 """ … … 372 372 return 373 373 374 class ApplicantDisplayFormPage(K OFADisplayFormPage):374 class ApplicantDisplayFormPage(KofaDisplayFormPage): 375 375 grok.context(IApplicant) 376 376 grok.name('index') … … 484 484 485 485 486 class OnlinePaymentDisplayFormPage(K OFADisplayFormPage):486 class OnlinePaymentDisplayFormPage(KofaDisplayFormPage): 487 487 """ Page to view an online payment ticket 488 488 """ … … 547 547 @property 548 548 def title(self): 549 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE549 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 550 550 return translate(_('Payment Data'), 'waeup.kofa', 551 551 target_language=portal_language) … … 553 553 @property 554 554 def label(self): 555 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE555 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 556 556 return translate(_('Online Payment Receipt'), 557 557 'waeup.kofa', target_language=portal_language) \ … … 582 582 #@property 583 583 #def label(self): 584 # portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE584 # portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 585 585 # container_title = self.context.__parent__.title 586 586 # label = translate('Application Record', … … 638 638 return True 639 639 640 class ApplicantManageFormPage(K OFAEditFormPage):640 class ApplicantManageFormPage(KofaEditFormPage): 641 641 """A full edit view for applicant data. 642 642 """ … … 883 883 return image 884 884 885 class ApplicantRegistrationPage(K OFAAddFormPage):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 kofa_utils = getUtility(IK OFAUtils)928 kofa_utils = getUtility(IKofaUtils) 929 929 password = kofa_utils.genPassword() 930 930 IUserAccount(applicant).setPassword(password) … … 941 941 return 942 942 943 class ApplicantRegistrationEmailSent(K OFAPage):943 class ApplicantRegistrationEmailSent(KofaPage): 944 944 """Landing page after successful registration. 945 945 """ -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/interfaces.py
r7811 r7819 29 29 from waeup.kofa.schema import TextLineChoice 30 30 from waeup.kofa.interfaces import ( 31 IK OFAObject, year_range, validate_email, academic_sessions_vocab)31 IKofaObject, year_range, validate_email, academic_sessions_vocab) 32 32 from waeup.kofa.interfaces import MessageFactory as _ 33 33 from waeup.kofa.payments.interfaces import IOnlinePayment … … 178 178 pass 179 179 180 class IApplicantsRoot(IK OFAObject, IContainer):180 class IApplicantsRoot(IKofaObject, IContainer): 181 181 """A container for university applicants containers. 182 182 """ 183 183 pass 184 184 185 class IApplicantsContainer(IK OFAObject):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(IK OFAObject):354 class IApplicantBaseData(IKofaObject): 355 355 """The data for an applicant. 356 356 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/pdf.py
r7811 r7819 34 34 from waeup.kofa.applicants.interfaces import IApplicant 35 35 from waeup.kofa.browser import DEFAULT_PASSPORT_IMAGE_PATH 36 from waeup.kofa.interfaces import IExtFileStore, IPDF, IK OFAUtils36 from waeup.kofa.interfaces import IExtFileStore, IPDF, IKofaUtils 37 37 from waeup.kofa.interfaces import MessageFactory as _ 38 38 … … 54 54 def title(self): 55 55 container_title = self.context.__parent__.title 56 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE56 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 57 57 ar_translation = translate(_('Application Record'), 58 58 'waeup.kofa', target_language=portal_language) … … 107 107 if dept is None: 108 108 return data 109 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE109 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 110 110 dp_translation = translate(_('Department:'), 111 111 'waeup.kofa', target_language=portal_language) … … 145 145 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 146 146 view.request.principal.id)) 147 pdf.setCreator('K OFA')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(IK OFAUtils).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( -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/root.py
r7811 r7819 23 23 from hurry.query.interfaces import IQuery 24 24 from zope.component import getUtility 25 from waeup.kofa.interfaces import IK OFAPluggable25 from waeup.kofa.interfaces import IKofaPluggable 26 26 from waeup.kofa.applicants.interfaces import IApplicantsRoot 27 27 from waeup.kofa.utils.logger import Logger … … 46 46 47 47 class ApplicantsPlugin(grok.GlobalUtility): 48 """A K OFAPlugin 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 … … 53 53 the main site configuration. 54 54 55 Implements :class:`waeup.kofa.interfaces.IK OFAPluggable`55 Implements :class:`waeup.kofa.interfaces.IKofaPluggable` 56 56 """ 57 57 grok.name('applicants') 58 grok.implements(IK OFAPluggable)58 grok.implements(IKofaPluggable) 59 59 log_prefix = 'ApplicantsPlugin' 60 60 -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_applicant.py
r7811 r7819 26 26 from zope.interface import verify, implements 27 27 from zope.location.interfaces import ILocation 28 from waeup.kofa.image.interfaces import IK OFAImageFile28 from waeup.kofa.image.interfaces import IKofaImageFile 29 29 from waeup.kofa.imagestorage import DefaultStorage 30 30 from waeup.kofa.interfaces import IFileStoreHandler, IFileStoreNameChooser … … 38 38 class FakeImageLocation(object): 39 39 implements(ILocation) 40 adapts(IK OFAImageFile)40 adapts(IKofaImageFile) 41 41 def __init__(self, context): 42 42 pass -
main/waeup.kofa/trunk/src/waeup/kofa/applicants/viewlets.py
r7811 r7819 18 18 import grok 19 19 from hurry.workflow.interfaces import IWorkflowState 20 from waeup.kofa.interfaces import IK OFAObject20 from waeup.kofa.interfaces import IKofaObject 21 21 from waeup.kofa.students.viewlets import PrimaryStudentNavTab 22 22 from waeup.kofa.browser.viewlets import ManageActionButton, PrimaryNavTab … … 32 32 from waeup.kofa.interfaces import MessageFactory as _ 33 33 34 grok.context(IK OFAObject) # Make IKOFAObject 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(IK OFAObject)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
r7811 r7819 22 22 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 23 23 from waeup.kofa.applicants.interfaces import IApplicantBaseData 24 from waeup.kofa.interfaces import IObjectHistory, IK OFAWorkflowInfo, IKOFAUtils24 from waeup.kofa.interfaces import IObjectHistory, IKofaWorkflowInfo, IKofaUtils 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 from waeup.kofa.workflow import K OFAWorkflow, KOFAWorkflowInfo26 from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo 27 27 28 28 INITIALIZED = 'initialized' … … 137 137 ) 138 138 139 application_workflow = K OFAWorkflow(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(K OFAWorkflowInfo, 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(IK OFAWorkflowInfo)154 grok.provides(IKofaWorkflowInfo) 155 155 156 156 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/authentication.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Authentication for K OFA.18 """Authentication for Kofa. 19 19 """ 20 20 import grok … … 34 34 from waeup.kofa.interfaces import (ILocalRoleSetEvent, 35 35 IUserAccount, IAuthPluginUtility, IPasswordValidator, 36 IK OFAPrincipal, IKOFAPrincipalInfo)36 IKofaPrincipal, IKofaPrincipalInfo) 37 37 38 38 def setup_authentication(pau): … … 63 63 return principalRoleManager 64 64 65 class K OFASessionCredentialsPlugin(grok.GlobalUtility,65 class KofaSessionCredentialsPlugin(grok.GlobalUtility, 66 66 SessionCredentialsPlugin): 67 67 grok.provides(ICredentialsPlugin) … … 72 72 passwordfield = 'form.password' 73 73 74 class K OFAPrincipalInfo(object):75 """An implementation of IK OFAPrincipalInfo.76 77 A K OFAprincipal 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(IK OFAPrincipalInfo)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 K OFAPrincipal(Principal):92 class KofaPrincipal(Principal): 93 93 """A portal principal. 94 94 95 K OFAprincipals 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(IK OFAPrincipal)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 'K OFAPrincipal(%r)' % self.id115 116 class AuthenticatedK OFAPrincipalFactory(grok.MultiAdapter):117 """Creates 'authenticated' K OFAprincipals.118 119 Adapts (principal info, request) to a K OFAPrincipal 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 K OFAPrincipalInfos into KOFAPrincipal instances.123 """ 124 grok.adapts(IK OFAPrincipalInfo, 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 = K OFAPrincipal(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 K OFAPrincipalInfo(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 K OFAPrincipalInfo(238 return KofaPrincipalInfo( 239 239 id=account.name, 240 240 title=account.title, -
main/waeup.kofa/trunk/src/waeup/kofa/authentication.txt
r7811 r7819 1 K OFAauthentication1 Kofa authentication 2 2 ******************* 3 3 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/__init__.py
r7811 r7819 2 2 3 3 from waeup.kofa.browser.layout import ( 4 K OFAPage, KOFAForm, KOFALayout, KOFADisplayFormPage, KOFAEditFormPage,5 K OFAAddFormPage, NullValidator)4 KofaPage, KofaForm, KofaLayout, KofaDisplayFormPage, KofaEditFormPage, 5 KofaAddFormPage, NullValidator) 6 6 from waeup.kofa.browser.pages import ContactAdminForm 7 7 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/breadcrumbs.py
r7811 r7819 34 34 """ 35 35 grok.provides(IBreadcrumb) 36 grok.context(interfaces.IK OFAObject)36 grok.context(interfaces.IKofaObject) 37 37 grok.name('index') 38 38 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/browser.txt
r7811 r7819 1 Browsing K OFA1 Browsing Kofa 2 2 ************* 3 3 4 Here we visit all parts of a K OFAportal using a browser.4 Here we visit all parts of a Kofa portal using a browser. 5 5 6 6 University … … 35 35 >>> print browser.contents 36 36 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"... 37 ...Welcome to WAeUP.K OFA...37 ...Welcome to WAeUP.Kofa... 38 38 ... 39 39 -
main/waeup.kofa/trunk/src/waeup/kofa/browser/captcha.py
r7811 r7819 28 28 from zope.interface import Interface 29 29 from zope.publisher.interfaces.http import IHTTPRequest 30 from waeup.kofa.browser import K OFAPage30 from waeup.kofa.browser import KofaPage 31 31 from waeup.kofa.browser.interfaces import ( 32 32 ICaptchaRequest, ICaptchaResponse, ICaptcha, ICaptchaConfig, … … 171 171 """ReCaptcha - strong captchas with images, sound, etc. 172 172 173 This is the K OFAimplementation 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 K OFA",268 "User-agent": "reCAPTCHA Python Kofa", 269 269 } 270 270 ) … … 319 319 320 320 321 class CaptchaTestPage(K OFAPage):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
r7817 r7819 22 22 from zope.publisher.interfaces import INotFound 23 23 from zope.security.interfaces import IUnauthorized 24 from waeup.kofa.browser.layout import K OFAPage24 from waeup.kofa.browser.layout import KofaPage 25 25 26 26 grok.templatedir('templates') … … 61 61 62 62 63 class NotFoundPage(K OFAPage):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
r7811 r7819 21 21 from zope.interface import Interface, Attribute 22 22 from waeup.kofa.interfaces import ( 23 IK OFAObject, IUniversity, IUsersContainer, IDataCenter)23 IKofaObject, IUniversity, IUsersContainer, IDataCenter) 24 24 from waeup.kofa.university.interfaces import ( 25 25 IFacultiesContainer, IFaculty, IFacultyAdd, IDepartment, IDepartmentAdd, -
main/waeup.kofa/trunk/src/waeup/kofa/browser/layout.py
r7811 r7819 33 33 from zope.interface import Interface 34 34 from zope.site.hooks import getSite 35 from waeup.kofa.interfaces import IK OFAObject, IUserAccount35 from waeup.kofa.interfaces import IKofaObject, IUserAccount 36 36 from waeup.kofa.browser.interfaces import ITheme 37 from waeup.kofa.browser.theming import get_all_themes, K OFAThemeBase37 from waeup.kofa.browser.theming import get_all_themes, KofaThemeBase 38 38 from waeup.kofa.students.interfaces import IStudentNavigation 39 39 from waeup.kofa.applicants.interfaces import IApplicant … … 56 56 57 57 def __call__(self, success): 58 action = K OFAAction(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 K OFAAction(Action):62 class KofaAction(Action): 63 63 64 64 def __init__(self, label, style='', **options): 65 super(K OFAAction, 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 K OFALayout(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 K OFAForm(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(K OFAForm,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 K OFAPage(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 K OFADisplayFormPage(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 K OFAEditFormPage(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(K OFAEditFormPage,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 K OFAAddFormPage(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(K OFALayout):215 class SiteLayout(KofaLayout): 216 216 """ The general site layout. 217 217 """ 218 grok.context(IK OFAObject)218 grok.context(IKofaObject) 219 219 220 220 #: An instance of the default theme to use for the site layout 221 default_theme = K OFAThemeBase()221 default_theme = KofaThemeBase() 222 222 stafftemp = grok.PageTemplateFile('templates/staffsitelayout.pt') 223 223 studenttemp = grok.PageTemplateFile('templates/studentsitelayout.pt') -
main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """ Viewing components for K OFAobjects.18 """ Viewing components for Kofa objects. 19 19 """ 20 20 import copy … … 38 38 from zope.session.interfaces import ISession 39 39 from waeup.kofa.browser import ( 40 K OFAPage, KOFAForm, KOFAEditFormPage, KOFAAddFormPage,41 K OFADisplayFormPage, NullValidator)40 KofaPage, KofaForm, KofaEditFormPage, KofaAddFormPage, 41 KofaDisplayFormPage, NullValidator) 42 42 from waeup.kofa.browser.interfaces import ( 43 43 IUniversity, IFacultiesContainer, IFaculty, IFacultyAdd, … … 47 47 from waeup.kofa.browser.resources import warning, datepicker, tabs, datatable 48 48 from waeup.kofa.interfaces import( 49 IK OFAObject, IUsersContainer, IUserAccount, IDataCenter,50 IK OFAXMLImporter, IKOFAXMLExporter, IBatchProcessor,49 IKofaObject, IUsersContainer, IUserAccount, IDataCenter, 50 IKofaXMLImporter, IKofaXMLExporter, IBatchProcessor, 51 51 ILocalRolesAssignable, DuplicationError, IConfigurationContainer, 52 52 ISessionConfiguration, ISessionConfigurationAdd, 53 IPasswordValidator, IContactForm, IK OFAUtils)53 IPasswordValidator, IContactForm, IKofaUtils) 54 54 from waeup.kofa.permissions import get_users_with_local_roles, get_all_roles 55 55 from waeup.kofa.students.catalog import search as searchstudents … … 62 62 from waeup.kofa.browser.layout import jsaction, action, UtilityView 63 63 64 grok.context(IK OFAObject)64 grok.context(IKofaObject) 65 65 grok.templatedir('templates') 66 66 … … 144 144 # 145 145 146 class LoginPage(K OFAPage):146 class LoginPage(KofaPage): 147 147 """A login page, available for all objects. 148 148 """ 149 149 grok.name('login') 150 grok.context(IK OFAObject)150 grok.context(IKofaObject) 151 151 grok.require('waeup.Public') 152 152 label = _(u'Login') … … 179 179 180 180 181 class LogoutPage(K OFAPage):181 class LogoutPage(KofaPage): 182 182 """A logout page. Calling this page will log the current user out. 183 183 """ 184 grok.context(IK OFAObject)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 K OFA!"))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(K OFAPage):196 class LanguageChangePage(KofaPage): 197 197 """ Language switch 198 198 """ 199 grok.context(IK OFAObject)199 grok.context(IKofaObject) 200 200 grok.name('change_language') 201 201 grok.require('waeup.Public') … … 213 213 # 214 214 215 class ContactAdminForm(K OFAForm):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 kofa_utils = getUtility(IK OFAUtils)244 kofa_utils = getUtility(IKofaUtils) 245 245 success = kofa_utils.sendContactForm( 246 246 fullname,email, … … 263 263 @action(_('Send now'), style='primary') 264 264 def send(self, *args, **data): 265 kofa_utils = getUtility(IK OFAUtils)265 kofa_utils = getUtility(IKofaUtils) 266 266 success = kofa_utils.sendContactForm( 267 267 data['fullname'],data['email_from'], … … 279 279 # 280 280 281 class UniversityPage(K OFADisplayFormPage):281 class UniversityPage(KofaDisplayFormPage): 282 282 """ The main university page. 283 283 """ … … 290 290 @property 291 291 def frontpage(self): 292 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE292 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 293 293 lang = self.request.cookies.get('kofa.language', portal_language) 294 294 html = self.context['configuration'].frontpage_dict.get(lang,'') … … 297 297 'configuration'].frontpage_dict.get(portal_language,'') 298 298 if html =='': 299 return _(u'<h1>Welcome to WAeUP.K OFA</h1>')299 return _(u'<h1>Welcome to WAeUP.Kofa</h1>') 300 300 else: 301 301 return html 302 302 303 class AdministrationPage(K OFAPage):303 class AdministrationPage(KofaPage): 304 304 """ The administration overview page. 305 305 """ … … 378 378 # 379 379 380 class UsersContainerPage(K OFAPage):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(K OFAAddFormPage):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(K OFAEditFormPage):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 kofa_utils = getUtility(IK OFAUtils)527 kofa_utils = getUtility(IKofaUtils) 528 528 success = kofa_utils.sendContactForm( 529 529 self.request.principal.title,email, … … 550 550 self.widgets['title'].displayWidth = 30 551 551 552 class MyRolesPage(K OFAPage):552 class MyRolesPage(KofaPage): 553 553 """Display site roles and local roles assigned to officers. 554 554 """ … … 581 581 # 582 582 583 class SearchPage(K OFAPage):583 class SearchPage(KofaPage): 584 584 """General search page for the academics section. 585 585 """ … … 608 608 # 609 609 610 class ConfigurationContainerDisplayFormPage(K OFADisplayFormPage):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(K OFAEditFormPage):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(K OFAAddFormPage):686 class SessionConfigurationAddFormPage(KofaAddFormPage): 687 687 """Add a session configuration object to configuration container. 688 688 """ … … 711 711 return 712 712 713 class SessionConfigurationManageFormPage(K OFAEditFormPage):713 class SessionConfigurationManageFormPage(KofaEditFormPage): 714 714 """Manage session configuration object. 715 715 """ … … 742 742 # 743 743 744 class DatacenterPage(K OFAPage):744 class DatacenterPage(KofaPage): 745 745 grok.context(IDataCenter) 746 746 grok.name('index') … … 749 749 pnav = 0 750 750 751 class DatacenterUploadPage(K OFAPage):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(K OFAPage):796 class DatacenterImportStep1(KofaPage): 797 797 """Manual import step 1: choose file 798 798 """ … … 824 824 self.redirect(self.url(self.context, '@@import2')) 825 825 826 class DatacenterImportStep2(K OFAPage):826 class DatacenterImportStep2(KofaPage): 827 827 """Manual import step 2: choose importer 828 828 """ … … 944 944 self.flash(warnings) 945 945 946 class DatacenterImportStep3(K OFAPage):946 class DatacenterImportStep3(KofaPage): 947 947 """Manual import step 3: modify header 948 948 """ … … 1052 1052 self.flash(warnings) 1053 1053 1054 class DatacenterImportStep4(K OFAPage):1054 class DatacenterImportStep4(KofaPage): 1055 1055 """Manual import step 4: do actual import 1056 1056 """ … … 1111 1111 mapping = {'a':linenum - self.warn_num})) 1112 1112 1113 class DatacenterLogsOverview(K OFAPage):1113 class DatacenterLogsOverview(KofaPage): 1114 1114 grok.context(IDataCenter) 1115 1115 grok.name('logs') … … 1133 1133 self.files = self.context.getLogFiles() 1134 1134 1135 class DatacenterLogsFileview(K OFAPage):1135 class DatacenterLogsFileview(KofaPage): 1136 1136 grok.context(IDataCenter) 1137 1137 grok.name('show') … … 1172 1172 popen.close() 1173 1173 1174 class DatacenterSettings(K OFAPage):1174 class DatacenterSettings(KofaPage): 1175 1175 grok.context(IDataCenter) 1176 1176 grok.name('manage') … … 1215 1215 1216 1216 def render(self): 1217 exporter = IK OFAXMLExporter(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(K OFAPage):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 = IK OFAXMLImporter(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(K OFAPage):1259 class FacultiesContainerPage(KofaPage): 1260 1260 """ Index page for faculty containers. 1261 1261 """ … … 1267 1267 grok.template('facultypage') 1268 1268 1269 class FacultiesContainerManageFormPage(K OFAEditFormPage):1269 class FacultiesContainerManageFormPage(KofaEditFormPage): 1270 1270 """Manage the basic properties of a `Faculty` instance. 1271 1271 """ … … 1302 1302 1303 1303 1304 class FacultyAddFormPage(K OFAAddFormPage):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(K OFAPage):1332 class FacultyPage(KofaPage): 1333 1333 """Index page of faculties. 1334 1334 """ … … 1342 1342 return _('Departments') 1343 1343 1344 class FacultyManageFormPage(K OFAEditFormPage):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(K OFAAddFormPage):1418 class DepartmentAddFormPage(KofaAddFormPage): 1419 1419 """Add a department to a faculty. 1420 1420 """ … … 1446 1446 # Department pages 1447 1447 # 1448 class DepartmentPage(K OFAPage):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(K OFAPage):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(K OFAEditFormPage):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(K OFAAddFormPage):1614 class CourseAddFormPage(KofaAddFormPage): 1615 1615 """Add-form to add course to a department. 1616 1616 """ … … 1649 1649 return 1650 1650 1651 class CertificateAddFormPage(K OFAAddFormPage):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(K OFADisplayFormPage):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(K OFAEditFormPage):1705 class CourseManageFormPage(KofaEditFormPage): 1706 1706 """Edit form page for courses. 1707 1707 """ … … 1734 1734 # Certificate pages 1735 1735 # 1736 class CertificatePage(K OFADisplayFormPage):1736 class CertificatePage(KofaDisplayFormPage): 1737 1737 """Index page for certificates. 1738 1738 """ … … 1752 1752 return super(CertificatePage, self).update() 1753 1753 1754 class CertificateManageFormPage(K OFAEditFormPage):1754 class CertificateManageFormPage(KofaEditFormPage): 1755 1755 """Manage the properties of a `Certificate` instance. 1756 1756 """ … … 1830 1830 1831 1831 1832 class CertificateCourseAddFormPage(K OFAAddFormPage):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(K OFAPage):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(K OFAEditFormPage):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
r7811 r7819 262 262 depends=[jquery]) 263 263 264 #: Register basic K OFACSS (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( -
main/waeup.kofa/trunk/src/waeup/kofa/browser/theming.py
r7811 r7819 23 23 from zope.interface import Interface 24 24 from zope.schema.interfaces import IVocabularyFactory 25 from waeup.kofa.interfaces import SimpleK OFAVocabulary25 from waeup.kofa.interfaces import SimpleKofaVocabulary 26 26 from waeup.kofa.browser.interfaces import ITheme 27 27 from waeup.kofa.browser.resources import ( … … 29 29 ) 30 30 31 class K OFAThemeBase(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 K OFAThemeRed1(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 K OFAThemeGray1(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 K OFAThemeEmpty(grok.GlobalUtility):58 class KofaThemeEmpty(grok.GlobalUtility): 59 59 """A theme based on jQuery only. 60 60 … … 112 112 terms = [(theme.description, name) 113 113 for name, theme in get_all_themes()] 114 vocab = SimpleK OFAVocabulary(*terms)114 vocab = SimpleKofaVocabulary(*terms) 115 115 return vocab -
main/waeup.kofa/trunk/src/waeup/kofa/browser/viewlets.py
r7817 r7819 31 31 ICertificateCourse, IBreadcrumbContainer, IUniversity, IUsersContainer) 32 32 from waeup.kofa.interfaces import ( 33 IK OFAUtils, IKOFAObject, IKOFAXMLExporter,34 IK OFAXMLImporter, IDataCenter, IUserAccount)35 from waeup.kofa.browser.layout import K OFAPage, default_primary_nav_template33 IKofaUtils, IKofaObject, IKofaXMLExporter, 34 IKofaXMLImporter, IDataCenter, IUserAccount) 35 from waeup.kofa.browser.layout import KofaPage, default_primary_nav_template 36 36 from waeup.kofa.utils.helpers import get_user_account 37 37 … … 39 39 40 40 grok.templatedir('templates') 41 grok.context(IK OFAObject) # Make IKOFAObject 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(IK OFAObject)87 grok.context(IKofaObject) 88 88 grok.viewletmanager(ActionBar) 89 89 icon = 'actionicon_modify.png' # File must exist in static/ … … 196 196 197 197 class BreadCrumbs(grok.Viewlet): 198 grok.context(IK OFAObject)198 grok.context(IKofaObject) 199 199 grok.viewletmanager(BreadCrumbManager) 200 200 grok.order(1) … … 216 216 """ 217 217 grok.viewletmanager(LanguageManager) 218 grok.context(IK OFAObject)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(IK OFAUtils).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(IK OFAObject)259 grok.context(IKofaObject) 260 260 grok.order(5) 261 261 grok.require('waeup.manageUniversity') … … 316 316 """ 317 317 grok.viewletmanager(LeftSidebar) 318 grok.context(IK OFAObject)318 grok.context(IKofaObject) 319 319 grok.view(Interface) 320 320 grok.order(2) … … 350 350 """ 351 351 grok.viewletmanager(LeftSidebar) 352 grok.context(IK OFAObject)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(IK OFAObject)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 K OFA.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
r7811 r7819 31 31 32 32 # not yet used 33 class K OFAQuery(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(K OFAQuery)52 grok.global_utility(KofaQuery) 53 53 54 54 # not yet used -
main/waeup.kofa/trunk/src/waeup/kofa/catalog.txt
r7811 r7819 1 :mod:`waeup.kofa.catalog` -- Cataloging support K OFA1 :mod:`waeup.kofa.catalog` -- Cataloging support Kofa 2 2 **************************************************** 3 3 … … 5 5 6 6 Components that support cataloging and searching objects inside a 7 K OFAsite.7 Kofa site. 8 8 9 9 .. :doctest: 10 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer10 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 11 11 12 12 .. contents:: … … 15 15 ======= 16 16 17 :class:`K OFAQuery`17 :class:`KofaQuery` 18 18 ------------------ 19 19 20 .. class:: K OFAQuery()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, `K OFAQuery` 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 K OFAQuery 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.kofa.catalog.K OFAQuery 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 K OFAQuery (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 ``K OFAQuery``:206 ``KofaQuery``: 207 207 208 208 >>> r2 = q.searchResults(subquery1) -
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """K OFAdata center.18 """Kofa data center. 19 19 20 20 The waeup data center cares for management of upload data and provides -
main/waeup.kofa/trunk/src/waeup/kofa/datacenter.txt
r7811 r7819 1 K OFAData Center1 Kofa Data Center 2 2 **************** 3 3 4 The K OFAdata 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.kofa.testing.K OFAUnitTestLayer7 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 8 8 9 9 Creating a data center -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/browser.py
r7811 r7819 23 23 from zope.component import getUtility 24 24 from waeup.kofa.browser import ( 25 K OFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,25 KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 26 26 NullValidator) 27 27 from waeup.kofa.browser.breadcrumbs import Breadcrumb … … 32 32 ManageActionButton, PrimaryNavTab) 33 33 from waeup.kofa.browser.layout import jsaction, action 34 from waeup.kofa.interfaces import IK OFAObject, IKOFAUtils34 from waeup.kofa.interfaces import IKofaObject, IKofaUtils 35 35 from waeup.kofa.interfaces import MessageFactory as _ 36 36 from waeup.kofa.hostels.vocabularies import NOT_OCCUPIED … … 61 61 """ 62 62 63 grok.context(IK OFAObject)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(K OFADisplayFormPage):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(K OFADisplayFormPage):115 class HostelsContainerManagePage(KofaDisplayFormPage): 116 116 """The manage page for hostel containers. 117 117 """ … … 148 148 return 149 149 150 class HostelAddFormPage(K OFAAddFormPage):150 class HostelAddFormPage(KofaAddFormPage): 151 151 """Add-form to add a hostel. 152 152 """ … … 175 175 return 176 176 177 class HostelDisplayFormPage(K OFADisplayFormPage):177 class HostelDisplayFormPage(KofaDisplayFormPage): 178 178 """ Page to display hostel data 179 179 """ … … 196 196 target = 'manage' 197 197 198 class HostelManageFormPage(K OFAEditFormPage):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(IK OFAUtils).PORTAL_LANGUAGE263 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 264 264 preferred_language = self.request.cookies.get( 265 265 'kofa.language', portal_language) … … 306 306 return 307 307 308 class BedManageFormPage(K OFAEditFormPage):308 class BedManageFormPage(KofaEditFormPage): 309 309 """ View to edit bed data 310 310 """ -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/interfaces.py
r7811 r7819 18 18 from zope.interface import invariant, Invalid 19 19 from zope import schema 20 from waeup.kofa.interfaces import IK OFAObject20 from waeup.kofa.interfaces import IKofaObject 21 21 from waeup.kofa.interfaces import MessageFactory as _ 22 22 from waeup.kofa.hostels.vocabularies import ( 23 23 bed_letters, blocks, special_handling, StudentSource) 24 24 25 class IHostelsContainer(IK OFAObject):25 class IHostelsContainer(IKofaObject): 26 26 """A container for all kind of hostel objects. 27 27 28 28 """ 29 29 30 class IHostel(IK OFAObject):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(IK OFAObject):148 class IBed(IKofaObject): 149 149 """A base representation of beds. 150 150 -
main/waeup.kofa/trunk/src/waeup/kofa/hostels/vocabularies.py
r7811 r7819 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zc.sourcefactory.contextual import BasicContextualSourceFactory 24 from waeup.kofa.interfaces import SimpleK OFAVocabulary24 from waeup.kofa.interfaces import SimpleKofaVocabulary 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 … … 54 54 return "%s - %s" % (value, self.acco_students(context)[value]) 55 55 56 bed_letters = SimpleK OFAVocabulary(56 bed_letters = SimpleKofaVocabulary( 57 57 (_('Bed A'),'A'), 58 58 (_('Bed B'),'B'), … … 66 66 ) 67 67 68 blocks = SimpleK OFAVocabulary(68 blocks = SimpleKofaVocabulary( 69 69 (_('Block A'),'A'), 70 70 (_('Block B'),'B'), … … 84 84 ) 85 85 86 special_handling = SimpleK OFAVocabulary(86 special_handling = SimpleKofaVocabulary( 87 87 (_('Regular Hostel'),'regular'), 88 88 (_('Blocked Hostel'),'blocked'), -
main/waeup.kofa/trunk/src/waeup/kofa/image/README.txt
r7811 r7819 2 2 ======================================== 3 3 4 The image file widget is built on top of the :class:`K OFAImageFile` object::5 6 >>> from waeup.kofa.image import K OFAImageFile7 >>> file = K OFAImageFile('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 K OFAImageFile 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 K OFAImageFile 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 = K OFAImageFile('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 = K OFAImageFile('foo.jpg', 'data')104 >>> file = KofaImageFile('foo.jpg', 'data') 105 105 >>> f = file.file 106 106 >>> f.read() … … 141 141 Traceback (most recent call last): 142 142 ... 143 WrongType: ('asd', <class 'waeup.kofa.image.image.K OFAImageFile'>, 'foo')143 WrongType: ('asd', <class 'waeup.kofa.image.image.KofaImageFile'>, 'foo') 144 144 145 145 which means: `ImageFile` fields should better contain 146 :class:`K OFAImageFile` instances.147 148 We can store normal :class:`K OFAImageFile` instances:149 150 >>> field.validate(K OFAImageFile('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 ... K OFAImageFile('bar.jpg', '123456789012')) is None176 True 177 178 >>> field.validate( 179 ... K OFAImageFile('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 ... K OFAImageFile('bar.jpg', '1234567890123'))185 ... KofaImageFile('bar.jpg', '1234567890123')) 186 186 Traceback (most recent call last): 187 187 ... … … 189 189 190 190 >>> field.validate( 191 ... K OFAImageFile('bar.jpg', '1234'))191 ... KofaImageFile('bar.jpg', '1234')) 192 192 Traceback (most recent call last): 193 193 ... … … 198 198 ---------------------------- 199 199 200 K OFAImageFile 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 = K OFAImageFile('bar.jpg', '123456789')204 >>> f2 = K OFAImageFile('bar.jpg', '123456789')205 >>> f3 = K OFAImageFile('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
r7811 r7819 3 3 Includings schemas, widgets and the content components. 4 4 """ 5 from waeup.kofa.image.image import K OFAImageFile, createKOFAImageFile5 from waeup.kofa.image.image import KofaImageFile, createKofaImageFile 6 6 7 7 __all__ = [ 8 "K OFAImageFile",9 "createK OFAImageFile",8 "KofaImageFile", 9 "createKofaImageFile", 10 10 ] -
main/waeup.kofa/trunk/src/waeup/kofa/image/browser/tests/image.txt
r7811 r7819 12 12 13 13 >>> import os 14 >>> from waeup.kofa.image import K OFAImageFile14 >>> 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 = K OFAImageFile('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' … … 166 166 prepare some new file: 167 167 168 >>> another_file = K OFAImageFile('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.kofa.image.K OFAImageFile` 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 = K OFAImageFile(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 K OFAImageFile object with that262 file retrieval and then create a KofaImageFile object with that 263 263 file_id stored: 264 264 265 >>> from waeup.kofa.image import createK OFAImageFile266 >>> image = createK OFAImageFile(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 createK OFAImageFile 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/widget.py
r7811 r7819 19 19 """ 20 20 import os 21 from waeup.kofa.image import K OFAImageFile21 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 K OFAImageFile(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 K OFAImageFile(filename, filedata)145 return KofaImageFile(filename, filedata) 146 146 147 147 class ThumbnailWidget(DownloadWidget): -
main/waeup.kofa/trunk/src/waeup/kofa/image/image.py
r7811 r7819 23 23 from zope.component import getUtility 24 24 from zope.interface import implements 25 from waeup.kofa.image.interfaces import IK OFAImageFile25 from waeup.kofa.image.interfaces import IKofaImageFile 26 26 27 class K OFAImageFile(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:`K OFAImageFile` you should use35 :func:`createK OFAImageFile`.34 To create a :class:`KofaImageFile` you should use 35 :func:`createKofaImageFile`. 36 36 """ 37 implements(IK OFAImageFile)37 implements(IKofaImageFile) 38 38 39 39 def __ne__(self, other): … … 45 45 return True 46 46 47 def createK OFAImageFile(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
r7811 r7819 24 24 """ 25 25 26 class IK OFAImageFile(IHurryFile):26 class IKofaImageFile(IHurryFile): 27 27 """Image file. 28 28 """ -
main/waeup.kofa/trunk/src/waeup/kofa/image/schema.py
r7811 r7819 23 23 from hurry.file.schema import File 24 24 from waeup.kofa.image.interfaces import IImageFile 25 from waeup.kofa.image.image import K OFAImageFile25 from waeup.kofa.image.image import KofaImageFile 26 26 27 27 class MinMaxSize(object): … … 82 82 implements(IImageFile) 83 83 84 _type = K OFAImageFile84 _type = KofaImageFile -
main/waeup.kofa/trunk/src/waeup/kofa/interfaces.py
r7817 r7819 50 50 encoding='utf-8', mode='rb').read() 51 51 52 def SimpleK OFAVocabulary(*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 = SimpleK OFAVocabulary(*academic_sessions())69 70 registration_states_vocab = SimpleK OFAVocabulary(68 academic_sessions_vocab = SimpleKofaVocabulary(*academic_sessions()) 69 70 registration_states_vocab = SimpleKofaVocabulary( 71 71 (_('created'), CREATED), 72 72 (_('admitted'), ADMITTED), … … 187 187 """ 188 188 189 class IK OFAUtils(Interface):189 class IKofaUtils(Interface): 190 190 """A collection of methods which are subject to customization. 191 191 """ … … 222 222 """ 223 223 224 class IK OFAObject(Interface):225 """A K OFAobject.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(IK OFAObject):230 class IUniversity(IKofaObject): 231 231 """Representation of a university. 232 232 """ 233 233 234 234 235 class IK OFAContainer(IKOFAObject):236 """A container for K OFAobjects.237 """ 238 239 class IK OFAContained(IKOFAObject):240 """An item contained in an IK OFAContainer.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 IK OFAExporter(Interface):269 class IKofaExporter(Interface): 270 270 """An exporter for objects. 271 271 """ … … 279 279 """ 280 280 281 class IK OFAXMLExporter(Interface):281 class IKofaXMLExporter(Interface): 282 282 """An XML exporter for objects. 283 283 """ … … 291 291 """ 292 292 293 class IK OFAXMLImporter(Interface):293 class IKofaXMLImporter(Interface): 294 294 """An XML import for objects. 295 295 """ … … 328 328 """ 329 329 330 class IContactForm(IK OFAObject):330 class IContactForm(IKofaObject): 331 331 """A contact form. 332 332 """ … … 358 358 required = True,) 359 359 360 class IK OFAPrincipalInfo(IPrincipalInfo):361 """Infos about principals that are users of K OFA KOFA.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 IK OFAPrincipal(IPrincipal):368 """A principle for K OFA KOFA.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(IK OFAObject):384 class IUserAccount(IKofaObject): 385 385 """A user account. 386 386 """ … … 425 425 426 426 427 class IUsersContainer(IK OFAObject):427 class IUsersContainer(IKofaObject): 428 428 """A container for users (principals). 429 429 … … 450 450 """ 451 451 452 class IConfigurationContainer(IK OFAObject):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.K OFA',464 default = u'WAeUP.Kofa', 465 465 required = True, 466 466 ) … … 516 516 email_subject = schema.TextLine( 517 517 title = u'Subject of Email to Administrator', 518 default = u'K OFAContact',518 default = u'Kofa Contact', 519 519 required = False, 520 520 ) … … 539 539 ) 540 540 541 class ISessionConfiguration(IK OFAObject):541 class ISessionConfiguration(IKofaObject): 542 542 """A session configuration object. 543 543 """ … … 606 606 'academic_session'].order 607 607 608 class IDataCenter(IK OFAObject):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 IK OFAPluggable(Interface):672 """A component that might be plugged into a K OFA KOFAapp.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 … … 807 807 """ 808 808 809 class IK OFAWorkflowInfo(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 K OFALoggers")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 K OFAlogger 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 K OFAImageFile 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
r7811 r7819 22 22 from zope.i18n.interfaces import IUserPreferredLanguages 23 23 from waeup.kofa.configuration import ConfigurationContainer 24 from waeup.kofa.interfaces import IK OFAUtils24 from waeup.kofa.interfaces import IKofaUtils 25 25 26 class K OFALanguage(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(IK OFAUtils).PORTAL_LANGUAGE32 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 33 33 34 34 # This an adapter for the request, so self.context is the request. -
main/waeup.kofa/trunk/src/waeup/kofa/meta.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Grokkers for K OFAcomponents.18 """Grokkers for Kofa components. 19 19 20 20 Stuff in here is mainly taken from grok.meta, with some modifications … … 61 61 return False 62 62 63 subscriber = K OFAIndexesUpgradeSubscriber(63 subscriber = KofaIndexesUpgradeSubscriber( 64 64 catalog_name, indexes, context, module_info) 65 65 subscribed = (site, IObjectUpgradeEvent) … … 72 72 73 73 74 class K OFAIndexesUpgradeSubscriber(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/objecthistory.py
r7811 r7819 22 22 from zope.i18n import translate 23 23 from zope.annotation.interfaces import IAnnotations 24 from waeup.kofa.interfaces import IObjectHistory, IK OFAObject, IKOFAUtils24 from waeup.kofa.interfaces import IObjectHistory, IKofaObject, IKofaUtils 25 25 from waeup.kofa.utils.helpers import get_current_principal 26 26 … … 30 30 """A history for objects. 31 31 32 For any object implementing `IK OFAObject` 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(IK OFAObject)36 grok.context(IKofaObject) 37 37 grok.implements(IObjectHistory) 38 38 … … 68 68 else: 69 69 user = user.title 70 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE70 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 71 71 by = 'by' 72 72 if portal_language != 'en': -
main/waeup.kofa/trunk/src/waeup/kofa/payments/interfaces.py
r7811 r7819 18 18 from zope.interface import Attribute 19 19 from zope import schema 20 from waeup.kofa.interfaces import IK OFAObject, SimpleKOFAVocabulary20 from waeup.kofa.interfaces import IKofaObject, SimpleKofaVocabulary 21 21 from waeup.kofa.interfaces import MessageFactory as _ 22 22 23 payment_states = SimpleK OFAVocabulary(23 payment_states = SimpleKofaVocabulary( 24 24 (_('Not yet paid'),'unpaid'), 25 25 (_('Paid'),'paid'), … … 27 27 ) 28 28 29 payment_categories = SimpleK OFAVocabulary(29 payment_categories = SimpleKofaVocabulary( 30 30 (_('School Fee'),'schoolfee'), 31 31 (_('Clearance'),'clearance'), … … 37 37 ) 38 38 39 class IPaymentsContainer(IK OFAObject):39 class IPaymentsContainer(IKofaObject): 40 40 """A container for all kind of payment objects. 41 41 42 42 """ 43 43 44 class IPayment(IK OFAObject):44 class IPayment(IKofaObject): 45 45 """A base representation of payments. 46 46 -
main/waeup.kofa/trunk/src/waeup/kofa/permissions.py
r7811 r7819 168 168 169 169 def get_waeup_roles(also_local=False): 170 """Get all K OFAroles.171 172 K OFAroles 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 K OFAroles 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-K OFAroles...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 K OFAroles.192 193 See :func:`get_waeup_roles` for what a 'K OFARole' is.194 195 This function returns a sorted list of K OFArole 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
r7811 r7819 1 K OFApermissions and roles1 Kofa permissions and roles 2 2 ************************** 3 3 4 Permissions and roles used in a K OFAportal.4 Permissions and roles used in a Kofa portal. 5 5 6 6 .. :doctest: 7 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer7 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 8 8 9 9 Convenience functions … … 16 16 --------------------- 17 17 18 Gives us all roles defined in K OFA. We get tuples of18 Gives us all roles defined in Kofa. We get tuples of 19 19 kind 20 20 … … 34 34 ----------------------- 35 35 36 Gives us all roles, except the K OFAspecific 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 … … 48 48 ---------------------------- 49 49 50 We can get all role names defined in K OFA(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 -
main/waeup.kofa/trunk/src/waeup/kofa/schoolgrades.py
r7811 r7819 25 25 from waeup.kofa.interfaces import IResultEntry, IResultEntryField 26 26 from waeup.kofa.widgets.objectwidget import ( 27 K OFAObjectWidget, KOFAObjectDisplayWidget27 KofaObjectWidget, KofaObjectDisplayWidget 28 28 ) 29 29 … … 52 52 return 53 53 54 # register K OFAObjectWidgets 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 K OFAObjectWidget(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 K OFAObjectDisplayWidget(obj, req, ResultEntry)64 return KofaObjectDisplayWidget(obj, req, ResultEntry) -
main/waeup.kofa/trunk/src/waeup/kofa/smtp.py
r7811 r7819 17 17 ## 18 18 """ 19 Email (SMTP) services for K OFA.19 Email (SMTP) services for Kofa. 20 20 21 21 Note About Encodings -
main/waeup.kofa/trunk/src/waeup/kofa/students/authentication.py
r7811 r7819 29 29 from zope.session.interfaces import ISession 30 30 from waeup.kofa.authentication import ( 31 K OFAPrincipalInfo, get_principal_role_manager)31 KofaPrincipalInfo, get_principal_role_manager) 32 32 from waeup.kofa.interfaces import ( 33 33 IAuthPluginUtility, IUserAccount, IPasswordValidator) … … 135 135 if not account.checkPassword(credentials['password']): 136 136 return None 137 return K OFAPrincipalInfo(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/browser.py
r7811 r7819 33 33 from waeup.kofa.accesscodes.workflow import USED 34 34 from waeup.kofa.browser import ( 35 K OFAPage, KOFAEditFormPage, KOFAAddFormPage, KOFADisplayFormPage,36 ContactAdminForm, K OFAForm)35 KofaPage, KofaEditFormPage, KofaAddFormPage, KofaDisplayFormPage, 36 ContactAdminForm, KofaForm) 37 37 from waeup.kofa.browser.interfaces import ICaptchaManager 38 38 from waeup.kofa.browser.breadcrumbs import Breadcrumb … … 40 40 from waeup.kofa.browser.layout import jsaction, action, UtilityView 41 41 from waeup.kofa.interfaces import ( 42 IK OFAObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm,43 IK OFAUtils, IUniversity)42 IKofaObject, IUserAccount, IExtFileStore, IPasswordValidator, IContactForm, 43 IKofaUtils, IUniversity) 44 44 from waeup.kofa.interfaces import MessageFactory as _ 45 45 from waeup.kofa.widgets.datewidget import ( … … 155 155 @property 156 156 def title(self): 157 portal_language = getUtility(IK OFAUtils).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 … … 161 161 target_language=portal_language) 162 162 163 class StudentsContainerPage(K OFAPage):163 class StudentsContainerPage(KofaPage): 164 164 """The standard view for student containers. 165 165 """ … … 194 194 return 195 195 196 class StudentsContainerManagePage(K OFAPage):196 class StudentsContainerManagePage(KofaPage): 197 197 """The manage page for student containers. 198 198 """ … … 245 245 return 246 246 247 class StudentAddFormPage(K OFAAddFormPage):247 class StudentAddFormPage(KofaAddFormPage): 248 248 """Add-form to add a student. 249 249 """ … … 265 265 return 266 266 267 class StudentBaseDisplayFormPage(K OFADisplayFormPage):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 kofa_utils = getUtility(IK OFAUtils)312 kofa_utils = getUtility(IKofaUtils) 313 313 success = kofa_utils.sendContactForm( 314 314 self.request.principal.title,email, … … 323 323 return 324 324 325 class StudentBaseManageFormPage(K OFAEditFormPage):325 class StudentBaseManageFormPage(KofaEditFormPage): 326 326 """ View to manage student base data 327 327 """ … … 388 388 return 389 389 390 class StudentClearanceDisplayFormPage(K OFADisplayFormPage):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(IK OFAUtils).PORTAL_LANGUAGE417 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 418 418 return translate(_('Clearance Data'), 'waeup.kofa', 419 419 target_language=portal_language) … … 421 421 @property 422 422 def label(self): 423 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE423 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 424 424 return translate(_('Clearance Slip of '), 425 425 'waeup.kofa', target_language=portal_language) \ … … 434 434 self.context.getStudent(), studentview) 435 435 436 class StudentClearanceManageFormPage(K OFAEditFormPage):436 class StudentClearanceManageFormPage(KofaEditFormPage): 437 437 """ Page to edit student clearance data 438 438 """ … … 508 508 return 509 509 510 class StudentPersonalDisplayFormPage(K OFADisplayFormPage):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(K OFAEditFormPage):525 class StudentPersonalManageFormPage(KofaEditFormPage): 526 526 """ Page to edit student clearance data 527 527 """ … … 538 538 return 539 539 540 class StudyCourseDisplayFormPage(K OFADisplayFormPage):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(IK OFAUtils).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(K OFAEditFormPage):574 class StudyCourseManageFormPage(KofaEditFormPage): 575 575 """ Page to edit the student study course data 576 576 """ … … 645 645 return 646 646 647 class StudyLevelDisplayFormPage(K OFADisplayFormPage):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(IK OFAUtils).PORTAL_LANGUAGE664 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 665 665 lang = self.request.cookies.get('kofa.language', portal_language) 666 666 level_title = translate(self.context.level_title, 'waeup.kofa', … … 688 688 @property 689 689 def title(self): 690 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE690 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 691 691 return translate(_('Level Data'), 'waeup.kofa', 692 692 target_language=portal_language) … … 694 694 @property 695 695 def content_title(self): 696 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE696 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 697 697 return translate(_('Course List'), 'waeup.kofa', 698 698 target_language=portal_language) … … 700 700 @property 701 701 def label(self): 702 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE702 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 703 703 lang = self.request.cookies.get('kofa.language', portal_language) 704 704 level_title = translate(self.context.level_title, 'waeup.kofa', … … 709 709 710 710 def render(self): 711 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE711 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 712 712 Sem = translate(_('Sem.'), 'waeup.kofa', target_language=portal_language) 713 713 Code = translate(_('Code'), 'waeup.kofa', target_language=portal_language) … … 735 735 tabledata=tabledata) 736 736 737 class StudyLevelManageFormPage(K OFAEditFormPage):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(IK OFAUtils).PORTAL_LANGUAGE764 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 765 765 lang = self.request.cookies.get('kofa.language', portal_language) 766 766 level_title = translate(self.context.level_title, 'waeup.kofa', … … 853 853 return 854 854 855 class CourseTicketAddFormPage(K OFAAddFormPage):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(K OFADisplayFormPage):892 class CourseTicketDisplayFormPage(KofaDisplayFormPage): 893 893 """ Page to display course tickets 894 894 """ … … 906 906 'b':self.context.code}) 907 907 908 class CourseTicketManageFormPage(K OFAEditFormPage):908 class CourseTicketManageFormPage(KofaEditFormPage): 909 909 """ Page to manage course tickets 910 910 """ … … 925 925 return 926 926 927 class PaymentsManageFormPage(K OFAEditFormPage):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(K OFAAddFormPage):984 class OnlinePaymentAddFormPage(KofaAddFormPage): 985 985 """ Page to add an online payment ticket 986 986 """ … … 1039 1039 return 1040 1040 1041 class OnlinePaymentDisplayFormPage(K OFADisplayFormPage):1041 class OnlinePaymentDisplayFormPage(KofaDisplayFormPage): 1042 1042 """ Page to view an online payment ticket 1043 1043 """ … … 1138 1138 1139 1139 1140 class AccommodationManageFormPage(K OFAEditFormPage):1140 class AccommodationManageFormPage(KofaEditFormPage): 1141 1141 """ Page to manage bed tickets. 1142 1142 … … 1195 1195 return self.actions 1196 1196 1197 class BedTicketAddPage(K OFAPage):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(IK OFAUtils).PORTAL_LANGUAGE1289 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1290 1290 bedticket.bed_coordinates = translate( 1291 1291 bc, 'waeup.kofa',target_language=portal_language) … … 1297 1297 return 1298 1298 1299 class BedTicketDisplayFormPage(K OFADisplayFormPage):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(IK OFAUtils).PORTAL_LANGUAGE1327 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1328 1328 return translate(_('Bed Allocation Data'), 'waeup.kofa', 1329 1329 target_language=portal_language) … … 1331 1331 @property 1332 1332 def label(self): 1333 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1333 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1334 1334 return translate(_('Bed Allocation: '), 1335 1335 'waeup.kofa', target_language=portal_language) \ … … 1405 1405 'c':room_nr, 'd':bed_nr, 1406 1406 'e':new_bed.bed_type}) 1407 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE1407 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1408 1408 self.context.bed_coordinates = translate( 1409 1409 bc, 'waeup.kofa',target_language=portal_language) … … 1416 1416 return 1417 1417 1418 class StudentHistoryPage(K OFAPage):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(K OFAEditFormPage):1433 class StudentBaseEditFormPage(KofaEditFormPage): 1434 1434 """ View to edit student base data 1435 1435 """ … … 1447 1447 return 1448 1448 1449 class StudentChangePasswordPage(K OFAEditFormPage):1449 class StudentChangePasswordPage(KofaEditFormPage): 1450 1450 """ View to manage student base data 1451 1451 """ … … 1473 1473 return 1474 1474 1475 class StudentFilesUploadPage(K OFAPage):1475 class StudentFilesUploadPage(KofaPage): 1476 1476 """ View to upload files by student 1477 1477 """ … … 1490 1490 return 1491 1491 1492 class StartClearancePage(K OFAPage):1492 class StartClearancePage(KofaPage): 1493 1493 grok.context(IStudent) 1494 1494 grok.name('start_clearance') … … 1593 1593 return 1594 1594 1595 class RequestClearancePage(K OFAPage):1595 class RequestClearancePage(KofaPage): 1596 1596 grok.context(IStudent) 1597 1597 grok.name('request_clearance') … … 1624 1624 return 1625 1625 1626 class StartCourseRegistrationPage(K OFAPage):1626 class StartCourseRegistrationPage(KofaPage): 1627 1627 grok.context(IStudentStudyCourse) 1628 1628 grok.name('start_course_registration') … … 1673 1673 return 1674 1674 1675 class AddStudyLevelFormPage(K OFAEditFormPage):1675 class AddStudyLevelFormPage(KofaEditFormPage): 1676 1676 """ Page for students to add current study levels 1677 1677 """ … … 1710 1710 return 1711 1711 1712 class StudyLevelEditFormPage(K OFAEditFormPage):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(IK OFAUtils).PORTAL_LANGUAGE1734 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 1735 1735 lang = self.request.cookies.get('kofa.language', portal_language) 1736 1736 level_title = translate(self.context.level_title, 'waeup.kofa', … … 1816 1816 return 1817 1817 1818 class ChangePasswordRequestPage(K OFAForm):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 kofa_utils = getUtility(IK OFAUtils)1853 kofa_utils = getUtility(IKofaUtils) 1854 1854 pwd = kofa_utils.genPassword() 1855 1855 IUserAccount(student).setPassword(pwd) … … 1866 1866 return 1867 1867 1868 class SetPasswordPage(K OFAPage):1869 grok.context(IK OFAObject)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/interfaces.py
r7811 r7819 22 22 from zc.sourcefactory.contextual import BasicContextualSourceFactory 23 23 from waeup.kofa.interfaces import ( 24 IK OFAObject, academic_sessions_vocab, validate_email, IKOFAUtils)24 IKofaObject, academic_sessions_vocab, validate_email, IKofaUtils) 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 from waeup.kofa.schema import TextLineChoice … … 78 78 """ 79 79 80 class IStudentsContainer(IK OFAObject):80 class IStudentsContainer(IKofaObject): 81 81 """A students container contains university students. 82 82 … … 117 117 """ 118 118 119 class IStudentNavigation(IK OFAObject):119 class IStudentNavigation(IKofaObject): 120 120 """Interface needed for student navigation. 121 121 … … 126 126 """ 127 127 128 class IStudentBase(IK OFAObject):128 class IStudentBase(IKofaObject): 129 129 """Representation of student base data. 130 130 … … 206 206 ) 207 207 208 class IStudentClearance(IK OFAObject):208 class IStudentClearance(IKofaObject): 209 209 """Representation of student clearance data. 210 210 … … 234 234 ) 235 235 236 class IStudentPersonal(IK OFAObject):236 class IStudentPersonal(IKofaObject): 237 237 """Representation of student personal data. 238 238 … … 268 268 ) 269 269 270 class IStudentStudyCourse(IK OFAObject):270 class IStudentStudyCourse(IKofaObject): 271 271 """A container for student study levels. 272 272 … … 326 326 ) 327 327 328 class IStudentStudyLevel(IK OFAObject):328 class IStudentStudyLevel(IKofaObject): 329 329 """A container for course tickets. 330 330 … … 348 348 ) 349 349 350 class ICourseTicket(IK OFAObject):350 class ICourseTicket(IKofaObject): 351 351 """A course ticket. 352 352 … … 406 406 ) 407 407 408 class IStudentAccommodation(IK OFAObject):408 class IStudentAccommodation(IKofaObject): 409 409 """A container for student accommodation objects. 410 410 411 411 """ 412 412 413 class IBedTicket(IK OFAObject):413 class IBedTicket(IKofaObject): 414 414 """A ticket for accommodation booking. 415 415 … … 475 475 'p_item'].order 476 476 477 class IStudentChangePassword(IK OFAObject):477 class IStudentChangePassword(IKofaObject): 478 478 """Interface needed for change pasword page. 479 479 -
main/waeup.kofa/trunk/src/waeup/kofa/students/student.py
r7811 r7819 28 28 from waeup.kofa.interfaces import ( 29 29 IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler, 30 IK OFAUtils, CLEARANCE, registration_states_vocab)31 from waeup.kofa.image import K OFAImageFile30 IKofaUtils, CLEARANCE, registration_states_vocab) 31 from waeup.kofa.image import KofaImageFile 32 32 from waeup.kofa.imagestorage import DefaultFileStoreHandler 33 33 from waeup.kofa.students.interfaces import IStudent, IStudentNavigation … … 63 63 def display_fullname(self): 64 64 middlename = getattr(self, 'middlename', None) 65 kofa_utils = getUtility(IK OFAUtils)65 kofa_utils = getUtility(IKofaUtils) 66 66 return kofa_utils.fullname(self.firstname, self.lastname, middlename) 67 67 … … 284 284 StudentFileStoreHandler, self).createFile( 285 285 store, root, filename, file_id, file) 286 return file, path, K OFAImageFile(286 return file, path, KofaImageFile( 287 287 file_obj.filename, file_obj.data) -
main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
r7811 r7819 35 35 from zope.component import getUtility 36 36 from zope.formlib.form import setUpEditWidgets 37 from waeup.kofa.interfaces import IExtFileStore, IK OFAUtils37 from waeup.kofa.interfaces import IExtFileStore, IKofaUtils 38 38 from waeup.kofa.interfaces import MessageFactory as _ 39 39 from waeup.kofa.students.interfaces import IStudentsUtils … … 113 113 data_left.append([doc_img]) 114 114 #data.append([Spacer(1, 12)]) 115 portal_language = getUtility(IK OFAUtils).PORTAL_LANGUAGE115 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 116 116 for widget in studentview.widgets: 117 117 if widget.name == 'form.adm_code': … … 164 164 story = [] 165 165 frame_footer = Frame(1*cm,0,width-(2*cm),1*cm) 166 portal_language = getUtility(IK OFAUtils).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}), … … 256 256 pdf.setAuthor('%s (%s)' % (view.request.principal.title, 257 257 view.request.principal.id)) 258 pdf.setCreator('WAeUP K OFA')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(IK OFAUtils).PORTAL_LANGUAGE277 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 278 278 if student is not None: 279 279 #story.append(Spacer(1, 12)) … … 288 288 set_up_widgets(view) 289 289 data = [] 290 portal_language = getUtility(IK OFAUtils).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( -
main/waeup.kofa/trunk/src/waeup/kofa/students/viewlets.py
r7811 r7819 22 22 from zope.i18n import translate 23 23 from waeup.kofa.interfaces import ( 24 IK OFAObject, IExtFileStore, IFileStoreNameChooser, IKOFAUtils)24 IKofaObject, IExtFileStore, IFileStoreNameChooser, IKofaUtils) 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 from waeup.kofa.utils.helpers import string_from_bytes, file_size … … 48 48 from waeup.kofa.interfaces import MessageFactory as _ 49 49 50 grok.context(IK OFAObject) # Make IKOFAObject the default context50 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(IK OFAObject)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(IK OFAUtils).PORTAL_LANGUAGE75 portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE 76 76 lang = self.request.cookies.get('kofa.language', portal_language) 77 77 text = translate(self.text, 'waeup.kofa', … … 465 465 """ 466 466 467 grok.context(IK OFAObject)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
r7811 r7819 25 25 from zc.sourcefactory.basic import BasicSourceFactory 26 26 from zc.sourcefactory.contextual import BasicContextualSourceFactory 27 from waeup.kofa.interfaces import SimpleK OFAVocabulary27 from waeup.kofa.interfaces import SimpleKofaVocabulary 28 28 from waeup.kofa.interfaces import MessageFactory as _ 29 29 from waeup.kofa.students.lgas import LGAS … … 31 31 from waeup.kofa.university.vocabularies import course_levels 32 32 33 lgas_vocab = SimpleK OFAVocabulary(33 lgas_vocab = SimpleKofaVocabulary( 34 34 *sorted([(x[1],x[0]) for x in LGAS])) 35 35 36 nats_vocab = SimpleK OFAVocabulary(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
r7811 r7819 6 6 from hurry.workflow.interfaces import IWorkflowState, IWorkflowTransitionEvent 7 7 from waeup.kofa.interfaces import ( 8 IObjectHistory, IK OFAWorkflowInfo, IKOFAUtils,8 IObjectHistory, IKofaWorkflowInfo, IKofaUtils, 9 9 CREATED, ADMITTED, CLEARANCE, REQUESTED, CLEARED, PAID, RETURNING, 10 10 REGISTERED, VALIDATED) 11 11 from waeup.kofa.interfaces import MessageFactory as _ 12 from waeup.kofa.workflow import K OFAWorkflow, KOFAWorkflowInfo12 from waeup.kofa.workflow import KofaWorkflow, KofaWorkflowInfo 13 13 from waeup.kofa.students.interfaces import IStudent, IStudentsUtils 14 14 … … 156 156 UNLOCK_CLEARANCE_TRANS = ('reset3', 'reset4', 'start_clearance') 157 157 158 registration_workflow = K OFAWorkflow(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(K OFAWorkflowInfo, 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(IK OFAWorkflowInfo)173 grok.provides(IKofaWorkflowInfo) 174 174 175 175 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/testing.py
r7817 r7819 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.kofa.testing.K OFAUnitTestLayer`.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.kofa.testing.K OFAUnitTestLayer`174 .. seealso:: :class:`waeup.kofa.testing.KofaUnitTestLayer` 175 175 176 176 """ … … 214 214 return 215 215 216 class K OFAUnitTestLayer(object):216 class KofaUnitTestLayer(object): 217 217 """A layer for tests that groks `waeup.kofa`. 218 218 … … 237 237 238 238 import unittest 239 from waeup.kofa.testing import K OFAUnitTestLayer239 from waeup.kofa.testing import KofaUnitTestLayer 240 240 241 241 class MyTestCase(unittest.TestCase): 242 242 243 layer = K OFAUnitTestLayer243 layer = KofaUnitTestLayer 244 244 245 245 # per-test setups and real tests go here... -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_authentication.py
r7811 r7819 24 24 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 25 25 from waeup.kofa.authentication import ( 26 UserAuthenticatorPlugin, Account, K OFAPrincipalInfo,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, K OFAPrincipalInfo))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, K OFAPrincipalInfo))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_interfaces.py
r7811 r7819 48 48 # Register a role not visible to waeup portal as its name does 49 49 # not start with 'waeup.' 50 class NonK OFARole(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('NonK OFARole', NonKOFARole)55 grok.testing.grok_component('NonKofaRole', NonKofaRole) 56 56 return 57 57 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_objecthistory.py
r7811 r7819 26 26 from zope.security.testing import Principal, Participation 27 27 from waeup.kofa.app import University 28 from waeup.kofa.interfaces import IObjectHistory, IK OFAObject28 from waeup.kofa.interfaces import IObjectHistory, IKofaObject 29 29 from waeup.kofa.testing import FunctionalTestCase, FunctionalLayer 30 30 from waeup.kofa.objecthistory import ObjectHistory 31 31 32 32 class SampleObject(grok.Model): 33 grok.implements(IK OFAObject)33 grok.implements(IKofaObject) 34 34 pass 35 35 -
main/waeup.kofa/trunk/src/waeup/kofa/tests/test_smtp.py
r7811 r7819 328 328 'test program', 'no-reply@waeup.org', 329 329 'test mail receiver', EXTERNAL_MAIL_RECEIVER, 330 'Test Mail from WAeUP K OFA',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 K OFA',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/university/certificate.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """K OFAcertificates18 """Kofa certificates 19 19 """ 20 20 import grok -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificate.txt
r7811 r7819 1 :mod:`waeup.kofa.university.certificate` -- Certificates for K OFA1 :mod:`waeup.kofa.university.certificate` -- Certificates for Kofa 2 2 ****************************************************************** 3 3 … … 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 -
main/waeup.kofa/trunk/src/waeup/kofa/university/certificatescontainer.txt
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 -
main/waeup.kofa/trunk/src/waeup/kofa/university/course.txt
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 Content Classes (models and containers) -
main/waeup.kofa/trunk/src/waeup/kofa/university/coursescontainer.txt
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 -
main/waeup.kofa/trunk/src/waeup/kofa/university/department.py
r7811 r7819 24 24 from waeup.kofa.university.coursescontainer import CoursesContainer 25 25 from waeup.kofa.university.certificatescontainer import CertificatesContainer 26 from waeup.kofa.interfaces import IK OFAUtils26 from waeup.kofa.interfaces import IKofaUtils 27 27 from waeup.kofa.university.interfaces import IDepartment, IDepartmentAdd 28 28 … … 73 73 74 74 def longtitle(self): 75 insttypes_dict = getUtility(IK OFAUtils).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
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 Content Classes (models and containers) -
main/waeup.kofa/trunk/src/waeup/kofa/university/facultiescontainer.py
r7811 r7819 19 19 from zope.component.interfaces import IFactory 20 20 from zope.interface import implementedBy 21 from waeup.kofa.interfaces import IK OFAPluggable21 from waeup.kofa.interfaces import IKofaPluggable 22 22 from waeup.kofa.university.interfaces import IFacultiesContainer, IFaculty 23 23 … … 52 52 """A plugin that creates container for faculties inside a university. 53 53 """ 54 grok.implements(IK OFAPluggable)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 K OFA.')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
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 … … 77 77 .. class:: AcademicsPlugin() 78 78 79 .. attribute:: grok.implements(IK OFAPluggable)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 K OFA82 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 K OFAapps.84 instances, which serve as root object for academics stuff in Kofa apps. 85 85 86 86 -
main/waeup.kofa/trunk/src/waeup/kofa/university/faculty.py
r7811 r7819 23 23 from zope.interface import implementedBy 24 24 from zope.component import getUtility 25 from waeup.kofa.interfaces import IK OFAUtils25 from waeup.kofa.interfaces import IKofaUtils 26 26 from waeup.kofa.university.interfaces import ( 27 27 IFaculty, IFacultyAdd, IDepartment) … … 61 61 62 62 def longtitle(self): 63 insttypes_dict = getUtility(IK OFAUtils).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
r7811 r7819 7 7 8 8 .. :doctest: 9 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer9 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 10 10 11 11 -
main/waeup.kofa/trunk/src/waeup/kofa/university/interfaces.py
r7811 r7819 21 21 from zope import schema 22 22 from zope.interface import Attribute 23 from waeup.kofa.interfaces import (IK OFAObject, IKOFAContainer)23 from waeup.kofa.interfaces import (IKofaObject, IKofaContainer) 24 24 from waeup.kofa.interfaces import MessageFactory as _ 25 25 from waeup.kofa.university.vocabularies import ( … … 32 32 ) 33 33 34 class IFaculty(IK OFAContainer):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(IK OFAContainer):75 class IFacultiesContainer(IKofaContainer): 76 76 """A container for faculties. 77 77 """ … … 80 80 81 81 """ 82 class IDepartment(IK OFAObject):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(IK OFAContainer):126 class ICoursesContainer(IKofaContainer): 127 127 """A container for faculties. 128 128 """ … … 133 133 """ 134 134 135 class ICourse(IK OFAObject):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(IK OFAObject):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(IK OFAContainer):250 class ICertificatesContainer(IKofaContainer): 251 251 """A container for certificates. 252 252 """ … … 257 257 """ 258 258 259 class ICertificateCourse(IK OFAObject):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_export.py
r7811 r7819 23 23 from zope.interface.verify import verifyObject, verifyClass 24 24 from waeup.kofa.interfaces import ICSVExporter 25 from waeup.kofa.testing import K OFAUnitTestLayer25 from waeup.kofa.testing import KofaUnitTestLayer 26 26 from waeup.kofa.university import ( 27 27 FacultiesContainer, Faculty, Department, Course, Certificate, … … 34 34 class FacultyExporterTest(unittest.TestCase): 35 35 36 layer = K OFAUnitTestLayer36 layer = KofaUnitTestLayer 37 37 38 38 def setUp(self): … … 123 123 # Tests for DepartmentExporter 124 124 125 layer = K OFAUnitTestLayer125 layer = KofaUnitTestLayer 126 126 127 127 def setUp(self): … … 214 214 # Tests for CourseExporter 215 215 216 layer = K OFAUnitTestLayer216 layer = KofaUnitTestLayer 217 217 218 218 def setUp(self): … … 307 307 # Tests for CertificateExporter 308 308 309 layer = K OFAUnitTestLayer309 layer = KofaUnitTestLayer 310 310 311 311 def setUp(self): … … 412 412 # Tests for CertificateCourseExporter 413 413 414 layer = K OFAUnitTestLayer414 layer = KofaUnitTestLayer 415 415 416 416 def setUp(self): -
main/waeup.kofa/trunk/src/waeup/kofa/university/tests/test_facultiescontainer.py
r7811 r7819 90 90 self.assertEqual( 91 91 self._logger_factory.get_messages(), 92 'Could not create container for faculties in K OFA.\n'92 'Could not create container for faculties in Kofa.\n' 93 93 ) 94 94 -
main/waeup.kofa/trunk/src/waeup/kofa/university/vocabularies.py
r7811 r7819 22 22 from zope.catalog.interfaces import ICatalog 23 23 from zope.component import getUtility 24 from waeup.kofa.interfaces import SimpleK OFAVocabulary, IKOFAUtils24 from waeup.kofa.interfaces import SimpleKofaVocabulary, IKofaUtils 25 25 from waeup.kofa.interfaces import MessageFactory as _ 26 26 27 course_levels = SimpleK OFAVocabulary(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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).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(IK OFAUtils).getStudyModesDict()95 studymodes_dict = getUtility(IKofaUtils).getStudyModesDict() 96 96 return studymodes_dict[value] 97 97 -
main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """Users container for the K OFAportal.18 """Users container for the Kofa portal. 19 19 """ 20 20 import grok -
main/waeup.kofa/trunk/src/waeup/kofa/userscontainer.txt
r7811 r7819 1 User container for the K OFA1 User container for the Kofa 2 2 *************************** 3 3 4 4 .. :doctest: 5 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer5 .. :layer: waeup.kofa.testing.KofaUnitTestLayer 6 6 7 7 Before we can start, we need some password managers available: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/batching.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """K OFAcomponents 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 -
main/waeup.kofa/trunk/src/waeup/kofa/utils/converters.txt
r7811 r7819 10 10 11 11 .. :NOdoctest: 12 .. :NOlayer: waeup.kofa.testing.K OFAUnitTestLayer12 .. :NOlayer: waeup.kofa.testing.KofaUnitTestLayer 13 13 14 14 … … 672 672 '1' 673 673 674 >>> from waeup.kofa.interfaces import SimpleK OFAVocabulary674 >>> from waeup.kofa.interfaces import SimpleKofaVocabulary 675 675 >>> field = Choice( 676 676 ... title = u'Favourite Dish', 677 677 ... default = 0, 678 ... vocabulary = SimpleK OFAVocabulary(678 ... vocabulary = SimpleKofaVocabulary( 679 679 ... ('N/A', 0), ('Pizza', 1), 680 680 ... ('Cake', 2), ('Muffins', 3)), -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper functions for K OFA.18 """General helper functions for Kofa. 19 19 """ 20 20 import os -
main/waeup.kofa/trunk/src/waeup/kofa/utils/helpers.txt
r7811 r7819 1 :mod:`waeup.kofa.utils.helpers` -- Helpers for K OFA1 :mod:`waeup.kofa.utils.helpers` -- Helpers for Kofa 2 2 *************************************************** 3 3 4 4 .. module:: waeup.kofa.utils.helpers 5 5 6 Helper functions for K OFA.6 Helper functions for Kofa. 7 7 8 8 .. :doctest: -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.py
r7811 r7819 22 22 from cStringIO import StringIO 23 23 from zope.interface import Interface 24 from waeup.kofa.interfaces import (IK OFAObject, IKOFAExporter,25 IK OFAXMLExporter, IKOFAXMLImporter)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 K OFAobject 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(IK OFAObject)48 grok.provides(IK OFAExporter)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 K OFAobject 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(IK OFAXMLExporter)69 grok.provides(IKofaXMLExporter) 70 70 71 71 def __init__(self, context): … … 84 84 85 85 class XMLImporter(grok.Adapter): 86 """Import a K OFAobject from XML.86 """Import a Kofa object from XML. 87 87 """ 88 88 grok.context(Interface) 89 grok.provides(IK OFAXMLImporter)89 grok.provides(IKofaXMLImporter) 90 90 91 91 def __init__(self, context): -
main/waeup.kofa/trunk/src/waeup/kofa/utils/importexport.txt
r7811 r7819 6 6 7 7 .. :doctest: 8 .. :layer: waeup.kofa.testing.K OFAUnitTestLayer8 .. :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.kofa.interfaces import IK OFAXMLExporter63 >>> exporter = IK OFAXMLExporter(mycave)62 >>> from waeup.kofa.interfaces import IKofaXMLExporter 63 >>> exporter = IKofaXMLExporter(mycave) 64 64 >>> exporter 65 65 <waeup.kofa.utils.importexport.XMLExporter object at 0x...> … … 101 101 Now we create an importer for that object: 102 102 103 >>> from waeup.kofa.interfaces import IK OFAXMLImporter104 >>> importer = IK OFAXMLImporter(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/tests/test_converters.py
r7811 r7819 36 36 from waeup.kofa.utils.converters import IObjectConverter 37 37 from waeup.kofa.utils.helpers import attrs_to_fields 38 from waeup.kofa.interfaces import SimpleK OFAVocabulary39 40 colors = SimpleK OFAVocabulary(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 = SimpleK OFAVocabulary(45 car_nums = SimpleKofaVocabulary( 46 46 ('None', 0), 47 47 ('One', 1), -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r7811 r7819 16 16 ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 ## 18 """General helper utilities for K OFA.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.kofa.interfaces import IK OFAUtils25 from waeup.kofa.interfaces import IKofaUtils 26 26 from waeup.kofa.interfaces import MessageFactory as _ 27 27 from waeup.kofa.smtp import send_mail as send_mail_internally … … 37 37 return True 38 38 39 class K OFAUtils(grok.GlobalUtility):39 class KofaUtils(grok.GlobalUtility): 40 40 """A collection of parameters and methods subject to customization. 41 41 """ 42 grok.implements(IK OFAUtils)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 … … 161 161 Returns True or False to indicate successful operation. 162 162 """ 163 subject = 'Your K OFAcredentials'163 subject = 'Your Kofa credentials' 164 164 text = _(u"""Dear ${a}, 165 165 -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/objectwidget.py
r7811 r7819 25 25 from zope.schema import getFieldNamesInOrder 26 26 27 class K OFAObjectWidgetView(ObjectWidgetView):27 class KofaObjectWidgetView(ObjectWidgetView): 28 28 template = ViewPageTemplateFile('objectwidget.pt') 29 29 30 class K OFAObjectWidget(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 K OFAObjectWidgetView(self, request)60 return KofaObjectWidgetView(self, request) 61 61 62 62 63 class K OFAObjectDisplayWidget(KOFAObjectWidget):63 class KofaObjectDisplayWidget(KofaObjectWidget): 64 64 65 65 implementsOnly(IDisplayWidget) -
main/waeup.kofa/trunk/src/waeup/kofa/widgets/restwidget.py
r7811 r7819 21 21 from zope.formlib.widget import renderElement, DisplayWidget 22 22 from waeup.kofa.utils.helpers import ReST2HTML 23 from waeup.kofa.interfaces import IK OFAUtils23 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.K OFAUtils.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(IK OFAUtils).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.py
r7811 r7819 29 29 from zope.schema.interfaces import IField, IList 30 30 31 class K OFASequenceWidget(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 K OFASequenceWidget(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_objectwidget.py
r7811 r7819 37 37 from zope.formlib.interfaces import IWidgetInputErrorView 38 38 39 from waeup.kofa.widgets.objectwidget import K OFAObjectWidget as ObjectWidget39 from waeup.kofa.widgets.objectwidget import KofaObjectWidget as ObjectWidget 40 40 from waeup.kofa.widgets.objectwidget import ( 41 K OFAObjectDisplayWidget as ObjectDisplayWidget)41 KofaObjectDisplayWidget as ObjectDisplayWidget) 42 42 43 43 class ITestContact(Interface): -
main/waeup.kofa/trunk/src/waeup/kofa/workflow.py
r7811 r7819 25 25 from zope.security.interfaces import NoInteraction 26 26 from zope.security.management import getInteraction 27 from waeup.kofa.interfaces import IK OFAWorkflowInfo27 from waeup.kofa.interfaces import IKofaWorkflowInfo 28 28 29 class K OFAWorkflow(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 K OFAWorkflowInfo(WorkflowInfo):73 class KofaWorkflowInfo(WorkflowInfo): 74 74 """A workflow info that provides a convenience transition getter. 75 75 """ 76 76 77 grok.provides(IK OFAWorkflowInfo)77 grok.provides(IKofaWorkflowInfo) 78 78 79 79 def getManualTransitions(self):
Note: See TracChangeset for help on using the changeset viewer.