mirror of https://github.com/openXC7/prjxray.git
parsedb: more verbose on duplicate bits
Signed-off-by: John McMaster <johndmcmaster@gmail.com>
This commit is contained in:
parent
a2c22c5379
commit
962dcc78d0
|
|
@ -7,7 +7,7 @@ from prjxray import util
|
|||
def run(fnin, fnout=None, strict=False, verbose=False):
|
||||
lines = open(fnin, 'r').read().split('\n')
|
||||
tags = dict()
|
||||
bitss = set()
|
||||
bitss = dict()
|
||||
for line in lines:
|
||||
line = line.strip()
|
||||
if line == '':
|
||||
|
|
@ -23,11 +23,11 @@ def run(fnin, fnout=None, strict=False, verbose=False):
|
|||
print("Original line: %s" % tags[tag])
|
||||
print("New line: %s" % line)
|
||||
assert 0, "strict: got duplicate tag %s" % (tag, )
|
||||
assert bits not in bitss, "strict: got duplicate bits %s (ex: %s)" % (
|
||||
bits, line)
|
||||
assert bits not in bitss, "strict: got duplicate bits %s: %s %s" % (
|
||||
bits, tag, bitss[bits])
|
||||
tags[tag] = line
|
||||
if bits != None:
|
||||
bitss.add(bits)
|
||||
bitss[bits] = tag
|
||||
|
||||
if fnout:
|
||||
with open(fnout, "w") as fout:
|
||||
|
|
|
|||
Loading…
Reference in New Issue