[filter] Fonction pour récupérer une structure de donnée manipulable en python

This commit is contained in:
Valentin Samir 2013-11-17 20:20:57 +01:00
parent cb4ac3ca18
commit aa573c3c35
2 changed files with 11 additions and 6 deletions

View file

@ -43,6 +43,10 @@ def toldapfilter(l):
return "!(%s=%s)" % (l[1], l[2])
return op + ''.join(['(%s)' % toldapfilter(i) for i in l[1:]])
def human_to_ldap(str):
return "(%s)" % toldapfilter(toprefix(simplify(expr.parseString(str).asList())))
def human_to_list(data):
if data:
return toprefix(simplify(expr.parseString(data).asList()))
def human_to_ldap(data):
return "(%s)" % toldapfilter(human_to_list(data))