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).
|
# strings), 'l' (list of strings).
|
||||||
fields = {
|
fields = {
|
||||||
'book':
|
'book':
|
||||||
[('isbn', 's'), ('title', 's'), ('category', 's'),
|
[('isbn', 's'), ('id', 's'), ('title', 's'), ('category', 's'),
|
||||||
('subtitle', 's'), ('persons', 'd'), ('publisher', '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
|
('series', 's'), ('description', 's'), # TODO picture, thumbnail
|
||||||
('references', 'd')],
|
('references', 'd')],
|
||||||
'person':
|
'person':
|
||||||
|
@ -118,6 +118,12 @@ def read_action(text):
|
||||||
'd': read_field_value_dict,
|
'd': read_field_value_dict,
|
||||||
'l': read_field_value_list }[ftype]
|
'l': read_field_value_list }[ftype]
|
||||||
result[field] = reader(d[field])
|
result[field] = reader(d[field])
|
||||||
|
else:
|
||||||
|
result[field] = None
|
||||||
|
|
||||||
|
print 'final dict:'
|
||||||
|
print result
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def read_actionlist(text):
|
def read_actionlist(text):
|
||||||
|
|
Reference in New Issue