Salome HOME
CCAR:amelioration de la fonctionnalité mots clés inconnus
[tools/eficas.git] / Noyau / N__F.py
1 import UserDict
2
3 class _F(UserDict.UserDict):
4    """
5        Cette classe a un comportement semblable à un 
6        dictionnaire Python et permet de donner
7        la valeur d'un mot-clé facteur avec pour les sous 
8        mots-clés la syntaxe motcle=valeur
9    """
10
11    def __init__(self,**args):
12       self.data=args
13
14    def supprime(self):
15       self.data={}
16
17    def __cmp__(self, dict):
18       if type(dict) == type(self.data):
19         return cmp(self.data, dict)
20       elif hasattr(dict,"data"):
21         return cmp(self.data, dict.data)
22       else:
23         return cmp(self.data, dict)
24
25    def copy(self):
26       import copy
27       c= copy.copy(self)
28       c.data=self.data.copy()
29       return c
30
31
32