Skip to content

Commit adf450f

Browse files
pep8 compliance
1 parent 769cda4 commit adf450f

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

swig/openscap_api.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,28 +84,27 @@ def remove(self, item):
8484
litem = self.iterator.next()
8585
if (type(item) == str and type(litem) == str and litem == item) or \
8686
("instance" in item.__dict__ and litem.instance == item.instance):
87-
87+
8888
self.iterator.remove()
89-
90-
89+
9190
'''
9291
Warning, list.remove(self, item) will fail because python yield
9392
a new reference at each loop. So wee need to loop again into the python list,
9493
get the new reference and remove it. Demo:
95-
94+
9695
print(item.instance)
9796
print(litem.instance)
98-
print(litem.instance == item.instance)
99-
100-
RETURNS:
101-
97+
print(litem.instance == item.instance)
98+
99+
RETURNS:
100+
102101
<Swig Object of type 'struct xccdf_refine_value *' at 0x7ff85ed73bd0>
103102
<Swig Object of type 'struct xccdf_refine_value *' at 0x7ff85ed73c90>
104103
True
105104
'''
106-
105+
107106
for i in self[:]:
108-
if "instance" in item.__dict__ and i.instance == item.instance:
107+
if "instance" in item.__dict__ and i.instance == item.instance:
109108
list.remove(self, i)
110109

111110
except NameError:
@@ -124,8 +123,6 @@ def generate(self, iterator):
124123

125124
while iterator.has_more():
126125
list.append(self, iterator.next())
127-
128-
129126

130127
def append(self, item, n=1):
131128
"""This function is not allowed. Please use appropriate function from library."""

0 commit comments

Comments
 (0)