[lc_ldap/*] (more) pylint compliance
This commit is contained in:
parent
db8b27e6a5
commit
a36bafa021
3 changed files with 35 additions and 23 deletions
|
@ -31,6 +31,7 @@
|
|||
|
||||
import netaddr, time, smtplib
|
||||
import config
|
||||
from unicodedata import normalize
|
||||
|
||||
def ip_of_mid(mid):
|
||||
"""Convertit un mid en son IP associée"""
|
||||
|
@ -44,7 +45,7 @@ def ip_of_mid(mid):
|
|||
|
||||
def strip_accents(a):
|
||||
""" Supression des accents de la chaîne fournie"""
|
||||
res = normalize('NFKD', decode(a)).encode('ASCII', 'ignore')
|
||||
res = normalize('NFKD', a).encode('ASCII', 'ignore')
|
||||
return res.replace(' ', '_').replace("'", '')
|
||||
|
||||
def mailexist(mail):
|
||||
|
@ -53,7 +54,7 @@ def mailexist(mail):
|
|||
|
||||
mail = mail.split('@', 1)[0]
|
||||
try:
|
||||
s = smtplib.SMTP(smtpserv)
|
||||
s = smtplib.SMTP(config.smtpserv)
|
||||
s.putcmd("vrfy", mail)
|
||||
r = s.getreply()[0] in [250, 252]
|
||||
s.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue