Fixed some errors in fileformat.py, and added some debugging code.
This commit is contained in:
parent
cdaa0430d8
commit
46a606c2bf
|
@ -7,9 +7,9 @@ import types
|
|||
# strings), 'l' (list of strings).
|
||||
fields = {
|
||||
'book':
|
||||
[('isbn', 's'), ('title', 's'), ('category', 's'),
|
||||
[('isbn', 's'), ('id', 's'), ('title', 's'), ('category', 's'),
|
||||
('subtitle', 's'), ('persons', 'd'), ('publisher', 's'),
|
||||
('published_year', 'i'), ('edition', 'i'), ('num_pages', 'i'),
|
||||
('published_year', 'i'), ('edition', 'i'), ('pages', 'i'),
|
||||
('series', 's'), ('description', 's'), # TODO picture, thumbnail
|
||||
('references', 'd')],
|
||||
'person':
|
||||
|
@ -118,6 +118,12 @@ def read_action(text):
|
|||
'd': read_field_value_dict,
|
||||
'l': read_field_value_list }[ftype]
|
||||
result[field] = reader(d[field])
|
||||
else:
|
||||
result[field] = None
|
||||
|
||||
print 'final dict:'
|
||||
print result
|
||||
|
||||
return result
|
||||
|
||||
def read_actionlist(text):
|
||||
|
|
Reference in New Issue