From 6f2b87166839b8c525e992d98c38270388a25762 Mon Sep 17 00:00:00 2001 From: Michel Blockelet Date: Fri, 17 Apr 2009 13:32:09 +0200 Subject: [PATCH] [secours/secours.py] sre is deprecated darcs-hash:20090417113209-ddb99-a5f0e22662286a02253a5edc3ec60f1b0bd5f1dc.gz --- secours/secours.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/secours/secours.py b/secours/secours.py index 73cf0adc..456fea9d 100644 --- a/secours/secours.py +++ b/secours/secours.py @@ -14,7 +14,7 @@ Frédéric Pauget août 2005 """ -import sys, sre, os, commands +import sys, re, os, commands from socket import gethostname hostname = gethostname().split(".")[0] path = os.path.dirname(sys.argv[0]) @@ -74,14 +74,14 @@ def edit(file,comment,etat) : reste = 0 # Nombre de lignes restant à traiter while line : l = line.rstrip() - mo = sre.match('^(.*)'+signal+'(|-.)$',l) + mo = re.match('^(.*)'+signal+'(|-.)$',l) if (mo and len(mo.group(1)) > 1) or reste: # Ligne pour secours - if not sre.match('^' + comment,l) and etat == 'normal': + if not re.match('^' + comment,l) and etat == 'normal': # On est actuellement configuré en secours # Il faut passer en normal new += comment + line - elif sre.match('^' + comment,l) and etat == 'secours' : + elif re.match('^' + comment,l) and etat == 'secours' : # On est actuellement configuré en normal # Il faut passer en secours new += line.replace(comment,'',1)