Changeset 10107 in genesis
- Timestamp:
- Mar 11, 2012, 11:34:49 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/gformat.py
r10106 r10107 826 826 827 827 def is_text_request(): 828 return os.environ['HTTP_USER_AGENT'].split()[0] in ['curl', 'fetch', 'wget'] 828 """ Find out whether we are calling from the CLI or any text based CLI utility """ 829 try: 830 return os.environ['HTTP_USER_AGENT'].split()[0] in ['curl', 'fetch', 'wget'] 831 except KeyError: 832 return True 829 833 830 834 def main(): … … 870 874 os.environ['SCRIPT_NAME'] = __file__ 871 875 process_cgi_request() 876 elif sys.argv[1] == "unit-test": 877 os.environ['SCRIPT_NAME'] = __file__ 878 for host in get_hostlist(): 879 for outfile in files: 880 os.environ['PATH_INFO'] = "/".join([host,outfile]) 881 try: 882 process_cgi_request() 883 except Exception: 884 print "# ERROR: %s" % os.environ['PATH_INFO'] 885 raise 886 887 872 888 elif sys.argv[1] == "static": 873 889 items = dict()
Note:
See TracChangeset
for help on using the changeset viewer.