Permalink
Browse files

[offline-renderer] fixes for debugging programs

For title display and output format

Signed-off-by: Christopher Hall <hsw@openmoko.com>
  • Loading branch information...
hxw committed Apr 8, 2010
1 parent 4a8007b commit 4450b7d3816d231f456f4a116fa2b801f9ad4951
Showing with 6 additions and 6 deletions.
  1. +1 −1 host-tools/offline-renderer/DumpFiles.py
  2. +5 −5 host-tools/offline-renderer/DumpFnd.py
@@ -120,7 +120,7 @@ def process(index_number, idx_file, fnd_file, dat_format, extract):
ignored = fnd_file.read(1) # skip nul byte
titles = fnd_file.read(1024).split('\0') # >= 2 * MAX_TITLE_SEARCH
- PrintLog.message('FND title = "{0:s}"'.format(titles[1])) # actual title
+ PrintLog.message('FND title = "{0!r:s}"'.format(titles[1])) # actual title
dat_file = open(data_file_name, 'rb')
dat_file.seek(offset_dat)
@@ -100,11 +100,11 @@ def main():
else:
decoded_title1 += c
- PrintLog.message(u'{0:13n}: [{1:d}/{2:d}]:{3!r:s}={4!r:s}\n{5:s}[{6:d}/{7:d}]:"{8:s}"'
- .format(article_number,
- length1, full_length1, title1, decoded_title1,
- ' ' * 15,
- length2, full_length2, truncated_utf8(title2)))
+ PrintLog.message(u'{an:13n}: [{l1:3d}/{fl1:3d}]:{t1!r:s}\n{pad1:s}{pad2}{dt1!r:s}\n{pad1:s}[{fl1:3d}/{fl2:3d}]:"{t2:s}"\n'
+ .format(an = article_number,
+ l1 = length1, fl1 = full_length1, t1 = title1, dt1 = decoded_title1,
+ pad1 = ' ' * 15, pad2 = ' ' * (2 * 3 + 4),
+ l2 = length2, fl2 = full_length2, t2 = truncated_utf8(title2)))
previous_title1 = title1
previous_title2 = title2

0 comments on commit 4450b7d

Please sign in to comment.