root/cherokee/trunk/admin/ModuleFcgi.py

Revision 2333, 1.6 kB (checked in by taher, 1 month ago)

--

Line 
1 from Form import *
2 from Table import *
3 from Module import *
4 from validations import *
5 from consts import *
6
7 from ModuleCgi import *
8 from ModuleBalancer import NOTE_BALANCER
9
10 HELPS = [
11     ('modules_handlers_fcgi', "FastCGI")
12 ]
13
14 class ModuleFcgi (ModuleCgiBase):
15     PROPERTIES = ModuleCgiBase.PROPERTIES + [
16         'balancer'
17     ]
18
19     def __init__ (self, cfg, prefix, submit):
20         ModuleCgiBase.__init__ (self, cfg, prefix, 'fcgi', submit)
21
22         self.show_script_alias  = False
23         self.show_change_uid    = False
24         self.show_document_root = True
25
26         self._util__set_fixed_check_file()
27
28     def _op_render (self):
29         txt = ModuleCgiBase._op_render (self)
30
31         txt += '<h2>FastCGI specific</h2>'
32
33         table = TableProps()
34         prefix = "%s!balancer" % (self._prefix)
35         assert (self.submit_url)
36         e = self.AddPropOptions_Reload (table, "Balancer", prefix,
37                                         modules_available(BALANCERS), NOTE_BALANCER)
38         txt += self.Indent (str(table) + e)
39         return txt
40
41     def _op_apply_changes (self, uri, post):
42         # Apply balancer changes
43         pre = "%s!balancer" % (self._prefix)
44
45         new_balancer = post.pop(pre)
46         if new_balancer:
47             self._cfg[pre] = new_balancer
48
49         cfg  = self._cfg[pre]
50         if cfg and cfg.value:
51             name = cfg.value
52             props = module_obj_factory (name, self._cfg, pre, self.submit_url)
53             props._op_apply_changes (uri, post)
54
55         # And CGI changes
56         return ModuleCgiBase._op_apply_changes (self, uri, post)
Note: See TracBrowser for help on using the browser.