summaryrefslogtreecommitdiff
path: root/tools/preprocessor.py
diff options
context:
space:
mode:
authorPatrick Monnerat <[email protected]>2019-05-10 16:26:39 +0200
committerraveit65 <[email protected]>2019-05-21 09:36:44 +0200
commite88a2ea8adb4a57c9cf5c44fe30c210c8608361b (patch)
treea70133a625b31710d79dc5fdd77589b69e24c003 /tools/preprocessor.py
parent676669e4e87130f639e118671d754a5e538f191c (diff)
downloadpluma-e88a2ea8adb4a57c9cf5c44fe30c210c8608361b.tar.bz2
pluma-e88a2ea8adb4a57c9cf5c44fe30c210c8608361b.tar.xz
Reindent all Python sources to ts=4. Strip trailing spaces.
Diffstat (limited to 'tools/preprocessor.py')
-rw-r--r--tools/preprocessor.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/preprocessor.py b/tools/preprocessor.py
index f5409cad..cd8726d2 100644
--- a/tools/preprocessor.py
+++ b/tools/preprocessor.py
@@ -17,7 +17,7 @@
#
# You should have received a copy of the GNU General Public License
# along with pluma; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA
import sys
@@ -49,7 +49,7 @@ def _subvar(match, macros):
return ''
else:
return ''
-
+
mods = match.group('mods')
if mods is not None:
for mod in mods[1:].split('.'):
@@ -58,7 +58,7 @@ def _subvar(match, macros):
elif mod == 'upper':
val = val.upper()
elif mod == 'camel':
- val = ''.join(i.capitalize()
+ val = ''.join(i.capitalize()
for i in val.split('_'))
return val
@@ -74,20 +74,20 @@ def process(infile = sys.stdin, outfile = sys.stdout, macros = {}):
close_outfile = True
else:
close_outfile = False
-
+
deepness = 0
writing_disabled = None
-
+
for line in infile:
# Skip comments
if line[0:3].lower() == '##c':
continue
- # Check whether current line is a preprocessor directive
+ # Check whether current line is a preprocessor directive
for statement in statements:
match = statement.match(line)
if match: break
-
+
if match is not None:
stmt = match.group('stmt')
@@ -113,7 +113,7 @@ def process(infile = sys.stdin, outfile = sys.stdout, macros = {}):
deepness += 1
if writing_disabled is None and \
match.group('key') in macros:
- writing_disabled = deepness
+ writing_disabled = deepness
elif stmt == "if":
deepness += 1
@@ -148,7 +148,7 @@ def process(infile = sys.stdin, outfile = sys.stdout, macros = {}):
# Do variable substitution in the remaining lines
elif writing_disabled is None:
- outfile.write(re.sub(variable,
+ outfile.write(re.sub(variable,
lambda m: _subvar(m, macros),
line))