Changeset - 92c6e4b6cabb
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 12 years ago 2013-06-12 04:48:26
drewp@bigasterisk.com
change base uri used on local subs
Ignore-this: ee540cbdacffbe38c066c757cbb2c39f
1 file changed with 5 insertions and 5 deletions:
0 comments (0 inline, 0 general)
bin/subcomposer
Show inline comments
 
@@ -76,13 +76,13 @@ class Subcomposer(tk.Frame):
 
        # self.currentSub.uri. Probably that should be on the Local
 
        # object too, or maybe Local should be a subclass of URIRef
 
        self._currentChoice = Observable(Local)
 

	
 
        # this is a PersistentSubmaster (even for local)
 
        self.currentSub = Observable(Submaster.PersistentSubmaster(
 
                    graph, self.makeLocal()))
 
                    graph, self.switchToLocal()))
 

	
 
        def pc(val):
 
            log.info("change viewed sub to %s", val)
 
        self._currentChoice.subscribe(pc)
 

	
 
        ec = self.editChoice = EditChoice(self, self.graph, self._currentChoice)
 
@@ -155,13 +155,13 @@ class Subcomposer(tk.Frame):
 
                self.session, self.currentSub(), self._currentChoice())
 

	
 
        @graph.addHandler
 
        def graphChanged():
 
            s = graph.value(self.session, L9['currentSub'])
 
            if s is None:
 
                s = self.makeLocal()
 
                s = self.switchToLocal()
 
            self.currentSub(Submaster.PersistentSubmaster(graph, s))
 

	
 
        @self.currentSub.subscribe
 
        def subChanged(newSub):
 
            if newSub is None:
 
                graph.patchObject(self.session,
 
@@ -182,29 +182,29 @@ class Subcomposer(tk.Frame):
 

	
 
        dispatcher.connect(self.levelsChanged, "sub levels changed")
 
            
 
        @self._currentChoice.subscribe
 
        def choiceChanged(newChoice):
 
            if newChoice is Local:
 
                newChoice = self.makeLocal()
 
                newChoice = self.switchToLocal()
 
            if newChoice is not None:
 
                self.currentSub(Submaster.PersistentSubmaster(
 
                    graph, newChoice))
 

	
 
    def levelsChanged(self, sub):
 
        if sub == self.currentSub():
 
            self.sendupdate()
 
        
 
    def makeLocal(self):
 
    def switchToLocal(self):
 
        """
 
        change our display to a local submaster
 
        """
 
        # todo: where will these get stored, or are they local to this
 
        # subcomposer process and don't use PersistentSubmaster at all?
 

	
 
        new = URIRef("http://local/%s" % time.time())
 
        new = URIRef("http://light9.bigasterisk.com/sub/local/%s" % time.time())
 
        self.graph.patch(Patch(addQuads=[
 
            (new, RDF.type, L9['Submaster'], self.session),
 
            (new, RDF.type, L9['LocalSubmaster'], self.session),
 
        ]))
 
        
 
        return new
0 comments (0 inline, 0 general)