Endret read_action til å ta inn en streng istedenfor en liste.
This commit is contained in:
parent
8b425a26ef
commit
8a578ffdb2
|
@ -70,7 +70,8 @@ def read_field_value_dict(val):
|
|||
def read_field_value_list(val):
|
||||
return val.strip().split(' ')
|
||||
|
||||
def read_action(lines):
|
||||
def read_action(text):
|
||||
lines = text.split('\n')
|
||||
d = {}
|
||||
lastfield = None
|
||||
for line in lines:
|
||||
|
@ -101,7 +102,7 @@ def read_action(lines):
|
|||
return result
|
||||
|
||||
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'))
|
||||
|
||||
def write_field_value_str(val):
|
||||
|
|
Reference in New Issue