Changeset - d8b25edf6c74
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 11 years ago 2014-06-14 07:21:32
drewp@bigasterisk.com
fix dropping of subs onto effecteval
Ignore-this: 7150db275055597cdb9a5347910b032b
1 file changed with 3 insertions and 3 deletions:
0 comments (0 inline, 0 general)
bin/effecteval
Show inline comments
 
@@ -38,34 +38,34 @@ class SongEffects(PrettyErrorHandler, cy
 
        song = URIRef(self.get_argument('uri'))
 
        dropped = URIRef(self.get_argument('drop'))
 
        ctx = song
 
        graph = self.settings.graph
 
        effect = graph.sequentialUri(song + "/effect-")
 
        quads = [
 
            (song, L9['effect'], effect, ctx),
 
            (effect, RDF.type, L9['Effect'], ctx),
 
        ]
 

	
 
        with graph.currentState(
 
                tripleFilter=(dropped, None, None)) as g:
 
            droppedTypes = g.objects(dropped, RDF.type)
 
            droppedTypes = list(g.objects(dropped, RDF.type))
 
            droppedLabel = g.label(dropped)
 
            droppedCodes = g.objects(dropped, L9['code'])
 
            droppedCodes = list(g.objects(dropped, L9['code']))
 

	
 
        if L9['EffectClass'] in droppedTypes:
 
            quads.extend([
 
                (effect, RDFS.label, droppedLabel, ctx),
 
                (effect, RDF.type, dropped, ctx),
 
                ] + [(effect, L9['code'], c, ctx) for c in droppedCodes])
 
        elif L9['Curve'] in droppedTypes:
 
        elif L9['Submaster'] in droppedTypes:
 
            curve = graph.sequentialUri(song + "/curve-")
 
            cr = CurveResource(graph, curve)
 
            cr.newCurve(ctx, label=Literal('sub %s' % droppedLabel))
 
            cr.saveCurve()
 
            quads.extend([
 
                (song, L9['curve'], curve, ctx),                
 
                (effect, L9['code'],
 
                 Literal('out = %s * %s' % (dropped.n3(), curve.n3())),
 
                 ctx),
 
                ])
 
        else:
 
            raise NotImplementedError(
0 comments (0 inline, 0 general)