Correction d'un bug.
darcs-hash:20070224010845-7b604-b07183a824dae637cbfe66d8b261cb675d9d0bb0.gz
This commit is contained in:
parent
38cfaab7b1
commit
432f9df3da
1 changed files with 9 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
#! /usr/bin/env python
|
||||
# -*- coding: iso-8859-15 -*-
|
||||
#
|
||||
# $Id: ajoute_chambre.py,v 1.1 2007-02-24 00:51:29 dimino Exp $
|
||||
# $Id: ajoute_chambre.py,v 1.2 2007-02-24 01:08:45 dimino Exp $
|
||||
#
|
||||
# ajoute_chambre.py
|
||||
# -----------------
|
||||
|
@ -81,8 +81,6 @@ prise doit
|
|||
tampon = annuaire.read()
|
||||
annuaire.close()
|
||||
|
||||
annuaire = open(__fichier_annuaire, 'w')
|
||||
|
||||
# Du parsing chiant...
|
||||
index = tampon.find('\nchbre_prises')
|
||||
if index == -1 or tampon[index + 13] not in [ ' ', '=' ]:
|
||||
|
@ -94,11 +92,16 @@ prise doit
|
|||
|
||||
index = tampon.find("'XXX':'%s'" % (prise), index + 3)
|
||||
if index == -1:
|
||||
return 'prise_introuvable'
|
||||
prise += '-'
|
||||
index = tampon.find("'XXX':'%s'" % (prise), index + 3)
|
||||
if index == -1:
|
||||
return 'prise_introuvable'
|
||||
|
||||
annuaire = open(__fichier_annuaire, 'w')
|
||||
|
||||
annuaire.write(tampon[:index])
|
||||
annuaire.write("'%s':'%s'" % (chbre, prise))
|
||||
annuaire.write(tampon[(index+11):])
|
||||
annuaire.write(tampon[(index+8+len(prise)):])
|
||||
|
||||
annuaire.close()
|
||||
|
||||
|
@ -113,7 +116,7 @@ prise doit
|
|||
user = "(uid=%d)" % (os.getuid())
|
||||
break
|
||||
|
||||
os.system('/usr/bin/cvs commit -d /usr/scripts/gestion %s \
|
||||
os.system('cd /usr/scripts/gestion && /usr/bin/cvs commit %s \
|
||||
-m "ajoute_chambre.py: chambre %s%s ajouté sur la prise %s%s par %s"' %
|
||||
(__fichier_annuaire, bat, chbre, bat, prise, user))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue