<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
a
    `8a\	  ã                   @   s4   d dl mZmZ d dlmZ dZG dd„ deƒZdS )é   )ÚMissingRequiredErrorÚReadOnlyError)ÚUnicodeMixin)ÚConfigurationc                   @   s~   e Zd Zddd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )r   Nc                 C   s.   || j d< i | j d< |D ]}|| j|j< qd S )NÚ_parentÚ	_settings)Ú__dict__r   Úname)ÚselfÚsettingsÚparentÚsetting© r   úG/home/carl/code/landscape/setoptconf-tmp/build/lib/setoptconf/config.pyÚ__init__	   s    

zConfiguration.__init__c                 C   sb   || j v r>| j | }|jr^|js^| jr4| j |¡ q^t|ƒ‚n | jrR| j |¡ ntd| ƒ‚d S ©NzNo such setting "%s")r   ÚrequiredÚestablishedr   Úvalidate_settingr   ÚAttributeError)r
   r	   r   r   r   r   r      s    


zConfiguration.validate_settingc                 C   s   | D ]}|   |¡ qd S ©N)r   ©r
   r	   r   r   r   Úvalidate   s    zConfiguration.validatec                 C   sd   || j v rB| j | jr"| j | jS | jr4t| j|ƒS | j | jS n| jrTt| j|ƒS td| ƒ‚d S r   )r   r   Úvaluer   ÚgetattrÚdefaultr   r   r   r   r   Ú__getattr__!   s    
zConfiguration.__getattr__c                 C   s
   t | |ƒS r   )r   ©r
   Úkeyr   r   r   Ú__getitem__.   s    zConfiguration.__getitem__c                 C   s   t dƒ‚d S )Nz#Cannot change the value of settings©r   )r
   r	   r   r   r   r   Ú__setattr__1   s    zConfiguration.__setattr__c                 C   s   t | ||ƒ d S r   )Úsetattr)r
   r   r   r   r   r   Ú__setitem__4   s    zConfiguration.__setitem__c                 C   s   t dƒ‚d S )NzCannot delete settingsr    r   r   r   r   Ú__delattr__7   s    zConfiguration.__delattr__c                 C   s   t | |ƒ d S r   )Údelattrr   r   r   r   Ú__delitem__:   s    zConfiguration.__delitem__c                 C   s,   t | j ¡ ƒ}| jr$| t| jƒ¡ t|ƒS r   )Úsetr   Úkeysr   ÚupdateÚiter)r
   Z	all_namesr   r   r   Ú__iter__=   s    zConfiguration.__iter__c                 C   s   t tt| ƒƒƒS r   )ÚlenÚlistr*   ©r
   r   r   r   Ú__len__C   s    zConfiguration.__len__c                 C   s   |t t| ƒƒv S r   )r-   r*   )r
   Úitemr   r   r   Ú__contains__F   s    zConfiguration.__contains__c                    s   dd  ‡ fdd„ˆ D ƒ¡ S )NzConfiguration(%s)z, c                    s    g | ]}d |t ˆ | ƒf ‘qS )z%s=%s)Úrepr)Ú.0r	   r.   r   r   Ú
<listcomp>K   ó    z-Configuration.__unicode__.<locals>.<listcomp>)Újoinr.   r   r.   r   Ú__unicode__I   s    ÿzConfiguration.__unicode__c                 C   s   dt | ƒ S )Nz<%s>)Ústrr.   r   r   r   Ú__repr__N   s    zConfiguration.__repr__)N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r!   r#   r$   r&   r+   r/   r1   r7   r9   r   r   r   r   r      s   
r   N)Ú	exceptionr   r   Úutilr   Ú__all__r   r   r   r   r   Ú<module>   s   