Mercurial > code > home > repos > light9
view bin/listsongs @ 2133:1dbbf0db3036
WIP graph-using songlist; trying to make request-then-play safer ux for song playback
author | drewp@bigasterisk.com |
---|---|
date | Sun, 05 Jun 2022 01:42:39 +0000 |
parents | 3c523c71da29 |
children |
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 # noqa 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()