File: ModuleServerInfo.py

package info (click to toggle)
cherokee 0.7.2-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,808 kB
  • ctags: 6,577
  • sloc: ansic: 45,071; python: 9,628; sh: 9,468; makefile: 1,639; xml: 61; perl: 32
file content (29 lines) | stat: -rw-r--r-- 979 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from Form import *
from Table import *
from Module import *

NOTE_JUST_ABOUT  = 'Show only the most basic information.'
NOTE_CONNECTIONS = 'Show status of the ongoing connections.'

class ModuleServerInfo (Module, FormHelper):
    PROPERTIES = [
        'just_about',
        'connection_details'
    ]

    def __init__ (self, cfg, prefix, submit_url):
        Module.__init__ (self, 'server_info', cfg, prefix, submit_url)
        FormHelper.__init__ (self, 'server_info', cfg)

    def _op_render (self):
        txt  = "<h2>Privacy settings</h2>"

        table = TableProps()
        self.AddPropCheck (table, "Just 'About'", "%s!just_about" % (self._prefix), False, NOTE_JUST_ABOUT)
        self.AddPropCheck (table, "Show Connections", "%s!connection_details" % (self._prefix), False, NOTE_CONNECTIONS)
        txt += self.Indent(table)

        return txt

    def _op_apply_changes (self, uri, post):
        self.ApplyChangesPrefix (self._prefix, ['just_about'], post)