o
    ‹¨Êh   ã                   @   sR   d Z ddlmZmZ ddlmZ ddlmZ ddlm	Z	m
Z
 G dd„ deeƒZd	S )
zÖ
    pyexcel.plugins.sources.pydata.dictsource
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Representation of dict sources

    :copyright: (c) 2015-2017 by Onni Software Ltd.
    :license: New BSD License
é    )ÚAbstractSourceÚMemorySourceMixin)ÚDEFAULT_SHEET_NAME)Úparamsé   )Ú
DictReaderÚ_FakeIOc                   @   s6   e Zd ZdZdefdd„Zdd„ Zdd„ Zd	d
„ ZdS )Ú
DictSourcez?
    A dictionary of one dimensional array as sheet source
    Tc                 K   s0   || _ || _tƒ | _|| _tj| fi |¤Ž d S ©N)Ú_DictSource__adictÚ_DictSource__with_keysr   Ú_contentÚ_DictSource__sheet_namer   Ú__init__)ÚselfÚadictÚ	with_keysÚ
sheet_nameÚkeywords© r   ú[/var/www/html/env/lib/python3.10/site-packages/pyexcel/plugins/sources/pydata/dictsource.pyr      s
   zDictSource.__init__c                 C   s(   t | jfd| ji| j¤Ž}| j| ¡ iS )Nr   )r   r   r   Ú	_keywordsr   Úto_array)r   Údict_readerr   r   r   Úget_data   s   ÿÿÿzDictSource.get_datac                 C   s
   t jd fS r
   )r   ÚADICT)r   r   r   r   Úget_source_info$   s   
zDictSource.get_source_infoc                 C   s   | j  | ¡ ¡ d S r
   )r   ÚsetvalueÚto_dict)r   Úsheetr   r   r   Ú
write_data'   s   zDictSource.write_dataN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r    r   r   r   r   r	      s    
ÿ	r	   N)r$   Úpyexcel.sourcer   r   Úpyexcel.constantsr   Úpyexcel.plugins.sourcesr   Úcommonr   r   r	   r   r   r   r   Ú<module>   s    	