Ejemplo n.º 1
0
    def get_dfunc_method(self, plugin_config):
        try:
            methodname = plugin_config['dfunc_method']
        except KeyError:
            raise ConfigItemMissing('dfunc_method')

        dfunc_method = extloader.get_object(methodname)

        log.info('loaded stringmethod dfunc method {!r}'.format(dfunc_method))

        return dfunc_method
Ejemplo n.º 2
0
    def get_avgpos_method(self, plugin_config):
        try:
            methodname = plugin_config['avgpos_method']
        except KeyError:
            raise ConfigItemMissing('avgpos_method')

        if methodname.lower() == 'cartesian':
            avgpos_method = self.avgpos_cartesian
        else:
            avgpos_method = extloader.get_object(methodname)

        log.info('loaded stringmethod avgpos method {!r}'.format(avgpos_method))

        return avgpos_method
Ejemplo n.º 3
0
    def get_string_method(self, plugin_config):
        try:
            methodname = plugin_config['string_method']
        except KeyError:
            raise ConfigItemMissing('string_method')

        if methodname.lower() == 'default':
            str_method = DefaultStringMethod
        else:
            str_method = extloader.get_object(methodname)

        assert issubclass(str_method, WESTStringMethod)
        log.debug('loaded stringmethod string method {!r}'.format(str_method))

        return str_method