Пример #1
0
 def handle_view(self, request, name, ctx=None):
     handler = self.views[name]
     ctx = ctx or {}
     ctx.update({
         'current':     name,
         'prev':        self.prev[name],
         'next':        self.next[name],
         'values':      dict((k, v) for k, v in request.values.iteritems()
                             if not k.startswith('_')),
         'languages':   list_languages(self_translated=True)
     })
     return render_response(request, name + '.html', ctx)
Пример #2
0
        default=u'UTC', help_text=l_(
        u'The timezone of the site.  All times and dates in the user interface '
        u'and on the website will be shown in this timezone.  It\'s save to '
        u'change the timezone after posts are created because the information '
        u'in the database is stored as UTC.')),
    'maintenance_mode':         BooleanField(default=False, help_text=l_(
        u'If set to true, the site enables the maintainance mode.')),
    'session_cookie_name':      TextField(default=u'pyClanSphere_session',
        help_text=l_(u'If there are multiple pyClanSphere installations on '
        u'the same host the cookie name should be set to something different '
        u'for each one.')),
    'theme':                    TextField(default=u'default'),
    'secret_key':               TextField(default=u'', help_text=l_(
        u'The secret key is used for various security related tasks in the '
        u'system. For example, the cookie is signed with this value.')),
    'language':                 ChoiceField(choices=list_languages(False),
                                            default=u'en'),

    'iid':                      TextField(default=u'', help_text=l_(
        u'The iid uniquely identifies the pyClanSphere instance.  Currently this '
        u'value is unused, but once set you should not modify it.')),

    # log and development settings
    'log_file':                 TextField(default=u'pyClanSphere.log'),
    'log_level':                ChoiceField(choices=[(k, l_(k)) for k, v
                                                in sorted(log.LEVELS.items(),
                                                          key=lambda x: x[1])],
                                            default=u'warning'),
    'log_email_only':           BooleanField(default=_dev_mode,
        help_text=l_(u'During development activating this is helpful to '
        u'log emails into a mail.log file in your instance folder instead '
Пример #3
0
 def __init__(self, initial=None):
     _ConfigForm.__init__(self, initial)
     self.language.choices = list_languages()