From d8750b4e75f30f4508cdc9bd149d74297b89c7f9 Mon Sep 17 00:00:00 2001 From: Kyrylo Romanenko Date: Sat, 23 Apr 2016 00:53:21 +0300 Subject: [PATCH] Minor code style fix Fix indentation and typo. --- bin/srv.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/srv.py b/bin/srv.py index c54d2a3..6d349c5 100644 --- a/bin/srv.py +++ b/bin/srv.py @@ -233,11 +233,11 @@ def wttr(location = None): orig_location = location if request.headers.getlist("X-Forwarded-For"): - ip = request.headers.getlist("X-Forwarded-For")[0] - if ip.startswith('::ffff:'): - ip = ip[7:] + ip = request.headers.getlist("X-Forwarded-For")[0] + if ip.startswith('::ffff:'): + ip = ip[7:] else: - ip = request.remote_addr + ip = request.remote_addr try: if location is None: @@ -252,7 +252,7 @@ def wttr(location = None): log("%s %s %s %s" % (ip, user_agent, orig_location, location)) return get_wetter( location, ip, html=html_output ) except Exception, e: - logging.error("Exception has occured", exc_info=1) + logging.error("Exception has occurred", exc_info=1) return str(e).rstrip()+"\n" server = WSGIServer(("", 8002), app)