# HG changeset patch # User drewp@bigasterisk.com # Date 1370906061 0 # Node ID e673bdbe0be92caedc1d4123f9ad12544fdb0a6e # Parent d01b4214e5af2491fa9ad5829a684a81c0d20f03 rdfdb: when a new n3 file shows up, fix its path to be relative again so the uri ends up right Ignore-this: f226c5edc7f794eaaa0d75515eea19fd diff -r d01b4214e5af -r e673bdbe0be9 bin/rdfdb --- a/bin/rdfdb Mon Jun 10 23:04:35 2013 +0000 +++ b/bin/rdfdb Mon Jun 10 23:14:21 2013 +0000 @@ -208,6 +208,15 @@ """ if not os.path.isfile(inFile): return + if not any(inFile.startswith(prefix) for prefix in self.topDirsToWatch): + for prefix in self.topDirsToWatch: + prefixAbs = os.path.abspath(prefix) + if inFile.startswith(prefixAbs): + inFile = prefix + inFile[len(prefixAbs):] + break + else: + raise ValueError("can't correct %s to start with one of %s" % + (inFile, self.topDirsToWatch)) if os.path.splitext(inFile)[1] not in ['.n3']: return