
    Hf:                     T    d Z ddlmZ  G d de          Z G d de          Zd ZdS )	z
    pyexcel.source
    ~~~~~~~~~~~~~~~~~~~~~~~~

    Generic data source definition

    :copyright: (c) 2015-2022 by Onni Software Ltd.
    :license: New BSD License
    )	constantsc                   j    e Zd ZdZej        gZg Zg Zg Z	ej        Z
d Zd Zed             Zd Zd ZdS )AbstractSourcez
    Define a data source for use with the signature functions

    This can be used to extend the function parameters once the custom
    class inherit this and register it with corresponding source registry
    c                     || _         d S N)	_keywords)selfkeywordss     P/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/pyexcel/source.py__init__zAbstractSource.__init__   s    !    c                     dS )zwreturn filename and path, otherwise not useful

        see also `:meth:pyexcel.internal.core.get_book_stream`
        )NN r	   s    r   get_source_infozAbstractSource.get_source_info   s	    
 |r   c                 h    fd| j         D             }d |D             }t          |          dk    S )zL
        If all required keys are present, this source is activated
        c                 0    g | ]}t          |          S r   )
_has_field).0fieldr
   s     r   
<listcomp>z1AbstractSource.is_my_business.<locals>.<listcomp>*   s#    HHHEJuh//HHHr   c                     g | ]}|d u |	S )Fr   )r   statuss     r   r   z1AbstractSource.is_my_business.<locals>.<listcomp>+   s    DDDfFeOO6OOOr   r   )fieldslen)clsactionr
   statusesresultss     `  r   is_my_businesszAbstractSource.is_my_business%   sE    
 IHHHSZHHHDDDDD7||q  r   c                      t          d          )zWrite data to a data source NotImplementedError)r	   contents     r   
write_datazAbstractSource.write_data.       !"%%%r   c                      t          d          )zGet data from a data sourcer"   r#   r   s    r   get_datazAbstractSource.get_data2   r'   r   N)__name__
__module____qualname____doc__r   SOURCEr   
attributestargetsactionskeyr   r   classmethodr    r&   r)   r   r   r   r   r      s          FJGG

C" " "   ! ! [!& & && & & & &r   r   c                       e Zd ZdZd ZdS )MemorySourceMixinziA memory source should an internal memory stream

    And it is desirable to get its internal stream
    c                     | j         S )z|Get memory repsentation of the formatted data

        e.g. StringIO instance which contains the csv formatted data
        )_contentr   s    r   get_contentzMemorySourceMixin.get_content=   s    
 }r   N)r*   r+   r,   r-   r8   r   r   r   r5   r5   7   s-         
    r   r5   c                     | |v o	||          d uS r   r   )r   r
   s     r   r   r   E   s    H<%!<<r   N)r-   pyexcelr   objectr   r5   r   r   r   r   <module>r<      s     + * * * * *'& '& '& '& '&V '& '& '&T       = = = = =r   