aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-10-09 21:40:35 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-10-09 21:40:35 -0400
commit685abf8bc45f4ad28fc7668c5464f114c0d9740d (patch)
tree08a324547c7eb6958135ecbe27f9be59f9dff708
parentgrs/Interpret.py: skip blank lines with leading + (diff)
downloadgrss-685abf8bc45f4ad28fc7668c5464f114c0d9740d.tar.gz
grss-685abf8bc45f4ad28fc7668c5464f114c0d9740d.tar.bz2
grss-685abf8bc45f4ad28fc7668c5464f114c0d9740d.zip
grs/Interpret.py: clean up white space padding on _line.
-rw-r--r--grs/Interpret.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/grs/Interpret.py b/grs/Interpret.py
index d326d9c..4f184a0 100644
--- a/grs/Interpret.py
+++ b/grs/Interpret.py
@@ -166,6 +166,9 @@ class Interpret(Daemon):
line_number = 0
medium_type = None
for _line in _file.readlines():
+ # Get rid of whitespace padding immediately
+ _line = _line.strip()
+
# Increment the line number by one and create the name of the
# file for the progress stamp.
line_number += 1
@@ -173,7 +176,7 @@ class Interpret(Daemon):
# Do nothing for lines with initial # or blank lines. Create
# a progress stamp only if we are not doing an update run.
- if re.search(r'^(#).*$', _line) or _line.strip() == '' or _line.strip() == '+':
+ if re.search(r'^(#).*$', _line) or _line == '' or _line == '+':
if not self.update_run:
stampit(progress)
continue