2012-05-01 07:13:33

by sven.vermeulen

[permalink] [raw]
Subject: [refpolicy] [PATCH 1/1] Whitespace fixes for python-3 support

This patch includes some whitespace fixes to support Python 3 (which doesn't love mixing spaces and tabs that much).

Signed-off-by: Sven Vermeulen <[email protected]>
---
support/genclassperms.py | 8 ++++----
support/sedoctool.py | 18 +++++++++---------
support/segenxml.py | 12 ++++++------
3 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/support/genclassperms.py b/support/genclassperms.py
index 732d645..6d6ce8b 100644
--- a/support/genclassperms.py
+++ b/support/genclassperms.py
@@ -287,10 +287,10 @@ def error(error):
Print an error message and exit.
"""

- sys.stderr.write("%s exiting for: " % sys.argv[0])
- sys.stderr.write("%s\n" % error)
- sys.stderr.flush()
- sys.exit(1)
+ sys.stderr.write("%s exiting for: " % sys.argv[0])
+ sys.stderr.write("%s\n" % error)
+ sys.stderr.flush()
+ sys.exit(1)

# MAIN PROGRAM
app_name = sys.argv[0]
diff --git a/support/sedoctool.py b/support/sedoctool.py
index 5bbaf76..aad7f99 100644
--- a/support/sedoctool.py
+++ b/support/sedoctool.py
@@ -1,7 +1,7 @@
#!/usr/bin/python

# Author: Joshua Brindle <[email protected]>
-# Caleb Case <[email protected]>
+# Caleb Case <[email protected]>
#
# Copyright (C) 2005 - 2006 Tresys Technology, LLC
# This program is free software; you can redistribute it and/or modify
@@ -80,7 +80,7 @@ def gen_booleans_conf(doc, file_name, namevalue_list):
bool_val = BOOL_DISABLED

if bool_name and bool_val:
- file_name.write("%s = %s\n\n" % (bool_name, bool_val))
+ file_name.write("%s = %s\n\n" % (bool_name, bool_val))
bool_name = bool_val = None

# tunables are currently implemented as booleans
@@ -105,7 +105,7 @@ def gen_booleans_conf(doc, file_name, namevalue_list):
bool_val = BOOL_DISABLED

if bool_name and bool_val:
- file_name.write("%s = %s\n\n" % (bool_name, bool_val))
+ file_name.write("%s = %s\n\n" % (bool_name, bool_val))
bool_name = bool_val = None

def gen_module_conf(doc, file_name, namevalue_list):
@@ -364,7 +364,7 @@ def gen_docs(doc, working_dir, templatedir):
#arg, i have to go through this dom tree ahead of time to build up the menus
module_list = {}
for node in doc.getElementsByTagName("module"):
- mod_name = mod_layer = interface_buf = ''
+ mod_name = mod_layer = interface_buf = ''

mod_name = node.getAttribute("name")
mod_layer = node.parentNode.getAttribute("name")
@@ -428,7 +428,7 @@ def gen_docs(doc, working_dir, templatedir):
all_tunables = []
all_booleans = []
for node in doc.getElementsByTagName("module"):
- mod_name = mod_layer = mod_desc = interface_buf = ''
+ mod_name = mod_layer = mod_desc = interface_buf = ''

mod_name = node.getAttribute("name")
mod_layer = node.parentNode.getAttribute("name")
@@ -753,10 +753,10 @@ def error(error):
Print an error message and exit.
"""

- sys.stderr.write("%s exiting for: " % sys.argv[0])
- sys.stderr.write("%s\n" % error)
- sys.stderr.flush()
- sys.exit(1)
+ sys.stderr.write("%s exiting for: " % sys.argv[0])
+ sys.stderr.write("%s\n" % error)
+ sys.stderr.flush()
+ sys.exit(1)

def warning(warn):
"""
diff --git a/support/segenxml.py b/support/segenxml.py
index d6c4fd5..5f4f7d0 100644
--- a/support/segenxml.py
+++ b/support/segenxml.py
@@ -1,9 +1,9 @@
#!/usr/bin/python

# Author(s): Donald Miner <[email protected]>
-# Dave Sugar <[email protected]>
-# Brian Williams <[email protected]>
-# Caleb Case <[email protected]>
+# Dave Sugar <[email protected]>
+# Brian Williams <[email protected]>
+# Caleb Case <[email protected]>
#
# Copyright (C) 2005 - 2006 Tresys Technology, LLC
# This program is free software; you can redistribute it and/or modify
@@ -335,9 +335,9 @@ def error(description):
'''

sys.stderr.write("%s: " % sys.argv[0] )
- sys.stderr.write("error: " + description + "\n")
- sys.stderr.flush()
- sys.exit(1)
+ sys.stderr.write("error: " + description + "\n")
+ sys.stderr.flush()
+ sys.exit(1)



--
1.7.3.4


2012-05-01 10:48:18

by sven.vermeulen

[permalink] [raw]
Subject: [refpolicy] [PATCH 1/1] Whitespace fixes for python-3 support

Please ignore this patch, there are still some other issues with it. I'll
send an updated patch later.

Wkr,
Sven Vermeulen