Mercurial > MadButterfly
annotate 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 |
rev | line source |
---|---|
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
wycc@wycc-desktop
parents:
diff
changeset
|
1 from twisted.web import soap |
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
wycc@wycc-desktop
parents:
diff
changeset
|
2 from twisted.internet import reactor |
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
wycc@wycc-desktop
parents:
diff
changeset
|
3 import sys,os |
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
wycc@wycc-desktop
parents:
diff
changeset
|
4 class Inkscape(object): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
5 def __init__(self): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
6 self.server = soap.Proxy('http://localhost:19192') |
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
wycc@wycc-desktop
parents:
diff
changeset
|
7 def PUBLISH(self): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
8 return self.server.callRemote('PUBLISH') |
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
wycc@wycc-desktop
parents:
diff
changeset
|
9 def SCENE(self,n): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
10 return self.server.callRemote('SCENE',n) |
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
wycc@wycc-desktop
parents:
diff
changeset
|
11 def START(self): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
12 return self.server.callRemote('START') |
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
wycc@wycc-desktop
parents:
diff
changeset
|
13 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
14 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
15 def quitSession(result): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
16 print [result] |
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
wycc@wycc-desktop
parents:
diff
changeset
|
17 reactor.stop() |
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
wycc@wycc-desktop
parents:
diff
changeset
|
18 def quitError(result): |
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
wycc@wycc-desktop
parents:
diff
changeset
|
19 print "Error" |
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
wycc@wycc-desktop
parents:
diff
changeset
|
20 print[result] |
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
wycc@wycc-desktop
parents:
diff
changeset
|
21 reactor.stop() |
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
wycc@wycc-desktop
parents:
diff
changeset
|
22 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
23 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
24 ink = Inkscape() |
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
wycc@wycc-desktop
parents:
diff
changeset
|
25 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
26 if sys.argv[1] == 'PUBLISH': |
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
wycc@wycc-desktop
parents:
diff
changeset
|
27 d = ink.PUBLISH() |
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
wycc@wycc-desktop
parents:
diff
changeset
|
28 elif sys.argv[1] == 'SCENE': |
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
wycc@wycc-desktop
parents:
diff
changeset
|
29 d = ink.SCENE(sys.argv[2]) |
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
wycc@wycc-desktop
parents:
diff
changeset
|
30 elif sys.argv[1] == 'START': |
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
wycc@wycc-desktop
parents:
diff
changeset
|
31 d = ink.START() |
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
wycc@wycc-desktop
parents:
diff
changeset
|
32 else: |
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
wycc@wycc-desktop
parents:
diff
changeset
|
33 print 'Unknown command %s' % sys.argv[1] |
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
wycc@wycc-desktop
parents:
diff
changeset
|
34 sys.exit(-1) |
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
wycc@wycc-desktop
parents:
diff
changeset
|
35 d.addCallback(quitSession) |
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
wycc@wycc-desktop
parents:
diff
changeset
|
36 d.addErrback(quitError) |
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
wycc@wycc-desktop
parents:
diff
changeset
|
37 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
38 |
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
wycc@wycc-desktop
parents:
diff
changeset
|
39 reactor.run() |