Changeset 6361
- Timestamp:
- 12 Jun 2011, 23:04:59 (14 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/app.py
r6329 r6361 21 21 IDataCenterStorageMovedEvent, IObjectUpgradeEvent, ) 22 22 from waeup.sirp.users import UserContainer 23 from waeup.sirp.utils.helpers import attrs_to_fields 23 24 24 25 class University(grok.Application, grok.Container): … … 32 33 PluggableAuthentication, provides = IAuthentication, 33 34 setup = setup_authentication,) 34 35 # The name of the university.36 name=u'Sample University'37 38 # The default layout.39 skin=u'gray waeup theme'40 41 # The default frontpage.42 frontpage= """43 This is the default frontpage of the portal written44 in `reStructuredText (reST)45 <http://docutils.sourceforge.net/docs/user/rst/quickref.html>`_46 markup language.47 48 Some more reST examples for getting started:49 50 1. Heading51 ----------52 53 Text54 55 1.2 Heading56 ...........57 58 Text59 60 2. Heading61 ----------62 63 Text64 65 2.1 Heading66 ...........67 68 Text69 70 2.2 Heading71 ...........72 73 Text74 75 """76 77 # The default title.78 title=u'Welcome to the Student Information and Registration Portal of %s' % name79 35 80 36 @property … … 97 53 return logger 98 54 99 100 def __init__(self, name=name, skin=skin, title=title, 101 frontpage=frontpage, **kw): 55 def __init__(self, name=None, skin=None, title=None, 56 frontpage=None, **kw): 102 57 super(University, self).__init__(**kw) 103 self.name = name 104 self.skin = skin 105 self.title = title 106 self.frontpage = frontpage 58 if name is not None: 59 self.name = name 60 if skin is not None: 61 self.skin = skin 62 if title is not None: 63 self.title = title 64 if frontpage is not None: 65 self.frontpage = frontpage 107 66 self.setup() 108 67 … … 162 121 logger.addHandler(handler) 163 122 return logger 123 attrs_to_fields(University) 164 124 165 125 @grok.subscribe(IDataCenter, IDataCenterStorageMovedEvent) -
main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py
r6353 r6361 1 1 ## 2 2 ## interfaces.py 3 import os 3 4 from hurry.workflow.interfaces import IWorkflow, IWorkflowInfo 4 5 from zc.sourcefactory.basic import BasicSourceFactory … … 8 9 from zope.interface import Interface, Attribute, implements 9 10 from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm 11 12 default_frontpage = u'' + open(os.path.join( 13 os.path.dirname(__file__), 'frontpage.rst'), 'rb').read() 10 14 11 15 class FatalCSVError(Exception): … … 63 67 name = schema.TextLine( 64 68 title = u'Name of University', 65 default = u' Unnamed',69 default = u'Sample University', 66 70 required = True, 67 71 ) … … 69 73 title = schema.TextLine( 70 74 title = u'Title of frontpage', 71 default = u'No Title', 75 default = u'Welcome to the Student Information and Registration ' + 76 u'Portal of Sample University', 72 77 required = False, 73 78 ) … … 83 88 title = u'Content in reST format', 84 89 required = False, 85 default = u'This is the SIRP frontpage.'90 default = default_frontpage, 86 91 ) 87 92
Note: See TracChangeset for help on using the changeset viewer.