Changeset 11427 in genesis for tools/gformat.py
- Timestamp:
- Aug 30, 2012, 7:15:29 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r11426 r11427 1135 1135 1136 1136 # Update repository if requested 1137 form = urlparse.parse_qs(environ['QUERY_STRING']) 1138 if form .has_key("action") and "update" in form["action"]:1137 form = urlparse.parse_qs(environ['QUERY_STRING']) if environ.has_key('QUERY_STRING') else None 1138 if form and form.has_key("action") and "update" in form["action"]: 1139 1139 output = "[INFO] Updating subverion, please wait...\n" 1140 1140 output += subprocess.Popen(['svn', 'cleanup', "%s/.." % NODE_DIR], stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0] … … 1454 1454 print "#ERROR: '%s' is invalid input (left, right, edit or ignore)!" % c 1455 1455 1456 1457 1458 def print_cgi_response(response_headers, output): 1459 """Could we not use some kind of wsgi wrapper to make this output?""" 1460 for header in response_headers: 1461 print "%s: %s" % header 1462 print "\n" 1463 print output 1464 1465 1466 1456 1467 def main(): 1457 1468 """Hard working sub""" … … 1515 1526 os.environ['PATH_INFO'] = "/".join(sys.argv[2:]) 1516 1527 os.environ['SCRIPT_NAME'] = __file__ 1517 process_cgi_request() 1528 response_headers, output = process_cgi_request() 1529 print_cgi_response(response_headers, output) 1518 1530 elif sys.argv[1] == "static": 1519 1531 items = dict() … … 1869 1881 if not is_text_request(): 1870 1882 cgitb.enable() 1871 process_cgi_request() 1883 response_headers, output = process_cgi_request() 1884 print_cgi_response(response_headers, output) 1872 1885 1873 1886 def application(environ, start_response):
Note:
See TracChangeset
for help on using the changeset viewer.