[locate-mac] sre est deprecated (5)
Ignore-this: 7f9aabbcca44cdc2d03b6f50cb2d1741 darcs-hash:20090425002846-ffbb2-c5e5d5d8a9ab1dc874b08c558acf5585ed315895.gz
This commit is contained in:
parent
217fc4a764
commit
4640360160
1 changed files with 3 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
# -*- coding: iso-8859-15 -*-
|
# -*- coding: iso-8859-15 -*-
|
||||||
|
|
||||||
import sys, sre
|
import sys, re
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from os import system
|
from os import system
|
||||||
import threading
|
import threading
|
||||||
|
@ -50,10 +50,11 @@ def info_machine(mac):
|
||||||
s = []
|
s = []
|
||||||
db = crans_ldap()
|
db = crans_ldap()
|
||||||
machines = db.search("mac=%s" % mac)['machine']
|
machines = db.search("mac=%s" % mac)['machine']
|
||||||
|
color_re = re.compile('\x1b\[1;([0-9]|[0-9][0-9])m')
|
||||||
for m in machines:
|
for m in machines:
|
||||||
r = whos.machine_details(m)
|
r = whos.machine_details(m)
|
||||||
# On supprime les couleurs
|
# On supprime les couleurs
|
||||||
r = sre.sub('\x1b\[1;([0-9]|[0-9][0-9])m', '', r)
|
r = color_re.sub('', r)
|
||||||
s.append(r)
|
s.append(r)
|
||||||
if len(machines) == 0:
|
if len(machines) == 0:
|
||||||
s.append(u"Recherche LDAP de la MAC %s : aucune machine trouvée\n" % mac)
|
s.append(u"Recherche LDAP de la MAC %s : aucune machine trouvée\n" % mac)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue