[Kimchi-devel] [PATCH] pep8 fixes
Daniel Henrique Barboza
dhbarboza82 at gmail.com
Fri Jun 5 14:30:06 UTC 2015
pep8 version 1.6.2 added a rule in which the logical operand must be
before a line break, not after:
"W503 line break before binary operator"
Signed-off-by: Daniel Henrique Barboza <dhbarboza82 at gmail.com>
---
contrib/check_i18n.py | 4 ++--
src/kimchi/control/base.py | 4 ++--
src/kimchi/model/vms.py | 4 ++--
src/kimchi/model/vmstorages.py | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/contrib/check_i18n.py b/contrib/check_i18n.py
index a7eeef6..6a2603c 100755
--- a/contrib/check_i18n.py
+++ b/contrib/check_i18n.py
@@ -55,8 +55,8 @@ def check_obsolete_messages(path, messages):
for root, dirs, files in os.walk(path):
for f in files:
fname = os.path.join(root, f)
- if (not fname.endswith("i18n.py") and fname.endswith(".py")
- or fname.endswith(".json")):
+ if (not fname.endswith("i18n.py") and fname.endswith(".py") or
+ fname.endswith(".json")):
with open(fname) as f:
string = "".join(f.readlines())
if k in string:
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index b9520c0..006a6f7 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -112,8 +112,8 @@ class Resource(object):
action_fn = getattr(self.model, model_fn(self, action_name))
action_result = action_fn(*model_args)
if destructive is False or \
- ('persistent' in self.info.keys()
- and self.info['persistent'] is True):
+ ('persistent' in self.info.keys() and
+ self.info['persistent'] is True):
return render_fn(self, action_result)
except MissingParameter, e:
raise cherrypy.HTTPError(400, e.message)
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index ed1500e..2ef274c 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -598,8 +598,8 @@ class VMModel(object):
expire = params['graphics'].get("passwdValidTo")
to = graphics.attrib.get('passwdValidTo')
if to is not None:
- if (time.mktime(time.strptime(to, '%Y-%m-%dT%H:%M:%S'))
- - time.time() <= 0):
+ if (time.mktime(time.strptime(to, '%Y-%m-%dT%H:%M:%S')) -
+ time.time() <= 0):
expire = expire if expire is not None else 30
if expire is not None:
diff --git a/src/kimchi/model/vmstorages.py b/src/kimchi/model/vmstorages.py
index d3d4a8b..142b177 100644
--- a/src/kimchi/model/vmstorages.py
+++ b/src/kimchi/model/vmstorages.py
@@ -97,8 +97,8 @@ class VMStoragesModel(object):
char = dev_list.pop()[2]
params['index'] = string.ascii_lowercase.index(char) + 1
- if (params['bus'] not in HOTPLUG_TYPE
- and DOM_STATE_MAP[dom.info()[0]] != 'shutoff'):
+ if (params['bus'] not in HOTPLUG_TYPE and
+ DOM_STATE_MAP[dom.info()[0]] != 'shutoff'):
raise InvalidOperation('KCHVMSTOR0011E')
if params.get('vol'):
--
2.1.0
More information about the Kimchi-devel
mailing list