Changeset 6361


Ignore:
Timestamp:
12 Jun 2011, 23:04:59 (14 years ago)
Author:
uli
Message:

Clean up app.

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  
    2121    IDataCenterStorageMovedEvent, IObjectUpgradeEvent, )
    2222from waeup.sirp.users import UserContainer
     23from waeup.sirp.utils.helpers import attrs_to_fields
    2324
    2425class University(grok.Application, grok.Container):
     
    3233        PluggableAuthentication, provides = IAuthentication,
    3334        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 written
    44 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. Heading
    51 ----------
    52 
    53 Text
    54 
    55 1.2 Heading
    56 ...........
    57 
    58 Text
    59 
    60 2. Heading
    61 ----------
    62 
    63 Text
    64 
    65 2.1 Heading
    66 ...........
    67 
    68 Text
    69 
    70 2.2 Heading
    71 ...........
    72 
    73 Text
    74 
    75 """
    76 
    77     # The default title.
    78     title=u'Welcome to the Student Information and Registration Portal of %s' % name
    7935
    8036    @property
     
    9753        return logger
    9854
    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):
    10257        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
    10766        self.setup()
    10867
     
    162121        logger.addHandler(handler)
    163122        return logger
     123attrs_to_fields(University)
    164124
    165125@grok.subscribe(IDataCenter, IDataCenterStorageMovedEvent)
  • main/waeup.sirp/trunk/src/waeup/sirp/interfaces.py

    r6353 r6361  
    11##
    22## interfaces.py
     3import os
    34from hurry.workflow.interfaces import IWorkflow, IWorkflowInfo
    45from zc.sourcefactory.basic import BasicSourceFactory
     
    89from zope.interface import Interface, Attribute, implements
    910from zope.schema.vocabulary import SimpleVocabulary, SimpleTerm
     11
     12default_frontpage = u'' + open(os.path.join(
     13        os.path.dirname(__file__), 'frontpage.rst'), 'rb').read()
    1014
    1115class FatalCSVError(Exception):
     
    6367    name = schema.TextLine(
    6468        title = u'Name of University',
    65         default = u'Unnamed',
     69        default = u'Sample University',
    6670        required = True,
    6771        )
     
    6973    title = schema.TextLine(
    7074        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',
    7277        required = False,
    7378        )
     
    8388        title = u'Content in reST format',
    8489        required = False,
    85         default = u'This is the SIRP frontpage.'
     90        default = default_frontpage,
    8691        )
    8792
Note: See TracChangeset for help on using the changeset viewer.