From 0106cb2453061e2fbeb92275f3fc0e4cd38a09d2 Mon Sep 17 00:00:00 2001 From: oysteini Date: Sat, 5 Mar 2011 18:11:07 +0000 Subject: [PATCH] Fikset noen problemer i fileformat.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ting som ikke var strenger måtte konverteres. --- python/fileformat.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/fileformat.py b/python/fileformat.py index df588a4..fd1b71a 100644 --- a/python/fileformat.py +++ b/python/fileformat.py @@ -54,6 +54,9 @@ def read_action(lines): def write_field_value_str(val): lines = '' + if not val: + val = '' + val = unicode(val) value_lines = val.split('\n') for l in value_lines: lines += ' ' + l + '\n' @@ -63,13 +66,13 @@ def write_field_value_dict(val): lines = '\n' for (key,values) in val.items(): for single_value in values: - lines += ' ' + key + ' ' + single_value + '\n' + lines += ' ' + key + ' ' + unicode(single_value) + '\n' return lines def write_field_value_list(val): lines = '' for single_value in val: - lines += ' ' + single_value + lines += ' ' + unicode(single_value) return lines def write_action(d):