Changeset - 2c0c3aec0d63
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 10 years ago 2015-06-14 18:47:36
drewp@bigasterisk.com
critical fix- put slash in the uri map prefix so it gets removed from uris, so filenames don't have // in them and fail to compare right to other versions
Ignore-this: 3098459d044bbd5ce92a0d5b7b428f27
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
bin/rdfdb
Show inline comments
 
@@ -229,24 +229,25 @@ class WatchedFiles(object):
 
        straightforward to create the new file now
 

	
 
        this is meant to make the file before we add triples, so we
 
        wouldn't see the blank file and lose those triples. But it
 
        didn't work, so there are other measures that make us not lose
 
        the triples from a new file. Calling this before patching the
 
        graph is still a reasonable thing to do, though.
 
        """
 
        g = self.getSubgraph(ctx)
 

	
 
        if ctx not in self.graphFiles:
 
            outFile = fileForUri(self.dirUriMap, ctx)
 
            assert '//' not in outFile, (outFile, self.dirUriMap, ctx)
 
            log.info("starting new file %r", outFile)
 
            self.graphFiles[ctx] = GraphFile(self.notifier, outFile, ctx,
 
                                             self.patch, self.getSubgraph)
 

	
 
    def dirtyFiles(self, ctxs):
 
        """mark dirty the files that we watch in these contexts.
 

	
 
        the ctx might not be a file that we already read; it might be
 
        for a new file we have to create, or it might be for a
 
        transient context that we're not going to save
 

	
 
        if it's a ctx with no file, error
 
@@ -407,25 +408,25 @@ class NoExts(cyclone.web.StaticFileHandl
 
if __name__ == "__main__":
 
    logging.basicConfig()
 
    log = logging.getLogger()
 

	
 
    parser = optparse.OptionParser()
 
    parser.add_option("-v", "--verbose", action="store_true",
 
                      help="logging.DEBUG")
 
    (options, args) = parser.parse_args()
 

	
 
    log.setLevel(logging.DEBUG if options.verbose else logging.INFO)
 

	
 
    db = Db(dirUriMap={os.environ['LIGHT9_SHOW'].rstrip('/') + '/':
 
                       showconfig.showUri()})
 
                       showconfig.showUri() + '/'})
 

	
 
    from twisted.python import log as twlog
 
    twlog.startLogging(sys.stdout)
 

	
 
    reactor.listenTCP(networking.rdfdb.port, cyclone.web.Application(handlers=[
 
        (r'/live', Live),
 
        (r'/graph', GraphResource),
 
        (r'/patches', Patches),
 
        (r'/graphClients', GraphClients),
 

	
 
        (r'/(.*)', NoExts,
 
         {"path" : "light9/rdfdb/web",
0 comments (0 inline, 0 general)