From 517413719323fe901b27779aab2845243c1952d2 Mon Sep 17 00:00:00 2001 From: James Laska Date: Wed, 6 Apr 2011 15:17:33 -0400 Subject: Update detection of empty/comment lines. --- update-blocker-wiki | 5 +++-- 1 file 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 -- cgit