Mercurial > code > home > repos > light9
changeset 857:1bda494a8c3a
attempted fix for FilePath making paths absolute (when they need to stay relative since they're used in uris)
Ignore-this: 3bf04175136af9f1f7e823f875209303
author | drewp@bigasterisk.com |
---|---|
date | Wed, 05 Jun 2013 23:44:33 +0000 |
parents | a59d0f4563cc |
children | 1f93e5d19f8a |
files | bin/rdfdb |
diffstat | 1 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/rdfdb Wed Jun 05 23:39:44 2013 +0000 +++ b/bin/rdfdb Wed Jun 05 23:44:33 2013 +0000 @@ -199,12 +199,16 @@ self.watchFile(path.path) def watchFile(self, inFile): - """consider adding a GraphFile to self.graphFiles""" - if not isinstance(inFile, FilePath): - inFile = FilePath(inFile) - if not inFile.isfile(): + """ + consider adding a GraphFile to self.graphFiles + + inFile needs to be a relative path, not an absolute (e.g. in a + FilePath) because we use its exact relative form in the + context URI + """ + if not os.path.isfile(inFile): return - if inFile.splitext()[1] not in ['.n3']: + if os.path.splitext(inFile)[1] not in ['.n3']: return # an n3 file with rules makes it all the way past this reading @@ -212,11 +216,11 @@ # SyncedGraph calls graphFromNQuad on the incoming data and # has a parse error. I'm not sure where this should be fixed # yet. - if '-rules' in inFile.path: + if '-rules' in inFile: return ctx = self.uriFromFile(inFile) - gf = GraphFile(self.notifier, inFile.path, ctx, + gf = GraphFile(self.notifier, inFile, ctx, self.patch, self.getSubgraph) self.graphFiles[ctx] = gf gf.reread() @@ -241,8 +245,6 @@ self.graphFiles[ctx].dirty(g) def uriFromFile(self, filename): - if isinstance(filename, FilePath): - filename = filename.path assert filename.endswith('.n3'), filename return URIRef(self.topUri + filename[:-len('.n3')])