Fix string.format compatibility with Python 2.6

This commit is contained in:
Kovensky 2012-10-01 12:16:55 +00:00 committed by wm4
parent 683966241c
commit f9f6ded36c
1 changed files with 3 additions and 3 deletions

View File

@ -207,7 +207,7 @@ class MatroskaElement(object):
def __init__(self, name, elid, valtype, namespace):
self.name = name
self.definename = '{}_ID_{}'.format(namespace, name.upper())
self.definename = '{0}_ID_{1}'.format(namespace, name.upper())
self.fieldname = camelcase_to_words(name)
self.structname = 'ebml_' + self.fieldname
self.elid = elid
@ -292,7 +292,7 @@ def generate_C_definitions():
print()
if el.subelements:
print('#define N', el.fieldname)
print('E_S("{}", {})'.format(el.name, len(el.subelements)))
print('E_S("{0}", {1})'.format(el.name, len(el.subelements)))
for subel, multiple in el.subelements:
print('F({0.definename}, {0.fieldname}, {1})'.format(
subel, int(multiple)))
@ -393,7 +393,7 @@ def parse_one(s, depth, parent, maxlen):
if len(t) < 20:
t = hexlify(t).decode('ascii')
else:
t = '<skipped {} bytes>'.format(len(t))
t = '<skipped {0} bytes>'.format(len(t))
print('binary', t, dec)
elif elem.valtype == 'uint':
print('uint', read_uint(s, length))