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))
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))
def addValueCondition(self, name, port, v): libpyvle.condition_add_value(self.vpz, name, port, to_value(v))
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))
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))
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))
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))
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))