From 1a4828dc6e95d8e72e45ca7520a3fc281ca76f4a Mon Sep 17 00:00:00 2001 From: salles Date: Mon, 24 Apr 2006 14:50:09 +0200 Subject: [PATCH] On ajoute la fonction __hash__ aux Machines pour pouvoir crer des dictionnaires avec un objet machine comme index. darcs-hash:20060424125009-72cb0-173fc722bc2139752ec1b4590cf30f382a512047.gz --- gestion/ldap_crans.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 70a6133a..271d028a 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -2675,6 +2675,9 @@ class Machine(base_classes_crans): ports.sort() self._set(champ, map(lambda x: ':'.join(map(str, x)), ports)) + def __hash__(self): + """Retourne un hash de l'objet Machine""" + return hash(self.nom()) class MachineFixe(Machine): """ Classe de définition d'une machine fixe """