Detabification massive.
darcs-hash:20051018083823-d1718-09c2df38cfb707d3c3679188b9b9a812009f4f7c.gz
This commit is contained in:
parent
3c54fb2904
commit
37b21339a6
40 changed files with 1473 additions and 1473 deletions
|
@ -15,32 +15,32 @@ class squid(gen_config) :
|
|||
restart_cmd = '/etc/init.d/squid reload'
|
||||
|
||||
def __str__(self) :
|
||||
return str(self.__class__).replace('_','-').split('.')[2]
|
||||
return str(self.__class__).replace('_','-').split('.')[2]
|
||||
|
||||
def _gen(self) :
|
||||
self._mklist()
|
||||
self._mklist()
|
||||
|
||||
def _mklist(self) :
|
||||
fic = self._open_conf(self.FICHIER)
|
||||
# recherche_bl :
|
||||
# 1 : search sur champ blacklist et clubs compris
|
||||
# 0 : search plus général et clubs exclus
|
||||
if self.recherche_bl==1:
|
||||
liste = self.db.search("paiement=ok&blacklist=*%s*"%self.chaine)
|
||||
l_proprio = liste["adherent"]+liste["club"]
|
||||
else:
|
||||
l_proprio = self.db.search('paiement=ok&' + self.chaine)["adherent"]
|
||||
self.anim.iter=len(l_proprio)
|
||||
for proprio in l_proprio :
|
||||
self.anim.cycle()
|
||||
if self.recherche_bl==0 or self.chaine in proprio.blacklist_actif():
|
||||
# Pas la peine de renvoyer les machines complètement bloqués
|
||||
for m in proprio.machines():
|
||||
if not 'bloq' in m.blacklist_actif():
|
||||
fic.write(m.Nom()+'\n')
|
||||
fic.close()
|
||||
fic = self._open_conf(self.FICHIER)
|
||||
# recherche_bl :
|
||||
# 1 : search sur champ blacklist et clubs compris
|
||||
# 0 : search plus général et clubs exclus
|
||||
if self.recherche_bl==1:
|
||||
liste = self.db.search("paiement=ok&blacklist=*%s*"%self.chaine)
|
||||
l_proprio = liste["adherent"]+liste["club"]
|
||||
else:
|
||||
l_proprio = self.db.search('paiement=ok&' + self.chaine)["adherent"]
|
||||
self.anim.iter=len(l_proprio)
|
||||
for proprio in l_proprio :
|
||||
self.anim.cycle()
|
||||
if self.recherche_bl==0 or self.chaine in proprio.blacklist_actif():
|
||||
# Pas la peine de renvoyer les machines complètement bloqués
|
||||
for m in proprio.machines():
|
||||
if not 'bloq' in m.blacklist_actif():
|
||||
fic.write(m.Nom()+'\n')
|
||||
fic.close()
|
||||
|
||||
|
||||
|
||||
class squid_upload(squid) :
|
||||
""" Genère le fichier blacklist-upload pour squid """
|
||||
FICHIER = "/etc/squid/blacklist_upload"
|
||||
|
@ -66,17 +66,17 @@ class squid_carte(squid) :
|
|||
recherche_bl = 0
|
||||
|
||||
if not bl_carte_et_actif :
|
||||
# Inutile de relancer squid si la blacklist n'est pas activée
|
||||
restart_cmd = ''
|
||||
# Inutile de relancer squid si la blacklist n'est pas activée
|
||||
restart_cmd = ''
|
||||
|
||||
def _gen(self) :
|
||||
# Liste vide si la blacklist n'est pas activée
|
||||
if not bl_carte_et_actif :
|
||||
fic = self._open_conf(self.FICHIER)
|
||||
# on vide la blackliste
|
||||
fic.close()
|
||||
return
|
||||
self._mklist()
|
||||
# Liste vide si la blacklist n'est pas activée
|
||||
if not bl_carte_et_actif :
|
||||
fic = self._open_conf(self.FICHIER)
|
||||
# on vide la blackliste
|
||||
fic.close()
|
||||
return
|
||||
self._mklist()
|
||||
|
||||
class squid_chbre(squid) :
|
||||
""" Genère le fichier blacklist-chbre pour squid """
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue