def _configure(self, configname): """ a part of init method. If no name is given it will take automatically the name of the class. """ self.__client__ = AXLClient.get_client(configname) self.__config__ = pyaxl.configuration.registry.get(configname) self.__configname__ = configname if self.__name__ is '': self.__name__ = self.__class__.__name__
def list(cls, criteria, returns, skip=None, first=None, configname='default'): """ find all object with the given search criteria. It also required a list with return values. The return value is a generator and the next call will return a tuple with the returnsValues. """ client = AXLClient.get_client(configname) method = cls._axl_method(PF_LIST, cls.__name__, client) tags = dict([(i, True) for i in returns]) log.debug('fetch list of %ss, search criteria=%s' % (cls.__name__, str(criteria))) args = criteria, tags if skip is not None or first is not None: if skip is None: skip = 0 if first is None: args = criteria, tags, skip else: args = criteria, tags, skip, first return cls._prepare_result(method(*args), returns)
def __init__(self, configname): self.client = AXLClient.get_client(configname)