Ejemplo n.º 1
0
 def __init__(self, handler=None):
     self.handler = handler
     self.platformtools = Platformtools()
     self.host = "http://" + config.get_local_ip(
     ) + ":" + config.get_setting("server.port")
     if self.handler:
         platformtools.controllers[threading.current_thread().name] = self
Ejemplo n.º 2
0
    def __init__(self, handler=None, ID=None):

        self.handler = handler
        self.id = ID

        if not self.id:
            self.id = threading.current_thread().name

        if self.handler:
            self.platformtools = Platformtools()
            self.host = "http://%s:%s" % (config.get_local_ip(),
                                          config.get_setting("server.port"))
Ejemplo n.º 3
0
 def __init__(self, handler = None, ID = None):
     
     self.handler = handler
     self.id = ID
     
     if not self.id: 
       self.id = threading.current_thread().name
     
     
     if self.handler:
       self.platformtools = Platformtools()
       self.host = "http://"+ config.get_local_ip() +":" + config.get_setting("server.port")
Ejemplo n.º 4
0
 def __init__(self, handler = None):
     self.handler = handler
     self.platformtools = Platformtools()
     self.host = "http://"+ config.get_local_ip() +":" + config.get_setting("server.port")
     if self.handler:
        platformtools.controllers[threading.current_thread().name] =  self
Ejemplo n.º 5
0
import sys
import os
import time
import threading
from functools import wraps
sys.dont_write_bytecode = True
from core import config
sys.path.append(os.path.join(config.get_runtime_path(), 'lib'))
from core import logger
from platformcode import platformtools
import HTTPServer
import WebSocket

http_port = config.get_setting("server.port")
websocket_port = config.get_setting("websocket.port")
myip = config.get_local_ip()

def ThreadNameWrap(func):
    @wraps(func)
    def bar(*args, **kw):
        if not "name" in kw:
            kw['name'] = threading.current_thread().name
        return func(*args, **kw)

    return bar

threading.Thread.__init__ = ThreadNameWrap(threading.Thread.__init__)

if sys.version_info < (2,7,11):
  import ssl
  ssl._create_default_https_context = ssl._create_unverified_context
Ejemplo n.º 6
0
import sys
import os
import time
import threading
from functools import wraps
sys.dont_write_bytecode = True
from core import config
sys.path.append(os.path.join(config.get_runtime_path(), 'lib'))
from core import logger
from platformcode import platformtools
import HTTPServer
import WebSocket

http_port = int(config.get_setting("server.port"))
websocket_port = int(config.get_setting("websocket.port"))
myip = config.get_local_ip()

def ThreadNameWrap(func):
    @wraps(func)
    def bar(*args, **kw):
        if not "name" in kw:
            kw['name'] = threading.current_thread().name
        return func(*args, **kw)

    return bar

threading.Thread.__init__ = ThreadNameWrap(threading.Thread.__init__)


def MostrarInfo():
    os.system('cls' if os.name == 'nt' else 'clear')