U
    Æ½„bŸ  ã                   @   s€   d dl mZ ddddddgZG dd„ deƒZG d	d„ deƒZ	G d
d„ deƒZ
G dd„ deƒZG dd„ deƒZG dd„ deƒZdS )é    )ÚAnchorÚ	ScalarIntÚ	BinaryIntÚOctalIntÚHexIntÚ
HexCapsIntÚ
DecimalIntc                   @   s\   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Ze	dd„ ƒZ
ddd„Zddd„ZdS )r   c                 O   s\   |  dd ¡}|  dd ¡}|  dd ¡}tj| f|ž|Ž}||_||_|d k	rX|j|dd� |S )NÚwidthÚ
underscoreÚanchorT)Úalways_dump)ÚpopÚintÚ__new__Ú_widthÚ_underscoreÚyaml_set_anchor)ÚclsÚargsÚkwr	   r
   r   Úv© r   ú9/tmp/pip-unpacked-wheel-ctuyz3qg/ruamel/yaml/scalarint.pyr      s    zScalarInt.__new__c                 C   s:   t | ƒ| | ƒ}| j|_| jd k	r0| jd d … nd |_|S ©N©Útyper   r   ©ÚselfÚaÚxr   r   r   Ú__iadd__   s
    ÿzScalarInt.__iadd__c                 C   s:   t | ƒ| | ƒ}| j|_| jd k	r0| jd d … nd |_|S r   r   r   r   r   r   Ú__ifloordiv__!   s
    ÿzScalarInt.__ifloordiv__c                 C   s:   t | ƒ| | ƒ}| j|_| jd k	r0| jd d … nd |_|S r   r   r   r   r   r   Ú__imul__*   s
    ÿzScalarInt.__imul__c                 C   s:   t | ƒ| | ƒ}| j|_| jd k	r0| jd d … nd |_|S r   r   r   r   r   r   Ú__ipow__3   s
    ÿzScalarInt.__ipow__c                 C   s:   t | ƒ| | ƒ}| j|_| jd k	r0| jd d … nd |_|S r   r   r   r   r   r   Ú__isub__<   s
    ÿzScalarInt.__isub__c                 C   s(   t | tjƒst| tjtƒ ƒ t| tjƒS r   )Úhasattrr   ÚattribÚsetattrÚgetattr)r   r   r   r   r   E   s    zScalarInt.anchorFc                 C   s&   t | tjƒsd S |s| jjr"| jS d S r   )r%   r   r&   r   r   )r   Úanyr   r   r   Úyaml_anchorL   s
    zScalarInt.yaml_anchorc                 C   s   || j _|| j _d S r   )r   Úvaluer   )r   r+   r   r   r   r   r   T   s    zScalarInt.yaml_set_anchorN)F)F)Ú__name__Ú
__module__Ú__qualname__r   r    r!   r"   r#   r$   Úpropertyr   r*   r   r   r   r   r   r      s   					

c                   @   s   e Zd Zddd„ZdS )r   Nc                 C   s   t j| ||||d�S ©N)r	   r
   r   ©r   r   ©r   r+   r	   r
   r   r   r   r   r   [   s    zBinaryInt.__new__)NNN©r,   r-   r.   r   r   r   r   r   r   Z   s   c                   @   s   e Zd Zddd„ZdS )r   Nc                 C   s   t j| ||||d�S r0   r1   r2   r   r   r   r   a   s    zOctalInt.__new__)NNNr3   r   r   r   r   r   `   s   c                   @   s   e Zd ZdZddd„ZdS )r   zuses lower case (a-f)Nc                 C   s   t j| ||||d�S r0   r1   r2   r   r   r   r   m   s    zHexInt.__new__)NNN©r,   r-   r.   Ú__doc__r   r   r   r   r   r   j   s   c                   @   s   e Zd ZdZddd„ZdS )r   zuses upper case (A-F)Nc                 C   s   t j| ||||d�S r0   r1   r2   r   r   r   r   u   s    zHexCapsInt.__new__)NNNr4   r   r   r   r   r   r   s   c                   @   s   e Zd ZdZddd„ZdS )r   zneeded if anchorNc                 C   s   t j| ||||d�S r0   r1   r2   r   r   r   r   }   s    zDecimalInt.__new__)NNNr4   r   r   r   r   r   z   s   N)Zruamel.yaml.anchorr   ÚTextÚAnyÚDictÚListÚ__all__r   r   r   r   r   r   r   r   r   r   r   Ú<module>   s   O
