summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Laska <jlaska@redhat.com>2011-04-06 15:17:33 -0400
committerJames Laska <jlaska@redhat.com>2011-04-06 15:17:33 -0400
commit517413719323fe901b27779aab2845243c1952d2 (patch)
tree43d12a3377026ccd1fd747310fe7a0b39302a396
parent1b282edae37f39fdb26c6517e916f5e17b45d335 (diff)
downloadscripts-517413719323fe901b27779aab2845243c1952d2.tar.gz
scripts-517413719323fe901b27779aab2845243c1952d2.tar.xz
scripts-517413719323fe901b27779aab2845243c1952d2.zip
Update detection of empty/comment lines.
-rwxr-xr-xupdate-blocker-wiki5
1 files changed, 3 insertions, 2 deletions
diff --git a/update-blocker-wiki b/update-blocker-wiki
index 06e9c7e..3afef15 100755
--- a/update-blocker-wiki
+++ b/update-blocker-wiki
@@ -4,6 +4,7 @@ import os
import sys
import locale
import optparse
+import re
from getpass import getpass
try:
@@ -103,9 +104,9 @@ def parse_args():
buf = fd.read()
fd.close()
valid = False
- # Any non-empty non-comment line is good
for line in buf.split('\n'):
- if line.startswith('#') or len(line) == 0:
+ # Skip empty lines or lines with only comments
+ if re.match(r'^(\s*#|\s*$)', line):
continue
return True