Commit 6cd6cde7 authored by Julien Muchembled's avatar Julien Muchembled

Sequence class: Add setdefault method and simplify code other methods to access sequence variables.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24868 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 43fb9e88
...@@ -120,16 +120,16 @@ class Sequence: ...@@ -120,16 +120,16 @@ class Sequence:
self._step_list.append(new_step) self._step_list.append(new_step)
def set(self, keyword, value): def set(self, keyword, value):
self._dict[keyword]=value self._dict[keyword] = value
def edit(self, **kw): def edit(self, *args, **kw):
for k, v in kw.items(): if self._dict.update(*args, **kw)
self._dict[k]=v
def get(self, keyword,default=None): def get(self, *args, **kw):
if self._dict.has_key(keyword): if self._dict.get(*args, **kw)
return self._dict[keyword]
return default def setdefault(self, *args, **kw):
if self._dict.setdefault(*args, **kw)
class SequenceList: class SequenceList:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment