Mercurial > code > home > repos > light9
view bin/listsongs @ 1799:0bb7b9df12e5
collector warnings and errors. the reactor.crash isn't working.
Ignore-this: b7d4a6c08f04c924ffba6112483f9c19
author | drewp@bigasterisk.com |
---|---|
date | Fri, 08 Jun 2018 03:35:30 +0000 |
parents | 6fa4288da8a6 |
children | 7772cc48e016 |
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 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()