annotate inkscape/firefox/MBServer.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 #!/usr/bin/python
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 import inkex
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 pygtk
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 import gtk
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 from copy import deepcopy
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 from lxml import etree
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 from twisted.web import server, resource,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
8 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
9
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 import random
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
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 # Please refer to http://www.assembla.com/wiki/show/MadButterfly/Inkscape_extention for the designed document.
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 # Algorithm:
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 #
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 # We will parse the first two level of the SVG DOM. collect a table of layer and 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
18 # 1. Collect the layer table which will be displayed as the first column of the grid.
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 # 2. Get the maximum scene number. This will decide the size of the grid.
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 # 3. When F6 is pressed, we will check if this scene has been defined. This can be done by scan all second level group and check if the current scene number is within the
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 # range specified by scene field. The function IsSceneDefined(scene) can be used for this purpose.
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 # 4. If this is a new scene, we will append a new group which duplication the content of the last scene in the same group. The scene field will contain the number from the
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 # last scene number of the last scene to the current scenen number. For example, if the last scene is from 4-7 and the new scene is 10, we will set the scene field as
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 # "8-10".
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 # 5. If this scene are filled screne, we will split the existing scene into two scenes with the same content.
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
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 class Layer:
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 def __init__(self,node):
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 self.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
30 self.node = node
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 self.nodes=[]
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 class 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
33 def __init__(self, node, start,end):
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 self.node = node
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 self.start = int(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
36 self.end = int(end)
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 class MBScene(inkex.Effect):
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
40 def confirm(self,msg):
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
41 vbox = gtk.VBox()
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
42 vbox.pack_start(gtk.Label(msg))
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
43 self.button = gtk.Button('OK')
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
44 vbox.pack_start(self.button)
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
45 self.button.connect("clicked", self.onQuit)
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
46 self.window.add(vbox)
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
47 def dumpattr(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
48 s = ""
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
49 for a,v in n.attrib.items():
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
50 s = s + ("%s=%s" % (a,v))
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
51 return s
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
52
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
53 def dump(self,node,l=0):
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
54 print " " * l*2,"<", node.tag, self.dumpattr(node),">"
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
55 for n in node:
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
56 self.dump(n,l+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
57 print " " * l * 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
58 def parseMetadata(self,node):
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
59 self.current = 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
60 for n in node:
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
61 if n.tag == '{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}scenes':
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
62 self.scenemap={}
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
63 cur = int(n.get("current"))
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
64 self.current = cur
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
65
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
66 for s in 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
67 if s.tag == '{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}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
68 try:
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
69 start = int(s.get("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
70 except:
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
71 continue
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
72 try:
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
73 end = s.get("end")
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
74 if end == None:
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
75 end = 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
76 except:
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
77 end = 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
78 link = s.get("ref")
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
79 self.scenemap[link] = [int(start),int(end)]
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
80 if cur >= start and cur <= end:
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
81 self.currentscene = link
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
82
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
83 pass
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
84 pass
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
85 pass
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
86 pass
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
87
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
88
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
89 def parseScene(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
90 """
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
91 In this function, we will collect all items for the current scene and then relocate them back to the appropriate scene 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
92 """
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
93 self.layer = []
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
94 self.scenemap = None
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
95 for node in self.document.getroot():
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
96 if node.tag == '{http://www.w3.org/2000/svg}metadata':
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
97 self.parseMetadata(node)
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
98 elif node.tag == '{http://www.w3.org/2000/svg}g':
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
99 oldscene = None
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
100 #print layer.attrib.get("id")
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
101 lyobj = Layer(node)
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
102 self.layer.append(lyobj)
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
103 lyobj.current_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
104 for scene in node:
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
105 if scene.tag == '{http://www.w3.org/2000/svg}g':
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
106 try:
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
107 scmap = self.scenemap[scene.get("id")]
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
108 if scmap == None:
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
109 lyobj.current_scene.append(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
110 continue
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
111 if self.current <= scmap[1] and self.current >= scmap[0]:
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
112 oldscene = 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
113 except:
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
114 lyobj.current_scene.append(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
115 continue
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
116
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
117 lyobj.scene.append(Scene(scene,scmap[0],scmap[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
118 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
119 lyobj.current_scene.append(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
120 pass
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
121 pass
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
122
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
123 if oldscene != None:
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
124 # Put the objects back to the current 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
125 for o in lyobj.current_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
126 #print o.tag
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
127 oldscene.append(o)
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
128 pass
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
129 pass
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
130 pass
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
131 pass
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
132
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
133 self.collectID()
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
134 #self.dumpID()
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
135 def collectID(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
136 self.ID = {}
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
137 root = self.document.getroot()
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
138 for n in root:
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
139 self.collectID_recursive(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
140 def collectID_recursive(self,node):
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
141 self.ID[node.get("id")] = 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
142 for n in node:
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
143 self.collectID_recursive(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
144 def newID(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
145 while True:
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
146 n = 's%d' % int(random.random()*10000)
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
147 #print "try %s" % 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
148 if self.ID.has_key(n) == False:
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
149 return 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
150 def dumpID(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
151 for a,v in self.ID.items():
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
152 print a
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
153
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
154
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
155 def getLayer(self, layer):
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
156 for l in self.layer:
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
157 if l.node.attrib.get("id") == layer:
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
158 return l
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
159 return None
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
160
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
161
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
162 def insertKeyScene(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
163 """
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
164 Insert a new key scene into the stage. If the nth is always a key scene, we will return without changing anything.
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
165 If the nth is a filled scene, we will break the original scene into two parts. If the nth is out of any scene, we will
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
166 append a new 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
167
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
168 """
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
169 nth = self.last_cell.nScene
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
170 layer = self.getLayer(self.last_cell.layer)
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
171 x = self.last_cell.nScene
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
172 y = self.last_cell.nLayer
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
173 if layer == None: return
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
174 for i in range(0,len(layer.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
175 s = layer.scene[i]
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
176 if nth >= s.start and nth <= s.end:
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
177 if nth == s.start: return
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
178 newscene = Scene(deepcopy(s.node),nth,s.end)
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
179 newscene.node.set("id", self.newID())
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
180 layer.scene.insert(i+1,newscene)
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
181 layer.scene[i].end = nth-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
182 btn = self.newCell('start.png')
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
183 btn.nScene = nth
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
184 btn.layer = layer
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
185 btn.nLayer = y
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
186 self.grid.remove(self.last_cell)
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
187 self.grid.attach(btn, x,x+1,y,y+1,0,0,0,0)
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
188 return
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
189 if len(layer.scene) > 0:
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
190 last = nth
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
191 lastscene = None
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
192 for s in layer.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
193 if s.end < nth and last < s.end:
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
194 last = s.end
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
195 lastscene = s
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
196 for x in range(last+1, nth):
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
197 btn = self.newCell('fill.png')
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
198 btn.nScene = x
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
199 btn.layer = layer.node.get('id')
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
200 btn.nLayer = y
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
201 self.grid.attach(btn, x, x+1, y , y+1,0,0,0,0)
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
202 if lastscene == None:
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
203 node = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}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
204 node.set("id", self.newID())
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
205 newscene = Scene(node,nth,nth)
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
206 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
207 lastscene.end = nth-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
208 newscene = Scene(deepcopy(lastscene.node),nth,nth)
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
209 newscene.node.set("id",self.newID())
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
210 layer.scene.append(newscene)
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
211 btn = self.newCell('start.png')
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
212 x = self.last_cell.nScene
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
213 y = self.last_cell.nLayer
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
214 btn.nScene = nth
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
215 btn.layer = layer.node.get('id')
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
216 btn.nLayer = y
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
217 self.grid.attach(btn, x, x+1, y, y+1,0,0,0,0)
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
218 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
219 # This is the first scene in the layer
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
220 node = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}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
221 node.set("id", self.newID())
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
222 newscene = Scene(node,nth,nth)
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
223 layer.scene.append(newscene)
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
224 btn = self.newCell('start.png')
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
225 btn.nScene = nth
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
226 btn.layer = layer.node.get('id')
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
227 btn.nLayer = y
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
228 self.grid.attach(btn, x, x+1, y, y+1,0,0,0,0)
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
229
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
230
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
231
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
232
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
233 def removeKeyScene(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
234 nth = self.last_cell.nScene
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
235 try:
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
236 layer = self.getLayer(self.last_cell.layer)
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
237 except:
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
238 return
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
239 x = self.last_cell.nScene
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
240 y = self.last_cell.nLayer
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
241 for i in range(0,len(layer.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
242 s = layer.scene[i]
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
243 if nth == s.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
244 if i == 0:
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
245 for j in range(s.start,s.end+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
246 btn = self.newCell('empty.png')
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
247 btn.nScene = nth
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
248 btn.layer = layer
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
249 btn.nLayer = y
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
250 self.grid.attach(btn, j,j+1,y,y+1,0,0,0,0)
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
251 layer.scene.remove(s)
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
252 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
253 if s.start == layer.scene[i-1].end+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
254 # If the start of the delete scene segment is the end of the last scene segmenet, convert all scenes in the deleted
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
255 # scene segmenet to the last one
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
256 layer.scene[i-1].end = s.end
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
257 layer.scene.remove(s)
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
258 btn = self.newCell('fill.png')
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
259
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
260 btn.nScene = nth
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
261 btn.layer = layer
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
262 btn.nLayer = y
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
263 self.grid.attach(btn, x,x+1,y,y+1,0,0,0,0)
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
264 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
265 # Convert all scenes into empty cell
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
266 layer.scene.remove(s)
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
267 for j in range(s.start,s.end+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
268 btn = self.newCell('empty.png')
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
269 btn.nScene = nth
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
270 btn.layer = layer
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
271 btn.nLayer = y
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
272 self.grid.attach(btn, j,j+1,y,y+1,0,0,0,0)
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
273
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
274
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
275 return
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
276
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
277 def extendScene(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
278 nth = self.last_cell.nScene
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
279 try:
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
280 layer = self.getLayer(self.last_cell.layer)
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
281 except:
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
282 return
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
283 x = self.last_cell.nScene
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
284 y = self.last_cell.nLayer
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
285 if layer == None: return
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
286
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
287 for i in range(0,len(layer.scene)-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
288 s = layer.scene[i]
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
289 if nth >= layer.scene[i].start and nth <= layer.scene[i].end:
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
290 return
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
291
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
292 for i in range(0,len(layer.scene)-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
293 s = layer.scene[i]
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
294 if nth >= layer.scene[i].start and nth < layer.scene[i+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
295 for j in range(layer.scene[i].end+1, nth+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
296 btn = self.newCell('fill.png')
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
297 btn.nScene = nth
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
298 btn.nLayer = y
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
299 btn.layer = self.last_cell.layer
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
300 self.grid.attach(btn, j,j+1,y,y+1,0,0,0,0)
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
301 layer.scene[i].end = nth
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
302 return
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
303 if len(layer.scene) > 0 and nth > layer.scene[len(layer.scene)-1].end:
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
304 for j in range(layer.scene[len(layer.scene)-1].end+1, nth+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
305 btn = self.newCell('fill.png')
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
306 btn.nScene = nth
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
307 btn.nLayer = y
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
308 btn.layer = self.last_cell.layer
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
309 self.grid.attach(btn, j,j+1,y,y+1,0,0,0,0)
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
310 layer.scene[len(layer.scene)-1].end = nth
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
311 def setCurrentScene(self,nth):
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
312 self.current = nth
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
313 for layer in self.layer:
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
314 for s in layer.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
315 if nth >= s.start and nth <= s.end:
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
316 s.node.set("style","")
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
317 #print "Put the elemenets out"
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
318 layer.nodes = []
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
319
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
320 for o in s.node:
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
321 #print " ",o.tag
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
322 layer.nodes.append(o)
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
323 for o in s.node:
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
324 s.node.remove(o)
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
325 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
326 s.node.set("style","display:none")
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
327 def generate(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
328 newdoc = deepcopy(self.document)
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
329 root = newdoc.getroot()
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
330 has_scene = False
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
331 for n in root:
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
332 if n.tag == '{http://www.w3.org/2000/svg}metadata':
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
333 for nn in 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
334 if nn.tag == '{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}scenes':
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
335 nn.clear()
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
336 nn.set("current", "%d" % self.current)
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
337 scenes = []
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
338 for l in self.layer:
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
339 for s in l.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
340 id = s.node.get("id")
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
341 scene = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}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
342 scene.set("ref", id)
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
343 if s.start == s.end:
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
344 scene.set("start", "%d" % s.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
345 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
346 scene.set("start", "%d" % s.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
347 scene.set("end", "%d" % s.end)
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
348
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
349 scenes.append(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
350 for s in scenes:
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
351 nn.append(s)
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
352 has_scene = True
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
353 if has_scene == False:
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
354 scenes = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}scenes')
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
355 scenes.set("current","%d" % self.current)
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
356 for l in self.layer:
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
357 for s in l.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
358 scene = etree.Element('{http://madbutterfly.sourceforge.net/DTD/madbutterfly.dtd}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
359 scene.set("ref", s.node.get("id"))
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
360 if s.start == s.end:
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
361 scene.set("start", "%d" % s.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
362 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
363 scene.set("start", "%d" % s.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
364 scene.set("end", "%d" % s.end)
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
365 scenes.append(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
366 n.append(scenes)
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
367 if n.tag == '{http://www.w3.org/2000/svg}g':
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
368 root.remove(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
369
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
370 for l in self.layer:
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
371 # Duplicate all attribute of the layer
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
372 lnode = etree.Element("{http://www.w3.org/2000/svg}g")
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
373 for a,v in l.node.attrib.items():
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
374 lnode.set(a,v)
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
375 for n in l.nodes:
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
376 lnode.append(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
377 root.append(lnode)
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
378 for s in l.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
379 snode = etree.Element("{http://www.w3.org/2000/svg}g")
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
380 for a,v in s.node.attrib.items():
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
381 snode.set(a,v)
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
382 for n in s.node:
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
383 snode.append(deepcopy(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
384 lnode.append(snode)
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
385 self.document = newdoc
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
386 def newCell(self,file):
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
387 img = gtk.Image()
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
388 img.set_from_file(file)
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
389 btn = gtk.EventBox()
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
390 btn.add(img)
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
391 btn.connect("button_press_event", self.cellSelect)
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
392 btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray"))
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
393 return btn
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
394 def showGrid(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
395 max = 0
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
396 for layer in self.layer:
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
397 for s in layer.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
398 if s.end > max:
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
399 max = s.end
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
400 max = 50
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
401
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
402 self.grid = gtk.Table(len(self.layer)+1, 50)
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
403 self.scrollwin = gtk.ScrolledWindow()
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
404 self.scrollwin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
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
405 self.scrollwin.add_with_viewport(self.grid)
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
406 for i in range(1,max):
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
407 self.grid.attach(gtk.Label('%d'% i), i,i+1,0,1,0,0,0,0)
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
408 for i in range(1,len(self.layer)+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
409 l = self.layer[i-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
410 self.grid.attach(gtk.Label(l.node.get('{http://www.inkscape.org/namespaces/inkscape}label')), 0, 1, i, i+1,0,0,10,0)
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
411 for s in l.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
412 btn = self.newCell('start.png')
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
413 btn.nScene = s.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
414 btn.layer = l.node.get('id')
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
415 btn.nLayer = i
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
416
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
417 self.grid.attach(btn, s.start, s.start+1, i, i+1,0,0,0,0)
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
418 for j in range(s.start+1,s.end+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
419 btn = self.newCell('fill.png')
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
420 self.grid.attach(btn, j, j+1, i , i+1,0,0,0,0)
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
421 btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray"))
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
422 btn.nScene = j
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
423 btn.layer = l.node.get('id')
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
424 btn.nLayer = i
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
425 if len(l.scene) == 0:
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
426 start = 0
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
427 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
428 start = l.scene[len(l.scene)-1].end
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
429 for j in range(start,max):
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
430 btn = self.newCell('empty.png')
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
431 self.grid.attach(btn, j+1, j+2,i,i+1,0,0,0,0)
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
432 btn.modify_bg(gtk.STATE_NORMAL, btn.get_colormap().alloc_color("gray"))
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
433 btn.nScene = j+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
434 btn.layer = l.node.get('id')
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
435 btn.nLayer = i
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
436 self.last_cell = None
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
437 def cellSelect(self, cell, data):
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
438 if self.last_cell:
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
439 self.last_cell.modify_bg(gtk.STATE_NORMAL, self.last_cell.get_colormap().alloc_color("gray"))
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
440
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
441 self.last_cell = cell
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
442 cell.modify_bg(gtk.STATE_NORMAL, cell.get_colormap().alloc_color("green"))
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
443
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
444 def doEditScene(self,w):
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
445 self.setCurrentScene(self.last_cell.nScene)
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
446 self.generate()
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
447 gtk.main_quit()
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
448 def doInsertKeyScene(self,w):
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
449 self.insertKeyScene()
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
450 self.grid.show_all()
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
451 self.generate()
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
452
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
453 def doRemoveScene(self,w):
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
454 self.removeKeyScene()
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
455 self.grid.show_all()
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
456 self.generate()
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
457 def doExtendScene(self,w):
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
458 self.extendScene()
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
459 self.grid.show_all()
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
460 self.generate()
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
461 def addButtons(self,hbox):
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
462 btn = gtk.Button('Edit')
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
463 btn.connect('clicked', self.doEditScene)
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
464 hbox.pack_start(btn)
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
465 btn = gtk.Button('Insert Key')
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
466 btn.connect('clicked',self.doInsertKeyScene)
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
467 hbox.pack_start(btn)
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
468 btn=gtk.Button('Remove Key')
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
469 btn.connect('clicked', self.doRemoveScene)
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
470 hbox.pack_start(btn)
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
471 btn=gtk.Button('Extend 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
472 btn.connect('clicked', self.doExtendScene)
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
473 hbox.pack_start(btn)
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
474 def onQuit(self, event):
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
475 self.OK = False
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
476 gtk.main_quit()
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
477 def onOK(self,event):
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
478 self.OK = True
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
479 gtk.main_quit()
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
480
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
481 def onConfirmDelete(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
482 if self.scenemap == None:
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
483 vbox = gtk.VBox()
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
484 vbox.pack_start(gtk.Label('Convert the SVG into a MadButterfly SVG file. All current element will be delted'))
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
485 hbox = gtk.HBox()
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
486 self.button = gtk.Button('OK')
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
487 hbox.pack_start(self.button)
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
488 self.button.connect('clicked', self.onOK)
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
489 self.button = gtk.Button('Cancel')
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
490 hbox.pack_start(self.button)
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
491 self.button.connect("clicked", self.onQuit)
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
492 vbox.pack_start(hbox)
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
493 self.window.add(vbox)
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
494 self.window.show_all()
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
495 gtk.main()
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
496 self.window.remove(vbox)
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
497
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
498 def start_server(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
499 root = MB()
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
500 root.target = 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
501 site = server.Site(root)
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
502 reactor.listenTCP(8080, site)
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
503 reactor.run()
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
504
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
505
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
506 def effect(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
507 self.OK = False
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
508 self.parseScene()
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
509 self.start_server()
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
510 self.generate()
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
511
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
512 class MB(soap.SOAPPublisher):
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
513 """
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
514 SOAP server for inkscape extension.
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
515 """
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
516
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
517 def soap_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
518 reactor.callLater(1,self.quit)
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
519 return "OK"
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
520 def quit(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
521 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
522 def soap_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
523 self.target.setCurrentScene(int(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
524 return "OK"
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
525
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
526
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
527
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
528
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
529
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
530 import 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
531
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
532 os.chdir('/usr/share/inkscape/extensions')
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
533
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
534 A = MBScene()
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
535 A.affect()
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
536
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
537