Exemple #1
0
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()]
Exemple #2
0
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)