[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
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
|
||||
import sys, sre
|
||||
import sys, re
|
||||
from time import sleep
|
||||
from os import system
|
||||
import threading
|
||||
|
@ -50,10 +50,11 @@ def info_machine(mac):
|
|||
s = []
|
||||
db = crans_ldap()
|
||||
machines = db.search("mac=%s" % mac)['machine']
|
||||
color_re = re.compile('\x1b\[1;([0-9]|[0-9][0-9])m')
|
||||
for m in machines:
|
||||
r = whos.machine_details(m)
|
||||
# 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)
|
||||
if len(machines) == 0:
|
||||
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