Skip to content
Snippets Groups Projects
Commit e191d421 authored by Damien George's avatar Damien George
Browse files

py: Use % str formatting instead of {} in makeqstrdata.py.

Script is equivalent, but now also runs under ancient Python 2.6.
Goes part way to addressing issue #847.
parent b534e1b9
No related branches found
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ def do_work(infiles): ...@@ -58,7 +58,7 @@ def do_work(infiles):
for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]): for order, ident, qstr in sorted(qstrs.values(), key=lambda x: x[0]):
qhash = compute_hash(qstr) qhash = compute_hash(qstr)
qlen = len(qstr) qlen = len(qstr)
print('Q({}, (const byte*)"\\x{:02x}\\x{:02x}\\x{:02x}\\x{:02x}" "{}")'.format(ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen & 0xff, (qlen >> 8) & 0xff, qstr)) print('Q(%s, (const byte*)"\\x%02x\\x%02x\\x%02x\\x%02x" "%s")' % (ident, qhash & 0xff, (qhash >> 8) & 0xff, qlen & 0xff, (qlen >> 8) & 0xff, qstr))
return True return True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment