class reg: def __init__(self): self.cnt = 0 import os .... def handler(self, iface, srfc): data = [] print "COMMAND is: #" + iface.COMMAND.getValue() + "#" out = os.popen(iface.COMMAND.getValue(), "r") for row in out: data.append(row) out.close() iface.PIPEDATA.setValue( data ) return 1
In tRFC (transaction RFC), the handler gets passed an additional parameter - the Transaction ID (TID), like so:
class reg: def __init__(self): self.cnt = 0 import os .... def handler(self, iface, srfc, tid): data = [] print "TID (reg.handler) is: #" + tid + "#" print "COMMAND is: #" + iface.COMMAND.getValue() + "#" out = os.popen(iface.COMMAND.getValue(), "r") for row in out: data.append(row) out.close() iface.PIPEDATA.setValue( data ) return 1 ....