示例#1
0
 def doInitInterfaces(self, *args, **kwargs):
     if bpio.Android():
         lg.close_intercepted_log_file()
         lg.open_intercepted_log_file(
             os.path.join(settings.LogsDir(), 'android.log'))
     if _Debug:
         lg.out(_DebugLevel, 'initializer.doInitInterfaces')
     if settings.enableFTPServer():
         try:
             from interface import ftp_server
             ftp_server.init()
         except:
             lg.exc()
     if settings.enableJsonRPCServer():
         try:
             from interface import api_jsonrpc_server
             api_jsonrpc_server.init()
         except:
             lg.exc()
     if settings.enableRESTHTTPServer():
         try:
             from interface import api_rest_http_server
             api_rest_http_server.init(
                 port=settings.getRESTHTTPServerPort())
         except:
             lg.exc()
     if settings.enableWebSocketServer():
         try:
             from interface import api_web_socket
             api_web_socket.init(port=settings.getWebSocketServerPort())
         except:
             lg.exc()
     reactor.callLater(0, self.automat,
                       'init-interfaces-done')  # @UndefinedVariable
示例#2
0
 def doInitInterfaces(self, arg):
     lg.out(2, 'initializer.doInitInterfaces')
     if settings.enableFTPServer():
         from interface import ftp_server
         ftp_server.init()
     if settings.enableJsonRPCServer():
         from interface import api_jsonrpc_server
         api_jsonrpc_server.init()
     if settings.enableRESTHTTPServer():
         from interface import api_rest_http_server
         api_rest_http_server.init(port=settings.getRESTHTTPServerPort())
     reactor.callLater(0, self.automat, 'init-interfaces-done')