From df21e43a912f17cc62c44c0b7643af3658090dd2 Mon Sep 17 00:00:00 2001 From: Pauline Pommeret Date: Sun, 15 Feb 2015 00:07:05 +0100 Subject: [PATCH] [whos] On doit pouvoir se passer de try import sys --- gestion/whos.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/gestion/whos.py b/gestion/whos.py index 6ec78137..136e6607 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -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 """ -try: - import sys,locale - - loc = locale.getdefaultlocale() - if loc[1]: - sys.reallysetdefaultencoding(loc[1]) -except: - pass - -base = None - +import commands +import getopt +import subprocess +import sys from time import strftime, localtime, time + +from affich_tools import * from ldap_crans import is_actif, crans_ldap, AssociationCrans, hostname from ldap_crans import MachineCrans, MachineWifi, BorneWifi from ldap_crans import Adherent -from affich_tools import * import gestion.config as config -import user_tests -import subprocess, commands import ridtools +import user_tests + +base = None limit_aff_details = 1 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) if (retour == 0): return True - else: + else: retour = os.system("fping -q -c 1 %s > /dev/null 2> /dev/null" % borne) return retour == 0 except: @@ -1495,8 +1490,6 @@ if __name__ == '__main__' : global debug debug = 0 - import sys, getopt - base = crans_ldap() try :