diff inkscape/firefox/testsoap.py @ 262:c39b24036a75

Add proxy daemon and extention for the firefox integration. We need to implement javascript web client to repalce the unite test program testsoap.py
author wycc@wycc-desktop
date Fri, 23 Jan 2009 23:15:04 +0800
parents
children 96aae15527c8
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/inkscape/firefox/testsoap.py	Fri Jan 23 23:15:04 2009 +0800
@@ -0,0 +1,39 @@
+from twisted.web import soap
+from twisted.internet import reactor
+import sys,os
+class Inkscape(object):
+	def __init__(self):
+		self.server = soap.Proxy('http://localhost:19192')
+	def PUBLISH(self):
+		return self.server.callRemote('PUBLISH')
+	def SCENE(self,n):
+		return self.server.callRemote('SCENE',n)
+	def START(self):
+		return self.server.callRemote('START')
+
+
+def quitSession(result):
+	print [result]
+	reactor.stop()
+def quitError(result):
+	print "Error"
+	print[result]
+	reactor.stop()
+
+
+ink = Inkscape()
+
+if sys.argv[1] == 'PUBLISH':
+	d = ink.PUBLISH()
+elif sys.argv[1] == 'SCENE':
+	d = ink.SCENE(sys.argv[2])
+elif sys.argv[1] == 'START':
+	d = ink.START()
+else:
+	print 'Unknown command %s' % sys.argv[1]
+	sys.exit(-1)
+d.addCallback(quitSession)
+d.addErrback(quitError)
+
+
+reactor.run()