From a336728006a15e48f6d6762fafca2e4397e440f3 Mon Sep 17 00:00:00 2001 From: Luke Campagnola <> Date: Wed, 4 Apr 2012 22:54:46 -0400 Subject: [PATCH] small fixes for new modules --- configfile.py | 11 +++++++++-- widgets/FeedbackButton.py | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configfile.py b/configfile.py index c851edb1..6b01d0cf 100644 --- a/configfile.py +++ b/configfile.py @@ -95,6 +95,7 @@ def parseString(lines, start=0): data = OrderedDict() if isinstance(lines, basestring): lines = lines.split('\n') + lines = filter(lambda l: re.search(r'\S', l) and not re.match(r'\s*#', l), lines) ## remove empty lines indent = measureIndent(lines[start]) ln = start - 1 @@ -179,14 +180,20 @@ if __name__ == '__main__': tf = open(fn, 'w') cf = """ key: 'value' -key2: - key21: 'value' +key2: ##comment + ##comment + key21: 'value' ## comment + ##comment key22: [1,2,3] key23: 234 #comment """ tf.write(cf) tf.close() print "=== Test:===" + num = 1 + for line in cf.split('\n'): + print "%02d %s" % (num, line) + num += 1 print cf print "============" data = readConfigFile(fn) diff --git a/widgets/FeedbackButton.py b/widgets/FeedbackButton.py index 5112e955..f788f4b6 100644 --- a/widgets/FeedbackButton.py +++ b/widgets/FeedbackButton.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- from pyqtgraph.Qt import QtCore, QtGui + +__all__ = ['FeedbackButton'] + class FeedbackButton(QtGui.QPushButton): """ QPushButton which flashes success/failure indication for slow or asynchronous procedures.