def __init__(self, typ, reason): self._data = dict() self._dirty_data = dict() self._persisted = False self._proxy = None self._probdir = None self.type = typ self.analyzer = typ self.reason = reason self._proxy = proxies.get_proxy()
def list(auth=False, __proxy=proxies.get_proxy()): ''' Return the list of the problems Use ``auth=True`` if authentication should be attempted. If authentication via polkit fails, function behaves as if ``auth=False`` was specified (only users problems are returned). ''' fun = __proxy.list if auth: fun = __proxy.list_all return [tools.problemify(prob, __proxy) for prob in fun()]
def get(identifier, auth=False, __proxy=proxies.get_proxy()): ''' Return problem object matching ``identifier`` Return ``None`` in case the problem does not exist. Use ``auth=True`` if authentication should be attempted. ''' fun = __proxy.list if auth: fun = __proxy.list_all if identifier not in fun(): return None return tools.problemify(identifier, __proxy)