view bin/listsongs @ 1063:4e449d40f42c

inputdemo sends updates to curvecalc, which edits the curve. doesn't display right Ignore-this: 5a71a9a6c85d533c79872c93d1c3f5a8
author Drew Perttula <drewp@bigasterisk.com>
date Mon, 02 Jun 2014 01:03:22 +0000
parents 27d2f148b630
children a38955ba6f40
line wrap: on
line source

#!bin/python

"""for completion, print the available song uris on stdout

in .zshrc:

function _songs { local expl;  _description files expl 'songs';  compadd "$expl[@]" - `${LIGHT9_SHOW}/../../bin/listsongs` }
compdef _songs curvecalc
"""

from run_local import log
from twisted.internet import reactor
from rdflib import RDF
from light9.namespaces import L9
from light9.rdfdb.syncedgraph import SyncedGraph

graph = SyncedGraph("listsongs")

@graph.initiallySynced.addCallback
def printSongs(result):
    with graph.currentState() as current:
        for song in current.subjects(RDF.type, L9['Song']):
            print song
    reactor.stop()

reactor.run()