def to_tree(self): args = '' for a in self.args: args=args+a+', ' args=args[:-2] p = DOMNode('procedure', {'name':self.name, 'args':args}) data = self.proc + "\n" p.add_data(data) return p
def to_tree(self): args = '' for a in self.args: args = args + a + ', ' args = args[:-2] p = DOMNode('procedure', {'name': self.name, 'args': args}) data = self.proc + "\n" p.add_data(data) return p
def change_show(self, newname, clear=0): self.datafile = None self.undo_bindings() self.show = newname self.do_bindings() if clear: for lib in self._libraries: lib.reset() else: tree = DOMNode("show", {"name": self.show}) for lib in self._libraries: tree.append(lib.save()) for lib in self._libraries: lib.load(tree) self.write("Now working in show " + self.show + "\n")
def change_show(self, newname, clear=0): self.datafile=None self.undo_bindings() self.show = newname self.do_bindings() if (clear): for lib in self._libraries: lib.reset() else: tree = DOMNode('show', {'name':self.show}) for lib in self._libraries: tree.append (lib.save()) for lib in self._libraries: lib.load(tree) self.write("Now working in show " + self.show +"\n")
def save_show(self, datafile=None): if datafile is not None: self.datafile = datafile else: datafile = self.datafile tree = DOMNode("show", {"name": self.show}) for lib in self._libraries: tree.append(lib.save()) writer = TreeWriter() writer.write(tree) s = writer.get_string() f = open(datafile, "w") f.write(s)
def unknown_starttag (self, name, attrs): n = DOMNode(name, attrs) if len(self.stack) == 0: self.tree = n else: self.stack[-1].append(n) self.stack.append(n)
def save_show(self, datafile=None): if datafile is not None: self.datafile = datafile else: datafile = self.datafile tree = DOMNode('show', {'name':self.show}) for lib in self._libraries: tree.append (lib.save()) writer = TreeWriter() writer.write(tree) s = writer.get_string() f=open(datafile, "w") f.write(s)
def save(): tree = DOMNode('instruments') for name, dict in lb.instrument_group.items(): if name is None: n = tree else: n = DOMNode('group', {'name': name}) tree.append(n) for i in dict.values(): n.append(i.to_tree()) return tree
def sendData(self, subtree): tree = DOMNode("show", {"name": self.show}) tree.append(subtree) writer = TreeWriter() writer.write(tree) data = writer.get_string() (foo, iterator) = self.client_context.list(0) while 1: (c, b) = iterator.next_one() if not c: break if b.binding_name[0].id == self.name: continue client = self.client_context.resolve(b.binding_name) try: client.receiveData(data) except: self.client_context.unbind(b.binding_name)
def sendData(self, subtree): tree = DOMNode('show', {'name':self.show}) tree.append(subtree) writer = TreeWriter() writer.write(tree) data = writer.get_string() (foo,iterator) = self.client_context.list(0) while 1: (c,b)=iterator.next_one() if not c: break if (b.binding_name[0].id==self.name): continue client = self.client_context.resolve(b.binding_name) try: client.receiveData(data) except: self.client_context.unbind(b.binding_name)
def add_clicked(self, widget, data=None): tree = self.editTree.get_widget("instrumentTree") menu = self.editTree.get_widget("driverMenu") name = menu.get_children()[0].get() info = lb.instrument_module_info[name] dnode = DOMNode(tag=info.module, attrs={'name': 'Unnamed'}) if info.container: node = tree.insert_node(None, None, ['Unnamed'], is_leaf=FALSE) else: node = tree.insert_node(None, None, ['Unnamed'], is_leaf=TRUE) tree.node_set_row_data(node, (dnode, info))
def to_tree(self): dict = {} for arg in self.arglist: dict[arg.name] = arg.value dict['name'] = self.name dict['driver'] = self.driver dict['core'] = self.corename instrument = DOMNode(self.module, dict) return instrument
def to_tree(self): cue = DOMNode("cue", {"name": self.name}) for name, lvl in self.parent: lvl = lb.value_to_string("level", [lvl]) parent = DOMNode("parent", {"level": lvl}) parent.add_data(name) cue.append(parent) for name, idict in self.instrument.items(): dict = idict.copy() dict["name"] = name instrument = DOMNode("instrument", dict) cue.append(instrument) return cue
def ok_clicked(self, widget, data=None): w = self.editTree.get_widget("editInstruments") tree = self.editTree.get_widget ("instrumentTree") self.update_attrs_from_window() delroot = save() delroot.tag = 'instruments-deleted' domroot = DOMNode('instruments') for treenode in tree.base_nodes(): domroot.append(self.make_dom_tree(tree, treenode)) domtree = DOMNode('show') domtree.append(domroot) deltree = DOMNode('show') deltree.append(delroot) for mod in lb.instrument_module_info.values(): mod.load(deltree) for mod in lb.instrument_module_info.values(): mod.load(domtree) lb.sendData(delroot) lb.sendData(domroot) w.destroy()
def to_tree(self): instrument = DOMNode(self.module, {'name': self.name}) subs = {} for a, i in self.subinstrument.items(): if type(i) != type([]): i = [i] for x in i: if subs.has_key(x): subs[x] = subs[x] + ', ' + a else: subs[x] = a for i, a in subs.items(): n = i.to_tree() n.attrs['attributes'] = a instrument.append(n) return instrument
def save(): tree = DOMNode('programs') for p in lb.program.values(): tree.append(p.to_tree()) return tree
def save(): tree = DOMNode('crossfaders') for i in lb.crossfader.values(): tree.append(i.to_tree()) return tree
def send_update(self): tree = DOMNode('programs') tree.append(self.to_tree()) lb.sendData(tree)
def send_update(self): tree = DOMNode('processes') tree.append(self.to_tree()) lb.sendData(tree)
def save(): tree = DOMNode("cues") for i in lb.cue.values(): tree.append(i.to_tree()) return tree
def to_tree(self): cue = DOMNode('cue', {'name': self.name}) for name, lvl in self.parent: lvl = lb.value_to_string('level', [lvl]) parent = DOMNode('parent', {'level': lvl}) parent.add_data(name) cue.append(parent) for name, idict in self.instrument.items(): dict = idict.copy() dict['name'] = name instrument = DOMNode('instrument', dict) cue.append(instrument) return cue
def save(): tree = DOMNode('cues') for i in lb.cue.values(): tree.append(i.to_tree()) return tree
def to_tree(self): xf = DOMNode('crossfader', {'name': self.name, 'core': self.corename}) return xf
def send_update(self): tree = DOMNode('crossfaders') tree.append(self.to_tree()) lb.sendData(tree)
def ok_clicked(self, widget, data=None): w = self.editTree.get_widget("editInstruments") tree = self.editTree.get_widget("instrumentTree") self.update_attrs_from_window() delroot = save() delroot.tag = 'instruments-deleted' domroot = DOMNode('instruments') for treenode in tree.base_nodes(): domroot.append(self.make_dom_tree(tree, treenode)) domtree = DOMNode('show') domtree.append(domroot) deltree = DOMNode('show') deltree.append(delroot) for mod in lb.instrument_module_info.values(): mod.load(deltree) for mod in lb.instrument_module_info.values(): mod.load(domtree) lb.sendData(delroot) lb.sendData(domroot) w.destroy()
def save(): tree = DOMNode("processes") for i in lb.process.values(): tree.append(i.to_tree()) return tree
def add_group_clicked(self, widget, data=None): tree = self.editTree.get_widget("instrumentTree") info = group_info dnode = DOMNode(tag='group', attrs={'name': 'Unnamed'}) node = tree.insert_node(None, None, ['Unnamed'], is_leaf=FALSE) tree.node_set_row_data(node, (dnode, info))
def save(): tree = DOMNode('processes') for i in lb.process.values(): tree.append(i.to_tree()) return tree
def send_update(self): tree = DOMNode('levelfaders') tree.append(self.to_tree()) lb.sendData(tree)
def to_tree(self): dict = self.args.copy() dict['name'] = self.name dict['procedure'] = self.procedure p = DOMNode('process', dict) return p
def save(): tree = DOMNode('levelfaders') for i in lb.levelfader.values(): tree.append(i.to_tree()) return tree
def save(): tree = DOMNode('procedures') for i in lb.procedure.values(): tree.append(i.to_tree()) return tree
def to_tree(self): program = DOMNode('program', {'name':self.name}) init = DOMNode('init') program.append(init) for act in self.init_step.actions: action = DOMNode(act.kind, act.args) init.append(action) for stp in self.actions: step = DOMNode('step', {'name':stp.name}) program.append(step) for act in stp.actions: action = DOMNode(act.kind, act.args) step.append(action) return program
def to_tree(self): instrument = DOMNode(self.module, {'name':self.name, 'red':self.red_name, 'green':self.green_name, 'blue':self.blue_name}) return instrument
def to_tree(self): program = DOMNode('program', {'name': self.name}) init = DOMNode('init') program.append(init) for act in self.init_step.actions: action = DOMNode(act.kind, act.args) init.append(action) for stp in self.actions: step = DOMNode('step', {'name': stp.name}) program.append(step) for act in stp.actions: action = DOMNode(act.kind, act.args) step.append(action) return program
def send_update(self): tree = DOMNode("processes") tree.append(self.to_tree()) lb.sendData(tree)