a
    &ñ»jÐ  ã                   @  s"   d Z ddlmZ G dd„ dƒZdS )z
(c) 2008-2013, holger krekel
é    )Úannotationsc                   @  s&  e Zd ZU dZdZded< dZded< dZded< dZded< dZ	ded	< dZ
ded
< dZded< dZded< dZded< dZded< dZded< dZded< dZded< dddœdd„Zdddœdd„Zddœdd„Zddœdd„Zd dœd!d"„Zd#d$d%œd&d'„Zd#d$d%œd(d)„Zd$dœd*d+„ZdS ),ÚXSpecaH  Execution Specification: key1=value1//key2=value2 ...

    * Keys need to be unique within the specification scope
    * Neither key nor value are allowed to contain "//"
    * Keys are not allowed to contain "="
    * Keys are not allowed to start with underscore
    * If no "=value" is given, assume a boolean True value
    Nz
str | NoneÚchdirzbool | NoneÚdont_write_bytecodeÚ	execmodelÚidÚ
installviaÚniceÚpopenÚpythonÚsocketÚsshÚ
ssh_configÚvagrant_sshÚviaÚstrÚNone)ÚstringÚreturnc                 C  s¼   || _ i | _| d¡D ] }| d¡}|dkr8|d }}n|d |… ||d d …  }}|d dkrntd| ƒ‚|| jv rŒtd	|›d
|›�ƒ‚| d¡rª|| j|dd … < qt| ||ƒ qd S )Nz//ú=éÿÿÿÿTé   r   Ú_z%r not a valid XSpec keyzduplicate key: z in zenv:é   )	Ú_specÚenvÚsplitÚfindÚAttributeErrorÚ__dict__Ú
ValueErrorÚ
startswithÚsetattr)Úselfr   ZkeyvalueÚiÚkeyÚvalue© r'   ú3E:\soccer\ml_env\Lib\site-packages\execnet/xspec.pyÚ__init__!   s    


zXSpec.__init__zNone | bool | str)Únamer   c                 C  s   |d dkrt |ƒ‚d S )Nr   r   )r   )r#   r*   r'   r'   r(   Ú__getattr__4   s    zXSpec.__getattr__)r   c                 C  s   d| j ›d�S )Nz<XSpec ú>©r   ©r#   r'   r'   r(   Ú__repr__9   s    zXSpec.__repr__c                 C  s   | j S ©Nr-   r.   r'   r'   r(   Ú__str__<   s    zXSpec.__str__Úintc                 C  s
   t | jƒS r0   )Úhashr   r.   r'   r'   r(   Ú__hash__?   s    zXSpec.__hash__ÚobjectÚbool)Úotherr   c                 C  s   | j t|dd ƒkS ©Nr   ©r   Úgetattr©r#   r7   r'   r'   r(   Ú__eq__B   s    zXSpec.__eq__c                 C  s   | j t|dd ƒkS r8   r9   r;   r'   r'   r(   Ú__ne__E   s    zXSpec.__ne__c                 C  s   | j d uo| jd u S r0   )r
   r   r.   r'   r'   r(   Ú_samefilesystemH   s    zXSpec._samefilesystem)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__annotations__r   r   r   r   r	   r
   r   r   r   r   r   r   r)   r+   r/   r1   r4   r<   r=   r>   r'   r'   r'   r(   r      s,   

r   N)rB   Ú
__future__r   r   r'   r'   r'   r(   Ú<module>   s   