allow comments in config file

This commit is contained in:
2017-05-18 17:02:15 -04:00
parent 5808bbc791
commit e69de2472a
+12 -5
View File
@@ -824,14 +824,21 @@ except:
if f: if f:
while 1: while 1:
l = f.readline() ls = f.readline()
if len(l) == 0: if len(ls) == 0:
break break
l = ls[:-1].strip()
if len(l) == 0 or l[0] == "#":
continue
if verbose: if verbose:
print " %s" % l[:-1] print " %s" % l
r = l[:-1].split('=') r = l.split('=')
o = r[0].strip() o = r[0].strip()
a = eval(r[1].strip()) try:
a = eval(r[1].strip())
except Exception as e:
print "error: %s" % str(r)
sys.exit(1)
if o == 'interval': if o == 'interval':
interval = a interval = a
elif o == 'grace': elif o == 'grace':