diff --git a/pisi/comariface.py b/pisi/comariface.py new file mode 100644 index 00000000..68e91be3 --- /dev/null +++ b/pisi/comariface.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- + +import socket + +def registerScript(om, scriptPath): + s = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM) + s.connect("/tmp/comar") + cmd = '+' + om + ' ' + scriptPath + '\n' + s.send(cmd) + s.close() + return True + +def call(om): + s = socket.socket(socket.AF_UNIX,socket.SOCK_STREAM) + s.connect("/tmp/comar") + cmd = '$' + om + '\n' + s.send(cmd) + return s.recv(500)