# HG changeset patch # User drewp@bigasterisk.com # Date 2008-06-13 04:43:25 # Node ID 8a59efa577c12953596eddbea92aa5819bf3cd94 # Parent 08a2fcf5eea1367499da2a9e603685c0b876074c new zsh completer for curvecalc diff --git a/bin/listsongs b/bin/listsongs new file mode 100644 --- /dev/null +++ b/bin/listsongs @@ -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 +