3 `��] � @ sB d dl mZmZ dd� Zdd� Zdd� ZG dd � d e�Ze� Zd S )� )�GLib�Gioc s � ��fdd�}|S )z;Register and map decorated exception class to a DBus error.c s t j| ��� � | S )N)�error_registration�register_error)�cls)�code�domain�name� �/usr/lib/python3.6/error.py� decorated s z!register_error.<locals>.decoratedr )r r r r r )r r r r r s r c s � fdd�}|S )z.Map decorated exception class to a DBus error.c s t j| � � | S )N)r � map_error)r )� error_namer r r s zmap_error.<locals>.decoratedr )r r r )r r r s r c C s t j| � | S )z9Map decorated exception class to all unknown DBus errors.)r �map_by_default)r r r r r s r c @ s` e Zd ZdZdZe� Ze� Zdd� Zdd� Z dd� Z d d � Zdd� Zd d� Z dd� Zdd� ZdS )�ErrorRegistrationz,Class for mapping exceptions to DBus errors.Nc C s || _ dS )z%Set the exception class as a default.N)�_default)�self� exception_clsr r r r # s z ErrorRegistration.map_by_defaultc C s || j |<