Mercurial > code > home > repos > light9
annotate bin/listsongs @ 1865:1aa91a31c0e2
reformat some missed files
Ignore-this: f13152975437adeb48ed619ab676365e
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sat, 25 May 2019 12:06:01 +0000 |
parents | f066d6e874db |
children | 3c523c71da29 |
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 """for completion, print the available song uris on stdout |
3 | |
4 in .zshrc: | |
5 | |
6 function _songs { local expl; _description files expl 'songs'; compadd "$expl[@]" - `${LIGHT9_SHOW}/../../bin/listsongs` } | |
7 compdef _songs curvecalc | |
8 """ | |
9 | |
891 | 10 from run_local import log |
11 from twisted.internet import reactor | |
440 | 12 from rdflib import RDF |
1114
a38955ba6f40
rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
891
diff
changeset
|
13 from light9 import networking |
891 | 14 from light9.namespaces import L9 |
1692 | 15 from rdfdb.syncedgraph import SyncedGraph |
891 | 16 |
1114
a38955ba6f40
rdfdb port is now in the config
Drew Perttula <drewp@bigasterisk.com>
parents:
891
diff
changeset
|
17 graph = SyncedGraph(networking.rdfdb.url, "listsongs") |
440 | 18 |
1858 | 19 |
891 | 20 @graph.initiallySynced.addCallback |
21 def printSongs(result): | |
22 with graph.currentState() as current: | |
23 for song in current.subjects(RDF.type, L9['Song']): | |
1859
f066d6e874db
2to3 with these fixers: all idioms set_literal
drewp@bigasterisk.com
parents:
1858
diff
changeset
|
24 print(song) |
891 | 25 reactor.stop() |
26 | |
1858 | 27 |
891 | 28 reactor.run() |