# Project name: SmartehIDE
# __init__.py.py: spacer widget module initialization
# 19. 01. 2017 12:24 Uporabnik
# Copyright (c) 2017 Smarteh d.o.o. <info@smarteh.si>
# THIS PROGRAM COMES WITH NO WARRANTY
from connectors.PYRO import PYRO_connector_factory
oldPYRO_connector_factory = PYRO_connector_factory
def MW_PYRO_connector_factory(uri, confnodesroot):
servicetype, location = uri.split("://")
if servicetype == "PYROS":
schemename = "PYROLOCSSL"
def CustomFunctionCall(self, funcname, args=None):
member = self.__dict__.get(funcname, None)
def my_local_func(*args, **kwargs):
funcnameCall = funcname.split('.')[-1]
return RemoteMWControllerProxy.__getattr__(funcnameCall)(*args, **kwargs)
member = PyroCatcher(my_local_func, None)
self.__dict__[funcname] = member
RemoteMWControllerProxy = Pyro.core.getAttrProxyForURI(schemename + "://" + location + "/MWController")
pyro_connector = oldPYRO_connector_factory(uri, confnodesroot)
pyro_connector.RemoteMWControllerProxy = RemoteMWControllerProxy
pyro_connector.CustomFunctionCall = CustomFunctionCall
PYRO_connector_factory = MW_PYRO_connector_factory
connectors.connectors["PYRO"] = lambda: MW_PYRO_connector_factory