[attributs] Possibilité de donner à manger un dicrionnaire à une blackliste
This commit is contained in:
parent
525d7941ff
commit
7b7511e493
1 changed files with 7 additions and 1 deletions
|
@ -1076,7 +1076,13 @@ class blacklist(Attr):
|
||||||
python_type = dict
|
python_type = dict
|
||||||
|
|
||||||
def parse_value(self, blacklist):
|
def parse_value(self, blacklist):
|
||||||
bl_debut, bl_fin, bl_type, bl_comm = blacklist.split('$')
|
if isinstance(blacklist, self.python_type):
|
||||||
|
if set(blacklist.keys()).issuperset(['debut', 'fin', 'type', 'comm']):
|
||||||
|
bl_debut, bl_fin, bl_type, bl_comm = (blacklist['debut'], blacklist['fin'], blacklist['type'], blacklist['comm'])
|
||||||
|
else:
|
||||||
|
raise ValueError("A blacklist should contain the following keys : 'debut', 'fin', 'type', 'comm'")
|
||||||
|
else:
|
||||||
|
bl_debut, bl_fin, bl_type, bl_comm = blacklist.split('$')
|
||||||
now = time.time()
|
now = time.time()
|
||||||
self.value = { 'debut' : bl_debut if bl_debut == '-' else int (bl_debut),
|
self.value = { 'debut' : bl_debut if bl_debut == '-' else int (bl_debut),
|
||||||
'fin' : bl_fin if bl_fin == '-' else int(bl_fin),
|
'fin' : bl_fin if bl_fin == '-' else int(bl_fin),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue