Changeset - 27d2f148b630
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 12 years ago 2013-06-08 21:22:24
drewp@bigasterisk.com
port listSongs to use syncedgraph
Ignore-this: 803c4897445582c9329a9f70b846a195
1 file changed with 12 insertions and 5 deletions:
0 comments (0 inline, 0 general)
bin/listsongs
Show inline comments
 
@@ -8,12 +8,19 @@ function _songs { local expl;  _descript
 
compdef _songs curvecalc
 
"""
 

	
 
import run_local
 
from light9 import showconfig
 
from light9.namespaces import L9
 
from run_local import log
 
from twisted.internet import reactor
 
from rdflib import RDF
 
graph = showconfig.getGraph()
 
from light9.namespaces import L9
 
from light9.rdfdb.syncedgraph import SyncedGraph
 

	
 
graph = SyncedGraph("listsongs")
 

	
 
for song in graph.subjects(RDF.type, L9['Song']):
 
@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()
0 comments (0 inline, 0 general)