EduploneExam registry.py,NONE,1.1 ExamFolder.py,1.1,1.2
Jens Klein <[email protected]>
| Newsgroups | gmane.comp.web.zope.eduplone.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/eduplone/EduploneExam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28940 Modified Files: ExamFolder.py Added Files: registry.py Log Message: added registry and test-skeleton --- NEW FILE: registry.py --- # File: registry.py """\ registry for question types RCS-ID $Id: registry.py,v 1.1 2004/12/14 10:31:39 yenzenz Exp $ """ # Copyright (c) 2004 by eduplone Open Source Business Network EEIG, contributed # by FH-Aargau, Switzerland # # Generated: Tue Dec 14 10:39:59 2004 # Generator: ArchGenXML Version 1.2 devel 3 http://sf.net/projects/archetypes/ # # GNU General Public Licence (GPL) # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # You should have received a copy of the GNU General Public License along with # this program; if not, write to the Free Software Foundation, Inc., 59 Temple # Place, Suite 330, Boston, MA 02111-1307 USA # __author__ = 'Jens Klein <[email protected]>' __docformat__ = 'plaintext' _question_types = [] from interfaces.IExamQuestion import IExamQuestion def registerQuestion(klass): """ register a IExamQuestion implementing class """ if not IExamQuestion.isImplementedBy(klass): raise NotImplementedError('The class %s does not implement interface IExamQuestion' % klass.__name__) if not klass.__name__ in _question_types: _question_types.append(klass.__name__) def getQuestionTypes(): return _question_types.copy() Index: ExamFolder.py =================================================================== RCS file: /cvsroot/eduplone/EduploneExam/ExamFolder.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExamFolder.py 14 Dec 2004 09:47:47 -0000 1.1 --- ExamFolder.py 14 Dec 2004 10:31:39 -0000 1.2 *************** *** 12,16 **** # # GNU General Public Licence (GPL) ! # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software --- 12,16 ---- # # GNU General Public Licence (GPL) ! # # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software *************** *** 33,36 **** --- 33,37 ---- ##code-section module-header #fill in your manual code here + from registry import getQuestionTypes ##/code-section module-header *************** *** 38,44 **** class ExamFolder(BaseFolder): security = ClassSecurityInfo() ! portal_type = meta_type = 'ExamFolder' ! archetype_name = 'ExamFolder' #this name appears in the 'add' box ! allowed_content_types = [] __implements__ = getattr(BaseFolder,'__implements__',()) --- 39,45 ---- class ExamFolder(BaseFolder): security = ClassSecurityInfo() ! portal_type = meta_type = 'ExamFolder' ! archetype_name = 'ExamFolder' #this name appears in the 'add' box ! allowed_content_types = [] __implements__ = getattr(BaseFolder,'__implements__',()) *************** *** 56,60 **** ), ), ! StringField('title', accessor='''Title''', --- 57,61 ---- ), ), ! StringField('title', accessor='''Title''', *************** *** 67,71 **** ), ), ! ), ) --- 68,72 ---- ), ), ! ), ) *************** *** 75,81 **** def allowedContentTypes(self): ''' ! ''' ! pass --- 76,82 ---- def allowedContentTypes(self): ''' ! ''' ! pass *************** *** 83,89 **** def invokeFactory(self): ''' ! ''' ! pass --- 84,90 ---- def invokeFactory(self): ''' ! ''' ! pass *************** *** 100,109 **** } ! actions= ( ! ) ! registerType(ExamFolder) --- 101,110 ---- } ! actions= ( ! ) ! registerType(ExamFolder) *************** *** 112,115 **** ##code-section module-footer #fill in your manual code here ##/code-section module-footer - - --- 113,114 ---- ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/