Changeset - fb7bb50c3ced
[Not reviewed]
default
0 1 0
Drew Perttula - 18 years ago 2007-06-15 21:52:25
drewp@bigasterisk.com
submaster reads n3, not just nt
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/Submaster.py
Show inline comments
 
@@ -55,25 +55,25 @@ class Submaster:
 
        if not self.temporary:
 
            dispatcher.connect(self.reload, 'reload all subs')
 
            
 
    def reload(self, quiet=False, graph=None):
 
        if self.temporary:
 
            return
 
        try:
 
            oldlevels = self.levels.copy()
 
            self.levels.clear()
 
            patchGraph = showconfig.getGraph()
 
            if graph is None:
 
                graph = Graph()
 
                graph.parse(showconfig.subFile(self.name), format="nt")
 
                graph.parse(showconfig.subFile(self.name), format="n3")
 
            self.uri = L9['sub/%s' % self.name]
 
            for lev in graph.objects(self.uri, L9['lightLevel']):
 
                chan = graph.value(lev, L9['channel'])
 
                val = graph.value(lev, L9['level'])
 
                name = patchGraph.label(chan)
 
                if not name:
 
                    print "sub %r has channel %r with no name- leaving out that channel" % (self.name, chan)
 
                    continue
 
                self.levels[name] = float(val)
 

	
 
            if (not quiet) and (oldlevels != self.levels):
 
                print "sub %s changed" % self.name
0 comments (0 inline, 0 general)