Changeset 866 for trunk/Monitoring/smon/types.py
- Timestamp:
- 06/09/13 23:52:36 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Monitoring/smon/types.py
r865 r866 2 2 3 3 ################################## 4 # @program 4 # @program smon 5 5 # @description simulation monitor 6 # @copyright 7 # 8 # @svn_file 9 # @version 6 # @copyright Copyright â(c)2009 Centre National de la Recherche Scientifique CNRS. 7 # All Rights Reservedâ 8 # @svn_file $Id: types.py 2599 2013-03-24 19:01:23Z jripsl $ 9 # @version $Rev: 2599 $ 10 10 # @lastrevision $Date: 2013-03-24 20:01:23 +0100 (Sun, 24 Mar 2013) $ 11 # @license 11 # @license CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE) 12 12 ################################## 13 13 … … 25 25 self.msg=msg 26 26 27 28 27 def __str__(self): 28 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 29 29 30 30 class Tree(): 31 31 32 32 def __init__(self,**kw): 33 33 pass 34 34 35 36 35 def __str__(self): 36 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 37 37 38 38 class Simulation(): 39 39 40 40 def __init__(self,**kw): 41 41 self.exec_start_date=kw.get("exec_start_date") 42 42 self.exec_end_date=kw.get("exec_end_date") 43 43 self.status=kw.get("status") 44 self.name=kw.get("name") 44 45 45 def __str__(self): 46 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 46 def __str__(self): 47 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 48 49 class Message(): 50 51 def __init__(self,JSON_KW): 52 for key in JSON_KW: 53 setattr(self, key, JSON_KW[key]) 54 55 def __str__(self): 56 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 47 57 48 58 class SimulationTree(Tree): 49 59 50 60 def __init__(self,**kw): 51 61 dg = nx.DiGraph() 52 62 53 63 def update(cls): 54 64 dg.add_edge('a','b') 55 56 def print (cls):57 print dg.edges() 65 66 def print__TODO(cls): 67 print dg.edges() 58 68 59 69 def write(cls): … … 63 73 dg = pickle.load(open('/tmp/graph.txt')) 64 74 65 66 75 def __str__(self): 76 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()]) 67 77 68 78 class SimulationTrees(): 69 79 70 71 80 def __init__(self,**kw): 81 self.sample=kw.get("sample",[]) 72 82 73 74 83 def __str__(self): 84 return ",".join(['%s=%s'%(k,str(v)) for (k,v) in self.__dict__.iteritems()])
Note: See TracChangeset
for help on using the changeset viewer.