[whos] On doit pouvoir se passer de try import sys

This commit is contained in:
Pauline Pommeret 2015-02-15 00:07:05 +01:00
parent b50bb20cbd
commit df21e43a91

View file

@ -43,26 +43,21 @@ d'historique des déconnexions affichées (défaut %(limit_aff_blacklist)i)
-6 ou --ipv6 : affiche les ipv6 dans l'affichage synthétique -6 ou --ipv6 : affiche les ipv6 dans l'affichage synthétique
""" """
try: import commands
import sys,locale import getopt
import subprocess
loc = locale.getdefaultlocale() import sys
if loc[1]:
sys.reallysetdefaultencoding(loc[1])
except:
pass
base = None
from time import strftime, localtime, time from time import strftime, localtime, time
from affich_tools import *
from ldap_crans import is_actif, crans_ldap, AssociationCrans, hostname from ldap_crans import is_actif, crans_ldap, AssociationCrans, hostname
from ldap_crans import MachineCrans, MachineWifi, BorneWifi from ldap_crans import MachineCrans, MachineWifi, BorneWifi
from ldap_crans import Adherent from ldap_crans import Adherent
from affich_tools import *
import gestion.config as config import gestion.config as config
import user_tests
import subprocess, commands
import ridtools import ridtools
import user_tests
base = None
limit_aff_details = 1 limit_aff_details = 1
limit_aff_machines = 15 limit_aff_machines = 15
@ -1102,7 +1097,7 @@ def borne_etat(borne) :
retour = os.system("fping6 -q -c 1 %s > /dev/null 2> /dev/null" % borne) retour = os.system("fping6 -q -c 1 %s > /dev/null 2> /dev/null" % borne)
if (retour == 0): if (retour == 0):
return True return True
else: else:
retour = os.system("fping -q -c 1 %s > /dev/null 2> /dev/null" % borne) retour = os.system("fping -q -c 1 %s > /dev/null 2> /dev/null" % borne)
return retour == 0 return retour == 0
except: except:
@ -1495,8 +1490,6 @@ if __name__ == '__main__' :
global debug global debug
debug = 0 debug = 0
import sys, getopt
base = crans_ldap() base = crans_ldap()
try : try :