U
    ~d                     @   s   d dl mZmZmZmZmZmZmZ d dlm	Z	 e	  d dl
mZmZ zd dl
mZ W n ek
rn   eZY nX ddlm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 )    )nested_scopes
generatorsdivisionabsolute_importwith_statementprint_functionunicode_literals)backport)ABCMetaabstractmethod)ABC   )collectionsc                       s   e Zd ZeZdZdZdZedd Z	e
dd Z fddZedd	 ZedddZedd Zedd Zedd Zedd Zedd Zedd Z  ZS )ModelNc                 C   s(   d | _ d | _d | _d | _d | _d | _d S N_format_meta_hooks_urlZ_xpathZ_pointerself r   M/var/www/html/myproject/myenv/lib/python3.8/site-packages/serial/abc/model.py__init__   s    zModel.__init__c                 C   s6   | |kst | |rdS dD ]}t||s dS qdS )zG
        Check a subclass to ensure it has required properties
        T)r   r   r   F)type__subclasscheck__hasattr)clssubclass	attributer   r   r   r   (   s    
zModel.__subclasscheck__c                    sD   dD ]}t | |s dS qzt |W S  tk
r>   Y dS X dS )V
        Check an instance of a subclass to ensure it has required properties
        r   FTN)r   super__instancecheck__AttributeError)r   instancer    	__class__r   r   r#   <   s    
zModel.__instancecheck__c                 C   s   d S r   r   r   r   r   r   _marshalS   s    zModel._marshalTc                 C   s   d S r   r   )r   raise_errorsr   r   r   	_validateX   s    zModel._validatec                 C   s   d S r   r   r   r   r   r   __str__]   s    zModel.__str__c                 C   s   d S r   r   r   r   r   r   __repr__b   s    zModel.__repr__c                 C   s   d S r   r   r   r   r   r   __copy__g   s    zModel.__copy__c                 C   s   d S r   r   )r   memor   r   r   __deepcopy__l   s    zModel.__deepcopy__c                 C   s   d S r   r   r   otherr   r   r   __eq__q   s    zModel.__eq__c                 C   s   d S r   r   r0   r   r   r   __ne__v   s    zModel.__ne__)T)__name__
__module____qualname__r
   Z__metaclass__r   r   r   r   r   classmethodr   r#   r(   r*   r+   r,   r-   r/   r2   r3   __classcell__r   r   r&   r   r      s2   







r   c                   @   sT   e Zd Zedd Zedd Zedd Zedd Zed	d
 Zedd Z	dS )Objectc                 C   s   d S r   r   r   r   r   r   r(   ~   s    zObject._marshalc                 C   s   d S r   r   r   keyvaluer   r   r   __setitem__   s    zObject.__setitem__c                 C   s   d S r   r   r   r;   r   r   r   __getitem__   s    zObject.__getitem__c                 C   s   d S r   r   )r   Zproperty_namer<   r   r   r   __setattr__   s    zObject.__setattr__c                 C   s   d S r   r   r>   r   r   r   __getattr__   s    zObject.__getattr__c                 C   s   d S r   r   r>   r   r   r   __delattr__   s    zObject.__delattr__N)
r4   r5   r6   r   r(   r=   r?   r@   rA   rB   r   r   r   r   r9   |   s   




r9   c                       sT   e Zd Ze fddZ fddZedd Zedd Zd	d
 Z	dd Z
  ZS )
Dictionaryc                    s4   | |kst | |rdS t|tjs(dS t |S z$
        Verify inheritance
        TF)r   r   
issubclassr   OrderedDictr"   r   r   r&   r   r   r      s
    zDictionary.__subclasscheck__c                    s   t | tjsdS t |S r!   F)
isinstancer   rF   r"   r#   r   r%   r&   r   r   r#      s    zDictionary.__instancecheck__c                 C   s   d S r   r   r   r   r   r   r(      s    zDictionary._marshalc                 C   s   d S r   r   r:   r   r   r   r=      s    zDictionary.__setitem__c                 C   s   d S r   r   r   r   r   r   keys   s    zDictionary.keysc                 C   s   d S r   r   r   r   r   r   values   s    zDictionary.values)r4   r5   r6   r7   r   r#   r   r(   r=   rK   rL   r8   r   r   r&   r   rC      s   

rC   c                       sP   e Zd Ze fddZ fddZedd Zedd Zed	d
 Z	  Z
S )Arrayc                    s2   | |kst | |rdS t|ts&dS t |S rD   )r   r   rE   listr"   rG   r&   r   r   r      s
    
zArray.__subclasscheck__c                    s   t | tsdS t |S rH   )rI   rN   r"   r#   rJ   r&   r   r   r#      s    
zArray.__instancecheck__c                 C   s   d S r   r   r   r   r   r   r(      s    zArray._marshalc                 C   s   d S r   r   r:   r   r   r   r=      s    zArray.__setitem__c                 C   s   d S r   r   )r   r<   r   r   r   append   s    zArray.append)r4   r5   r6   r7   r   r#   r   r(   r=   rO   r8   r   r   r&   r   rM      s   

rM   N)
__future__r   r   r   r   r   r   r   Zserial.utilities.compatibilityr	   abcr
   r   r   ImportErrorobjectZ	utilitiesr   r   r9   rC   rM   r   r   r   r   <module>   s   $
e!0