-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetConfig.cgi
More file actions
executable file
·48 lines (34 loc) · 1.47 KB
/
getConfig.cgi
File metadata and controls
executable file
·48 lines (34 loc) · 1.47 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!./python
# Program: getConfig.cgi
# Purpose: propagate global config file contents
import sys
import os
if "LIB_PY_MISC" not in os.environ:
sys.path.insert (0, '/usr/local/mgi/live/lib/python/')
else:
sys.path.insert (0, os.environ["LIB_PY_MISC"])
# Attempt to import the module that will ask Python to ignore any
# deprecation errors. If it fails, ignore it and go forward.
try:
import ignoreDeprecation
except:
pass
import Configuration
# configuration file for this product
config = Configuration.get_Configuration ("webshare.config")
globalConfig = Configuration.get_Configuration (config['GLOBAL_CONFIG'])
commonConfig = Configuration.get_Configuration (config['COMMON_CONFIG'])
import CGI
import string
class getConfigCGI (CGI.CGI):
def main (self):
print('###################################################################################')
print('# This is a machine generated config file, do not make changes here.')
print('# Instead make them in either GlobalConfig or CommonConfig in your local webshare. ')
print('###################################################################################')
globalConfig.merge(commonConfig)
for key in list(globalConfig.keys()):
print(key + ' ' + globalConfig[key])
if __name__ == '__main__':
myCgi = getConfigCGI()
myCgi.go()