Commit f153e735 authored by Vincent Stehlé's avatar Vincent Stehlé
Browse files more robust printing

Deal with the case where not all records have a given field more gracefully
during printing. This happens for those fields, which are generated
on-the-fly by configuration rules for example.

Signed-off-by: Vincent Stehlé's avatarVincent Stehlé <>
parent 562b2fcf
......@@ -497,14 +497,16 @@ def do_print(cross_check, fields):
w[f] = max(w[f], len(str(x[f])))
# Second pass where we print
lf = fields[len(fields) - 1]
print(' '.join([
*map(lambda f: f"{f:{w[f]}}", fm1),
fields[len(fields) - 1]]))
for x in cross_check:
print(' '.join([
*map(lambda f: f"{x[f]:{w[f]}}", fm1),
x[fields[len(fields) - 1]]]))
*map(lambda f: f"{x[f]:{w[f] if f in x else ''}}", fm1),
x[lf] if lf in x else '']))
# Combine or two databases db1 and db2 coming from ekl and seq files
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment