Commit 0138cf10 by Tomas Hlavacek

Allow running ulg.py form console.

Add support for running ulg.py form console. (Do not blindly expect
CGI environment to be always set.)
parent a35faaca
......@@ -743,7 +743,10 @@ if __name__=="__main__":
action = form.getvalue('action',None)
params = dict([(k,form.getvalue(k)) for k in form.keys() if k != 'action'])
ulgmodel.log("Request from "+os.environ["REMOTE_ADDR"]+" with action="+str(action)+" params="+str(params)+'.')
if("REMOTE_ADDR" in os.environ):
ulgmodel.log("Request from "+os.environ["REMOTE_ADDR"]+" with action="+str(action)+" params="+str(params)+'.')
else:
ulgmodel.log("Request from console with action="+str(action)+" params="+str(params)+'.')
if(action):
if(action == 'index'):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment