Exemple #1
0
 def createCondition(self, name, **ports):
     # ports is an optional list a keyworgs args :
     # portname = value, ...
     libpyvle.condition_create(self.vpz, name)
     for portname, val in ports.iteritems():
         libpyvle.condition_add_value(self.vpz, name,
                                     portname, to_value(val))
Exemple #2
0
 def addXMLCondition(self, name, port, v):
     if isinstance(v,VleXML):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u'Can\'t convert type %s to VleXML' % type(v))
Exemple #3
0
 def addValueCondition(self, name, port, v):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
Exemple #4
0
 def addBooleanCondition(self, name, port, v):
     if isinstance(v,bool):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u'Can\'t convert type %s to bool' % type(v))
Exemple #5
0
 def addStringCondition(self, name, port, v):
     if isinstance(v,str):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u'Can\'t convert type %s to str' % type(v))
Exemple #6
0
 def addIntegerCondition(self, name, port, v):
     if isinstance(v,int):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u'Can\'t convert type %s to int' % type(v))
Exemple #7
0
 def addTupleCondition(self, name, port, v):
     if isinstance(v, VleTuple):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u"Can't convert type %s to VleTuple" % type(v))
Exemple #8
0
 def addSetCondition(self, name, port, v):
     if isinstance(v, list):
         libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
     else:
         raise ValueError(u"Can't convert type %s to list" % type(v))