Skip to content

Commit

Permalink
Fix E275 missing whitespace after keyword
Browse files Browse the repository at this point in the history
Fixes:
  ./gui/polgengui.py:484:18: E275 missing whitespace after keyword
  ./gui/polgengui.py:530:18: E275 missing whitespace after keyword
  ./python/sepolgen/src/sepolgen/policygen.py:327:19: E275 missing whitespace after keyword
  ./python/sepolgen/src/sepolgen/policygen.py:329:11: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/__init__.py:453:15: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/generate.py:1351:28: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/generate.py:1353:28: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/gui.py:638:24: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/gui.py:863:23: E275 missing whitespace after keyword
  ./python/sepolicy/sepolicy/gui.py:2177:16: E275 missing whitespace after keyword
  ./sandbox/sandbox:114:7: E275 missing whitespace after keyword
  ./sandbox/sandbox:134:11: E275 missing whitespace after keyword
  ./sandbox/sandbox:136:7: E275 missing whitespace after keyword

Signed-off-by: Petr Lautrbach <[email protected]>
Acked-by: James Carter <[email protected]>
  • Loading branch information
bachradsusi authored and jwcart2 committed Nov 23, 2022
1 parent 25d7941 commit fb7f354
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions gui/polgengui.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def generate_policy(self, *args):
my_policy = sepolicy.generate.policy(self.get_name(), self.get_type())

iter = self.boolean_store.get_iter_first()
while(iter):
while iter:
my_policy.add_boolean(self.boolean_store.get_value(iter, 0), self.boolean_store.get_value(iter, 1))
iter = self.boolean_store.iter_next(iter)

Expand Down Expand Up @@ -527,7 +527,7 @@ def generate_policy(self, *args):
my_policy.set_out_udp(self.out_udp_all_checkbutton.get_active(), self.out_udp_entry.get_text())

iter = self.store.get_iter_first()
while(iter):
while iter:
if self.store.get_value(iter, 1) == FILE:
my_policy.add_file(self.store.get_value(iter, 0))
else:
Expand Down
4 changes: 2 additions & 2 deletions python/sepolgen/src/sepolgen/policygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ def call_interface(interface, av):
ifcall.args.append(av.obj_class)
else:
print(params[i].type)
assert(0)
assert 0

assert(len(ifcall.args) > 0)
assert len(ifcall.args) > 0

return ifcall

Expand Down
4 changes: 2 additions & 2 deletions python/sepolicy/sepolicy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ def get_conditionals(src, dest, tclass, perm):
tlist.append(tdict)
tdict = {}
except KeyError:
return(tlist)
return tlist

return (tlist)
return tlist


def get_conditionals_format_text(cond):
Expand Down
4 changes: 2 additions & 2 deletions python/sepolicy/sepolicy/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,9 +1346,9 @@ def gen_writeable(self):
if len(temp_dirs) != 0:
for i in temp_dirs:
if i in self.dirs.keys():
del(self.dirs[i])
del self.dirs[i]
elif i in self.files.keys():
del(self.files[i])
del self.files[i]
else:
continue

Expand Down
6 changes: 3 additions & 3 deletions python/sepolicy/sepolicy/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ def remove_cur(self, ctr):
for k in self.cur_dict:
for j in self.cur_dict[k]:
if i == ctr:
del(self.cur_dict[k][j])
del self.cur_dict[k][j]
return
i += 1

Expand Down Expand Up @@ -860,7 +860,7 @@ def filter_the_data(self, list, iter, *args):
if val is True or val is False or val is None:
continue
# Returns true if filter_txt exists within the val
if(val.find(self.filter_txt) != -1 or val.lower().find(self.filter_txt) != -1):
if val.find(self.filter_txt) != -1 or val.lower().find(self.filter_txt) != -1:
return True
except (AttributeError, TypeError):
pass
Expand Down Expand Up @@ -2174,7 +2174,7 @@ def on_toggle(self, cell, path, model):
model.set_value(iter, 0, not model.get_value(iter, 0))
active = model.get_value(iter, 0)
if name in self.cur_dict["boolean"]:
del(self.cur_dict["boolean"][name])
del self.cur_dict["boolean"][name]
else:
self.cur_dict["boolean"][name] = {"active": active}
self.new_updates()
Expand Down
6 changes: 3 additions & 3 deletions sandbox/sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def copyfile(file, srcdir, dest):

def savefile(new, orig, X_ind):
copy = False
if(X_ind):
if X_ind:
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
Expand All @@ -131,9 +131,9 @@ def savefile(new, orig, X_ind):
except NameError:
pass
ans = input(_("Do you want to save changes to '%s' (y/N): ") % orig)
if(re.match(_("[yY]"), ans)):
if re.match(_("[yY]"), ans):
copy = True
if(copy):
if copy:
shutil.copy2(new, orig)


Expand Down

0 comments on commit fb7f354

Please sign in to comment.