Ejemplo n.º 1
0
def is_v1():
    return push_version == '1'

def apply_ubermap_patches():
    log.info("Applying UbermapDevices patches")

    apply_log_method_patches()
    apply_banking_util_patches()
    apply_device_component_patches()
    apply_device_parameter_bank_patches()
    apply_device_parameter_adapater_patches()

# Create singleton UbermapDevices instance
ubermap = UbermapDevices.UbermapDevices()
ubermap_config = config.load('global')
push_version = ubermap_config.get('Push', 'Version')

def apply_log_method_patches():
    # Log any method calls made to the object - useful for tracing execution flow
    # Use like: DeviceComponent.__getattribute__ = __getattribute__
    def __getattribute__(self, name):
        returned = object.__getattribute__(self, name)
        if inspect.isfunction(returned) or inspect.ismethod(returned):
            log.info('Called ' + self.__class__.__name__ + '::' + str(returned.__name__))
        return returned

############################################################################################################

# BankingUtil
from pushbase import banking_util
Ejemplo n.º 2
0
    return push_version == '1'


def apply_ubermap_patches():
    log.info("Applying UbermapDevices patches")

    apply_log_method_patches()
    apply_banking_util_patches()
    apply_device_component_patches()
    apply_device_parameter_bank_patches()
    apply_device_parameter_adapater_patches()


# Create singleton UbermapDevices instance
ubermap = UbermapDevices.UbermapDevices()
ubermap_config = config.load('global')
push_version = ubermap_config.get('Push', 'Version')


def apply_log_method_patches():
    # Log any method calls made to the object - useful for tracing execution flow
    # Use like: DeviceComponent.__getattribute__ = __getattribute__
    def __getattribute__(self, name):
        returned = object.__getattribute__(self, name)
        if inspect.isfunction(returned) or inspect.ismethod(returned):
            log.info('Called ' + self.__class__.__name__ + '::' +
                     str(returned.__name__))
        return returned


############################################################################################################
Ejemplo n.º 3
0
 def __init__(self):
     self.cfg = config.load('browser')
Ejemplo n.º 4
0
 def get_device_config(self, device):
     cfg = config.load(self.get_device_name(device), 'Devices')
     if not cfg:
         return False
     return cfg if cfg.get('Config', 'Ignore') == 'False' else False
Ejemplo n.º 5
0
 def __init__(self):
     self.cfg = config.load('devices')
     log.info('UbermapDevices ready')
Ejemplo n.º 6
0
 def get_device_config(self, device):
     cfg = config.load(self.get_device_name(device), 'Devices')
     if not cfg:
         return False
     return cfg if cfg.get('Config', 'Ignore') == 'False' else False
Ejemplo n.º 7
0
 def __init__(self):
     self.cfg = config.load('devices')
     log.info('UbermapDevices ready')
Ejemplo n.º 8
0
 def __init__(self):
     self.cfg = config.load('devices')
     log('INFO UbermapDevices ready')