aboutsummaryrefslogtreecommitdiff
path: root/fix-labels.py
diff options
context:
space:
mode:
Diffstat (limited to 'fix-labels.py')
-rwxr-xr-xfix-labels.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/fix-labels.py b/fix-labels.py
index 039af04..225159d 100755
--- a/fix-labels.py
+++ b/fix-labels.py
@@ -625,7 +625,6 @@ labels = {
},
}
-
def update_text_line(text, prev, entrys):
m = re.match('^Text Label (\d+) +(\d+) +(\d+) +(\d+) +~', prev)
x, y, orient, dim = m.groups()
@@ -675,7 +674,8 @@ def fix_labels(fn_in, fn_out, file_labels):
in_ = open(fn_in)
out = open(fn_out, 'w')
prev = None
- print('Fixing labels in {}'.format(fn_in))
+ fn = os.path.basename(fn_in)
+ print('Fixing labels in {}'.format(fn))
for line in in_.readlines():
#print('R: {!r}'.format(line))
if prev is not None:
@@ -700,6 +700,8 @@ def fix_labels(fn_in, fn_out, file_labels):
#print("Unknown label: {!r} (not in {})".format(text, file_labels.keys()))
print("Unknown label: {!r}".format(text))
out.write(prev + '\n')
+ else:
+ out.write(prev + '\n')
prev = None
elif line.startswith('Text Label '):
prev = line