Projects/worblehat-old
Projects
/
worblehat-old
Archived
12
0
Fork 0

Fixed some errors in fileformat.py, and added some debugging code.

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2011-10-08 17:08:46 +00:00
parent cdaa0430d8
commit 46a606c2bf
1 changed files with 8 additions and 2 deletions

View File

@ -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):