How to use the netron.server.JobHTTPServer.MainRequestHandler function in netron

To help you get started, we’ve selected a few netron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yankov / netron / netron / server / JobHTTPServer.py View on Github external
def __init__(self, port, job_manager, mongo_uri):
        self.job_manager = job_manager
        self.mongo_uri = mongo_uri
        self.static_path = os.path.join(os.path.dirname(__file__), "static")

        self.routes = Application(
        [
            (r"/", MainRequestHandler),
            (r"/worker/(.*)/job", JobHandler, {"job_manager": job_manager}),
            (r"/stats", StatsHandler, {"mongo_uri": self.mongo_uri}),
            (r"/stats/(.*)", StatsHandler, {"mongo_uri": self.mongo_uri}),
            (r"/data/(.*)", tornado.web.StaticFileHandler, {'path': self.static_path})
            ],
        template_path=os.path.join(os.path.dirname(__file__), "templates"),
        static_path= self.static_path)

        self.port = port