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

Endret read_action til å ta inn en streng istedenfor en liste.

This commit is contained in:
Øystein Ingmar Skartsæterhagen 2011-03-06 10:42:41 +00:00
parent 8b425a26ef
commit 8a578ffdb2
1 changed files with 3 additions and 2 deletions

View File

@ -70,7 +70,8 @@ def read_field_value_dict(val):
def read_field_value_list(val): def read_field_value_list(val):
return val.strip().split(' ') return val.strip().split(' ')
def read_action(lines): def read_action(text):
lines = text.split('\n')
d = {} d = {}
lastfield = None lastfield = None
for line in lines: for line in lines:
@ -101,7 +102,7 @@ def read_action(lines):
return result return result
def read_actionlist(text): def read_actionlist(text):
return map(lambda x: read_action(x.strip().split('\n')), return map(lambda x: read_action(x.strip()),
text.split('\n\n')) text.split('\n\n'))
def write_field_value_str(val): def write_field_value_str(val):