From df03450927bb386bfaee0d0bd0095a350eeeb964 Mon Sep 17 00:00:00 2001 From: glondu Date: Sat, 11 Mar 2006 16:52:19 +0100 Subject: [PATCH] Champ hotspot. darcs-hash:20060311155219-68412-5c98010bacd8664b7fdc3abccc5b02a41cb5f597.gz --- gestion/ldap_crans.py | 11 +++++++++++ gestion/whos.py | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 0c99cf4a..26b598e9 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2661,6 +2661,17 @@ class BorneWifi(Machine): mac[-1] = "%0.2x" % (int(mac[-1], 16) + 2) return ":".join(mac) + def hotspot(self, new=None): + """ Cette borne est-elle partagée avec l'ENS ? """ + if new == None: + # Le schéma nous assure que ce champ existe toujours + return self._data['hotspot'][0] == "TRUE" + else: + if new: + self._set('hotspot', ['TRUE']) + else: + self._set('hotspot', ['FALSE']) + def canal(self, new=None, raw=False): """ Attribution ou visualisation du canal d'une borne wifi """ if not new: diff --git a/gestion/whos.py b/gestion/whos.py index faae0534..19d4ad98 100755 --- a/gestion/whos.py +++ b/gestion/whos.py @@ -496,6 +496,11 @@ def machine_details(machine) : # Borne wifi if isinstance(machine, BorneWifi): + f += coul(u'Hotspot : ', 'gras') + if machine.hotspot(): + f += 'oui\n' + else: + f += 'non\n' f += coul(u'Puissance : ','gras') + u"%4.d" % int(machine.puissance()) f += coul(u'\tCanaux : ', 'gras') + machine.canal() f += coul(u'\tÉtat : ', 'gras')