Changeset - e673bdbe0be9
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 12 years ago 2013-06-10 23:14:21
drewp@bigasterisk.com
rdfdb: when a new n3 file shows up, fix its path to be relative again so the uri ends up right
Ignore-this: f226c5edc7f794eaaa0d75515eea19fd
1 file changed with 9 insertions and 0 deletions:
0 comments (0 inline, 0 general)
bin/rdfdb
Show inline comments
 
@@ -208,6 +208,15 @@ class WatchedFiles(object):
 
        """
 
        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
 

	
0 comments (0 inline, 0 general)