Minor code style fix
Fix indentation and typo.
This commit is contained in:
parent
68637bd71b
commit
d8750b4e75
1 changed files with 5 additions and 5 deletions
10
bin/srv.py
10
bin/srv.py
|
|
@ -233,11 +233,11 @@ def wttr(location = None):
|
||||||
orig_location = location
|
orig_location = location
|
||||||
|
|
||||||
if request.headers.getlist("X-Forwarded-For"):
|
if request.headers.getlist("X-Forwarded-For"):
|
||||||
ip = request.headers.getlist("X-Forwarded-For")[0]
|
ip = request.headers.getlist("X-Forwarded-For")[0]
|
||||||
if ip.startswith('::ffff:'):
|
if ip.startswith('::ffff:'):
|
||||||
ip = ip[7:]
|
ip = ip[7:]
|
||||||
else:
|
else:
|
||||||
ip = request.remote_addr
|
ip = request.remote_addr
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if location is None:
|
if location is None:
|
||||||
|
|
@ -252,7 +252,7 @@ def wttr(location = None):
|
||||||
log("%s %s %s %s" % (ip, user_agent, orig_location, location))
|
log("%s %s %s %s" % (ip, user_agent, orig_location, location))
|
||||||
return get_wetter( location, ip, html=html_output )
|
return get_wetter( location, ip, html=html_output )
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
logging.error("Exception has occured", exc_info=1)
|
logging.error("Exception has occurred", exc_info=1)
|
||||||
return str(e).rstrip()+"\n"
|
return str(e).rstrip()+"\n"
|
||||||
|
|
||||||
server = WSGIServer(("", 8002), app)
|
server = WSGIServer(("", 8002), app)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue