Mercurial > code > home > repos > light9
annotate bin/listsongs @ 1030:efcb41c585fe
update networking for testing
Ignore-this: 6200fdf23cb8e1d7db2ed3e8633f6688
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Mon, 26 May 2014 20:52:25 +0000 |
parents | 27d2f148b630 |
children | a38955ba6f40 |
rev | line source |
---|---|
717
d8202a0a7fd5
fix up musicpad and wavecurve. ascoltami2 can now use relative paths in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
440
diff
changeset
|
1 #!bin/python |
440 | 2 |
3 """for completion, print the available song uris on stdout | |
4 | |
5 in .zshrc: | |
6 | |
7 function _songs { local expl; _description files expl 'songs'; compadd "$expl[@]" - `${LIGHT9_SHOW}/../../bin/listsongs` } | |
8 compdef _songs curvecalc | |
9 """ | |
10 | |
891 | 11 from run_local import log |
12 from twisted.internet import reactor | |
440 | 13 from rdflib import RDF |
891 | 14 from light9.namespaces import L9 |
15 from light9.rdfdb.syncedgraph import SyncedGraph | |
16 | |
17 graph = SyncedGraph("listsongs") | |
440 | 18 |
891 | 19 @graph.initiallySynced.addCallback |
20 def printSongs(result): | |
21 with graph.currentState() as current: | |
22 for song in current.subjects(RDF.type, L9['Song']): | |
23 print song | |
24 reactor.stop() | |
25 | |
26 reactor.run() |