示例#1
0
文件: JAP.py 项目: web883/jap
    def action_JAP_UPDATE(self, request):
        data = request.args["data"][0]

        decoder = JAP_LOCAL.JSONDecoder()
        configuration = decoder.decode(data)

        JAP_LOCAL.setConfiguration("./JAP.json", configuration,
                                   getDefaultConfiguration)

        logger = logging.getLogger("JAP")

        if configuration["LOGGER"]["LEVEL"] == "DEBUG":
            logger.setLevel(logging.DEBUG)
        elif configuration["LOGGER"]["LEVEL"] == "INFO":
            logger.setLevel(logging.INFO)
        elif configuration["LOGGER"]["LEVEL"] == "WARNING":
            logger.setLevel(logging.WARNING)
        elif configuration["LOGGER"]["LEVEL"] == "ERROR":
            logger.setLevel(logging.ERROR)
        elif configuration["LOGGER"]["LEVEL"] == "CRITICAL":
            logger.setLevel(logging.CRITICAL)
        else:
            logger.setLevel(logging.NOTSET)

        resolver = JAP_LOCAL.createResolver(configuration)
        reactor.installResolver(resolver)

        return ""
示例#2
0
文件: JAP.py 项目: blockme9527/jap
 def action_JAP_UPDATE(self, request):
     data = request.args["data"][0]
     
     decoder = JAP_LOCAL.JSONDecoder()
     configuration = decoder.decode(data)
     
     JAP_LOCAL.setConfiguration("./JAP.json", configuration, getDefaultConfiguration)
     
     logger = logging.getLogger("JAP")
     
     if configuration["LOGGER"]["LEVEL"] == "DEBUG":
         logger.setLevel(logging.DEBUG)
     elif configuration["LOGGER"]["LEVEL"] == "INFO":
         logger.setLevel(logging.INFO)
     elif configuration["LOGGER"]["LEVEL"] == "WARNING":
         logger.setLevel(logging.WARNING)
     elif configuration["LOGGER"]["LEVEL"] == "ERROR":
         logger.setLevel(logging.ERROR)
     elif configuration["LOGGER"]["LEVEL"] == "CRITICAL":
         logger.setLevel(logging.CRITICAL)
     else:
         logger.setLevel(logging.NOTSET)
     
     resolver = JAP_LOCAL.createResolver(configuration)
     reactor.installResolver(resolver)
     
     return ""
示例#3
0
文件: JAP.py 项目: blockme9527/jap
 def action_JAP_REMOTE_WS_UPDATE(self, request):
     data = request.args["data"][0]
     
     decoder = JAP_LOCAL.JSONDecoder()
     configuration = decoder.decode(data)
     
     JAP_LOCAL.setConfiguration("./JAP_REMOTE_WS.json", configuration, JAP_REMOTE_WS.getDefaultConfiguration)
     
     return ""
示例#4
0
文件: JAP.py 项目: web883/jap
    def action_JAP_REMOTE_WS_UPDATE(self, request):
        data = request.args["data"][0]

        decoder = JAP_LOCAL.JSONDecoder()
        configuration = decoder.decode(data)

        JAP_LOCAL.setConfiguration("./JAP_REMOTE_WS.json", configuration,
                                   JAP_REMOTE_WS.getDefaultConfiguration)

        return ""