changeset 440:8a59efa577c1

new zsh completer for curvecalc
author drewp@bigasterisk.com
date Fri, 13 Jun 2008 04:43:25 +0000
parents 08a2fcf5eea1
children 7e9b08037ca3
files bin/listsongs
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/bin/listsongs	Fri Jun 13 04:43:25 2008 +0000
@@ -0,0 +1,19 @@
+#!/usr/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
+"""
+
+import run_local
+from light9 import showconfig
+from light9.namespaces import L9
+from rdflib import RDF
+graph = showconfig.getGraph()
+
+for song in graph.subjects(RDF.type, L9['Song']):
+    print song
+