U
    ±[Öe¡  ã                   @   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-2022 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   s,   || _ || _tƒ | _|| _tj| f|Ž d S ©N)Ú_DictSource__adictÚ_DictSource__with_keysr   Ú_contentÚ_DictSource__sheet_namer   Ú__init__)ÚselfÚadictÚ	with_keysZ
sheet_nameÚkeywords© r   úk/var/www/html/services/stratfitenv/lib/python3.8/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   Z	_keywordsr   Zto_array)r   Zdict_readerr   r   r   Úget_data   s    ÿÿÿzDictSource.get_datac                 C   s
   t jd fS r
   )r   ZADICT)r   r   r   r   Úget_source_info%   s    zDictSource.get_source_infoc                 C   s   | j  | ¡ ¡ d S r
   )r   ZsetvalueÚto_dict)r   Z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   Zpyexcel.sourcer   r   Zpyexcel.constantsr   Zpyexcel.plugins.sourcesr   Úcommonr   r   r	   r   r   r   r   Ú<module>   s
   	