Mercurial > code > home > repos > light9
changeset 874:167a61d3cfbf
subcomposer put local subs into the graph with a type edge.
Ignore-this: a0c1ef69684786e4758b9ecf10927d3b
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Thu, 06 Jun 2013 08:23:17 +0000 |
parents | f6e4faa0422b |
children | 2b2ad8e7cb9f |
files | bin/run_local.py bin/subcomposer light9/Submaster.py light9/rdfdb/graphfile.py |
diffstat | 4 files changed, 20 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/run_local.py Thu Jun 06 08:23:08 2013 +0000 +++ b/bin/run_local.py Thu Jun 06 08:23:17 2013 +0000 @@ -30,3 +30,4 @@ log.addHandler(CSH(show_hostname=False, show_name=True)) +
--- a/bin/subcomposer Thu Jun 06 08:23:08 2013 +0000 +++ b/bin/subcomposer Thu Jun 06 08:23:17 2013 +0000 @@ -22,16 +22,20 @@ import Tkinter as tk import louie as dispatcher from twisted.internet import reactor, tksupport, task -from rdflib import URIRef +from rdflib import URIRef, RDF from run_local import log +log.setLevel(logging.DEBUG) + from light9.dmxchanedit import Levelbox -from light9 import dmxclient, Patch, Submaster, prof +from light9 import dmxclient, Submaster, prof +from light9.Patch import get_channel_name from light9.uihelpers import toplevelat from light9.rdfdb.syncedgraph import SyncedGraph from light9.rdfdb import clientsession from light9.tkdnd import initTkdnd from light9.namespaces import L9 +from light9.rdfdb.patch import Patch from light9.observable import Observable from light9.editchoice import EditChoice, Local @@ -80,9 +84,10 @@ EditChoice(self, self.graph, self._currentChoice).frame.pack(side='top') self.setupSubChoiceLinks() + self.setupLevelboxUi() def setupSubChoiceLinks(self): - + graph = self.graph def ann(): print "currently: session=%s currentSub=%r _currentChoice=%r" % ( self.session, self.currentSub(), self._currentChoice()) @@ -129,10 +134,14 @@ # todo: put a type on this, so subChanged can identify it right # todo: where will these get stored, or are they local to this # subcomposer process and don't use PersistentSubmaster at all? - return URIRef("http://local/%s" % time.time()) + + new = URIRef("http://local/%s" % time.time()) + self.graph.patch(Patch(addQuads=[(new, RDF.type, L9['Submaster'], self.session)])) + + return new def setupLevelboxUi(self): - self.levelbox = Levelbox(self, graph, self.currentSub) + self.levelbox = Levelbox(self, self.graph, self.currentSub) self.levelbox.pack(side='top') tk.Button(self, text="All to zero", @@ -142,7 +151,7 @@ leveldict={} for i,lev in zip(range(len(self.levels)),self.levels): if lev!=0: - leveldict[Patch.get_channel_name(i+1)]=lev + leveldict[get_channel_name(i+1)]=lev s=Submaster.Submaster(subname,leveldict=leveldict) s.save() @@ -185,8 +194,6 @@ clientsession.add_option(parser) opts, args = parser.parse_args() - logging.basicConfig(level=logging.DEBUG) - root=tk.Tk() root.config(bg='black') root.tk_setPalette("#004633")
--- a/light9/Submaster.py Thu Jun 06 08:23:08 2013 +0000 +++ b/light9/Submaster.py Thu Jun 06 08:23:17 2013 +0000 @@ -133,10 +133,11 @@ self.graph.addHandler(self.setName) self.graph.addHandler(self.setLevels) Submaster.__init__(self, self.name, self.levels) - self.graph = graph - self.uri = uri self.temporary = False + # error faster if we won't be able to find where to save + self.saveContext() + def ident(self): return self.uri
--- a/light9/rdfdb/graphfile.py Thu Jun 06 08:23:08 2013 +0000 +++ b/light9/rdfdb/graphfile.py Thu Jun 06 08:23:17 2013 +0000 @@ -52,6 +52,7 @@ def notify(self, notifier, filepath, mask): maskNames = humanReadableMask(mask) if maskNames[0] in ['open', 'access', 'close_nowrite', 'attrib', 'delete_self']: + log.debug("file %s changed, ignoring %s" % (filepath, maskNames)) return try: