Restore readDatagroups function accidently deleted in 1e7492a806
This commit is contained in:
@@ -424,6 +424,18 @@ class CardGenerator(object):
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
def readDatagroups(self, datasetfile):
|
||||
"""Read Datagroups from file"""
|
||||
with open(datasetfile, 'r') as f:
|
||||
for line in f:
|
||||
if (not line.startswith("#")) and (not len(line.strip()) == 0):
|
||||
# spaces after equal sign are allowed to get strings with leading spaces!
|
||||
line=line.replace(" =", "=")
|
||||
splitLine = line.split("=")
|
||||
# we don't want to have the newline char from dataset file as part of the value!!
|
||||
self.datagroups[splitLine[0]] = splitLine[1].rstrip("\n\r")
|
||||
f.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
from optparse import OptionParser
|
||||
parser = OptionParser()
|
||||
|
||||
Reference in New Issue
Block a user