[printing] Formatage du numéro de téléphone
This commit is contained in:
parent
45faa88482
commit
49709b663a
2 changed files with 12 additions and 1 deletions
|
@ -27,6 +27,16 @@ def blacklist(l):
|
|||
def split(str, *arg):
|
||||
return str.split(*arg)
|
||||
|
||||
def telephone(l):
|
||||
tel=[]
|
||||
for t in l:
|
||||
if len(str(t)) == 10:
|
||||
tel.append("%c%c.%c%c.%c%c.%c%c.%c%c" % tuple(map(ord, str(t))))
|
||||
else:
|
||||
if t.startswith("00"):
|
||||
t="+%s" % t[2:]
|
||||
tel.append(t)
|
||||
return tel
|
||||
|
||||
templateEnv=None
|
||||
def template():
|
||||
|
@ -42,6 +52,7 @@ def template():
|
|||
templateEnv.filters['prise_etat'] = prise_etat
|
||||
templateEnv.filters['timeformat'] = timeformat
|
||||
templateEnv.filters['split'] = split
|
||||
templateEnv.filters['telephone'] = telephone
|
||||
return templateEnv
|
||||
|
||||
def machine(machine, params):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue