summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2015-06-15 23:55:55 +0200
committerUlf Magnusson <ulfalizer@gmail.com>2015-06-15 23:55:55 +0200
commit256b406fe1212ad21d05020281ff15596e183cce (patch)
tree33a7e2046458715b5f489cdfeef9b9bfddb426dd
parent0cebc87848210bf99993527694bb96efe45b9598 (diff)
Turn remove_blank() into next_nonblank().
Only way it's used.
-rw-r--r--kconfiglib.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index d1e090c..c60aa3d 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -1125,12 +1125,10 @@ class Config(object):
# Find first non-blank (not all-space) line and get its
# indentation
- line_feeder.remove_blank()
- line = line_feeder.get_next()
+ line = line_feeder.next_nonblank()
if line is None:
stmt.help = ""
break
-
indent = _indentation(line)
if indent == 0:
# If the first non-empty lines has zero indent, there is no
@@ -3146,15 +3144,15 @@ class _FileFeed(object):
while self.lines[self.linenr].endswith("\\\n"):
self.linenr -= 1
- def remove_blank(self):
- """Removes lines until the first non-blank (not all-space) line."""
+ def next_nonblank(self):
+ """Removes lines up to and including the next non-blank
+ (not all-space) line and returns it."""
while 1:
line = self.get_next()
if line is None:
- break
+ return None
if not line.isspace():
- self.unget()
- break
+ return line
def get_filename(self):
return self.filename