[SEBA-412] Automated reformat of Python code
Passes of modernize, autopep8, black, then check with flake8
flake8 + manual fixes:
lib/xos-config
lib/xos-kafka
lib/xos-util
xos/coreapi
xos/api
xos/xos_client
Change-Id: Ib23cf84cb13beb3c6381fa0d79594dc9131dc815
diff --git a/lib/xos-genx/xos-genx-tests/counts b/lib/xos-genx/xos-genx-tests/counts
index 8ab44d4..bfbbd7c 100755
--- a/lib/xos-genx/xos-genx-tests/counts
+++ b/lib/xos-genx/xos-genx-tests/counts
@@ -5,14 +5,16 @@
from core.models import XOSBase, PlModelMixIn
import pdb
+
def count(lst):
c = 0
for l in lst[0]:
- ll = l.lstrip()
- if (ll and not ll.startswith('#') and ll.rstrip()!='pass' and 'ModelLink' not in ll and 'CHOICES' not in ll):
- c+=1
+ ll = l.lstrip()
+ if (ll and not ll.startswith('#') and ll.rstrip() != 'pass' and 'ModelLink' not in ll and 'CHOICES' not in ll):
+ c += 1
return c
+
def is_model_class(model):
""" Return True if 'model' is something that we're interested in """
if not inspect.isclass(model):
@@ -26,9 +28,9 @@
return False
+
for a in dir(core.models):
- x = getattr(core.models,a)
+ x = getattr(core.models, a)
if (is_model_class(x)):
lines = inspect.getsourcelines(x)
- print x.__name__,":",count(lines)
-
+ print x.__name__, ":", count(lines)