Mercurial > code > home > repos > light9
view bin/listsongs @ 1407:f766f82b8513
checkpoint show data
Ignore-this: 55fda887863be2f89db5a7db88404f41
author | drewp@bigasterisk.com |
---|---|
date | Mon, 15 Jun 2015 22:34:59 +0000 |
parents | a38955ba6f40 |
children | 6fa4288da8a6 |
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 import networking from light9.namespaces import L9 from light9.rdfdb.syncedgraph import SyncedGraph graph = SyncedGraph(networking.rdfdb.url, "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()