diff options
Diffstat (limited to 'lorrycontroller/showlorry.py')
-rw-r--r-- | lorrycontroller/showlorry.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lorrycontroller/showlorry.py b/lorrycontroller/showlorry.py index d54073a..b553b9c 100644 --- a/lorrycontroller/showlorry.py +++ b/lorrycontroller/showlorry.py @@ -1,4 +1,4 @@ -# Copyright (C) 2014 Codethink Limited +# Copyright (C) 2014-2019 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ import json import logging import time -import urlparse +import urllib.parse import bottle @@ -65,7 +65,7 @@ class ShowLorryHTML(ShowLorryBase, lorrycontroller.LorryControllerRoute): renderer = lorrycontroller.StatusRenderer() shower = lorrycontroller.JobShower() - lorry_obj = json.loads(lorry_info['text']).values()[0] + lorry_obj = list(json.loads(lorry_info['text']).values())[0] lorry_info['url'] = lorry_obj['url'] lorry_info['interval_nice'] = renderer.format_secs_nicely( @@ -85,9 +85,9 @@ class ShowLorryHTML(ShowLorryBase, lorrycontroller.LorryControllerRoute): timestamp = time.strftime('%Y-%m-%d %H:%M:%S UTC', time.gmtime(now)) - parts = urlparse.urlparse(bottle.request.url) + parts = urllib.parse.urlparse(bottle.request.url) host, port = parts.netloc.split(':', 1) - http_server_root = urlparse.urlunparse( + http_server_root = urllib.parse.urlunparse( (parts.scheme, host, '', '', '', '')) return bottle.template( |