From 46a606c2bf586b542254acb0d9b4b2aeb3572a9d Mon Sep 17 00:00:00 2001 From: oysteini Date: Sat, 8 Oct 2011 17:08:46 +0000 Subject: [PATCH] Fixed some errors in fileformat.py, and added some debugging code. --- cli/fileformat.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cli/fileformat.py b/cli/fileformat.py index adfd0bb..1708de4 100644 --- a/cli/fileformat.py +++ b/cli/fileformat.py @@ -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):