Mercurial > code > home > repos > light9
changeset 537:1929e0e1053e
showconfig logs about what n3 files it's reading
Ignore-this: 12ed745bfe471e7070ad93ec1e1c6dde
author | drewp@bigasterisk.com |
---|---|
date | Sun, 13 Jun 2010 07:57:00 +0000 |
parents | 519adb4e539f |
children | 571d058c9838 |
files | light9/showconfig.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/showconfig.py Sun Jun 13 07:56:06 2010 +0000 +++ b/light9/showconfig.py Sun Jun 13 07:57:00 2010 +0000 @@ -1,8 +1,9 @@ -import time +import time, logging from os import path, getenv from rdflib.Graph import Graph from rdflib import URIRef from namespaces import MUS, L9 +log = logging.getLogger('showconfig') _config = (None, None, None) # graph, mtime, len def getGraph(): @@ -14,6 +15,7 @@ now = time.time() diskMtime = path.getmtime(configPath) if diskMtime <= _config[1]: + log.info("reuse graph") graph = _config[0] # i'm scared of some program modifying the graph, and then i # return that from a new getGraph call. Maybe I should be @@ -23,8 +25,11 @@ return _config[0] graph = Graph() + log.info("reading %s", configPath) graph.parse(configPath, format='n3') - graph.parse(path.join(root(), "patch.n3"), format="n3") + patchPath = path.join(root(), "patch.n3") + log.info("reading %s", patchPath) + graph.parse(patchPath, format="n3") _config = (graph, diskMtime, len(graph)) return graph