Skip to content

Commit

Permalink
DFReader.py: emit newline separately to unit
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbarker committed Jul 3, 2024
1 parent 3dfa19e commit 5bfad6c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions DFReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,18 @@ def dump_verbose(self, f):
f.write(" %s: %s" % (c, val))
except UnicodeDecodeError:
f.write(" %s: %s" % (c, to_string(val)))

# Append the unit to the output
unit = self.fmt.get_unit(c)
if unit == "":
# No unit specified - just output the newline
f.write("\n")
elif unit.startswith("rad"):
if unit.startswith("rad"):
# For rad or rad/s, add the degrees conversion too
f.write(" %s (%s %s)\n" % (unit, math.degrees(val), unit.replace("rad","deg")))
f.write(" %s (%s %s)" % (unit, math.degrees(val), unit.replace("rad","deg")))
else:
# Append the unit
f.write(" %s\n" % (unit))
f.write(" %s" % (unit))

# output the newline
f.write("\n")

# if this is a bitmask then print out all bits set:
if c in field_metadata_by_name:
Expand Down

0 comments on commit 5bfad6c

Please sign in to comment.