diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py b/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py index b810af5..2487b96 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/CardGenerator.py @@ -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()