summaryrefslogtreecommitdiff
path: root/opendc/util/rest.py
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-26 22:50:27 +0200
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2017-09-26 22:50:27 +0200
commit4c6d68dd2e460095e20ba32007a35da4c5e6dae6 (patch)
tree13eeab79298913ee177e428519bc18fed5356efa /opendc/util/rest.py
parent44f0bd378763f4c481fb8a87847ca84469b35a67 (diff)
Fix more PEP-8 violations
Diffstat (limited to 'opendc/util/rest.py')
-rw-r--r--opendc/util/rest.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/opendc/util/rest.py b/opendc/util/rest.py
index 7cf2d0b3..85da4eaa 100644
--- a/opendc/util/rest.py
+++ b/opendc/util/rest.py
@@ -6,8 +6,8 @@ from oauth2client import client, crypt
from opendc.util import exceptions, parameter_checker
-with open(sys.argv[1]) as file:
- KEYS = json.load(file)
+with open(sys.argv[1]) as f:
+ KEYS = json.load(f)
class Request(object):
@@ -48,7 +48,7 @@ class Request(object):
self.module = importlib.import_module(module_base.format(module_path))
- except UnicodeError as e:
+ except UnicodeError:
raise exceptions.UnimplementedEndpointError('Non-ASCII path')
except ImportError:
@@ -58,7 +58,7 @@ class Request(object):
# Check the method
- if not self.method in ['POST', 'GET', 'PUT', 'PATCH', 'DELETE']:
+ if self.method not in ['POST', 'GET', 'PUT', 'PATCH', 'DELETE']:
raise exceptions.UnsupportedMethodError('Non-rest method: {}'.format(self.method))
if not hasattr(self.module, self.method):