Ejemplo n.º 1
0
        id = request.args['id'][0]

        if logging == True:
            log.msg(
                str(datetime.datetime.now().time()) +
                ":GET ShowStreamChunk - " + self.path)
        return json.dumps(self.provenanceStore.getStreamChunk(runid, id))

    def getChild(self, path, request):
        return EmptyChild(path)


if __name__ == "__main__":
    import sys
    from twisted.internet import reactor
    provStore = provenance.ProvenanceStore(sys.argv[1])
    logging = False
    try:
        if (sys.argv[2] == "True"):
            logging = True
            print("Logging to webserver.out")
            log.startLogging(open("webserver.out", 'a'))
        else:
            logging = True
            print("Logging to stdout")
            log.startLogging(sys.stdout)
    except:
        logging = False
    reactor.listenTCP(8082, server.Site(RootResource(provStore)))
    log.msg("Server running....")
    reactor.run()
Ejemplo n.º 2
0
def bootstrap_app():
    app.db = provenance.ProvenanceStore(os.environ['RAAS_REPO'])
    return app