# HG changeset patch # User drewp@bigasterisk.com # Date 2010-06-13 07:57:00 # Node ID 1929e0e1053e73176601c840dbd6087163009206 # Parent 519adb4e539f4a1033b1c40a1488c4fc901057db showconfig logs about what n3 files it's reading Ignore-this: 12ed745bfe471e7070ad93ec1e1c6dde diff --git a/light9/showconfig.py b/light9/showconfig.py --- a/light9/showconfig.py +++ b/light9/showconfig.py @@ -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 @@ def getGraph(): 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 @@ def getGraph(): 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