o
    ‹¨Êh�  ã                   @   s8   d Z ddlZddlmZ ddlmZ G dd„ deƒZdS )zÍ
    pyexcel.plugins.sources.file_input
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Representation of input file sources

    :copyright: (c) 2015-2017 by Onni Software Ltd.
    :license: New BSD License
é    N)ÚAbstractSource)ÚPARSERc                   @   s*   e Zd ZdZd	dd„Zdd„ Zdd„ ZdS )
ÚReadExcelFromFilezGPick up 'file_name' field and do single sheet based read and write
    Nc                 K   sN   || _ d|v r| d¡}n| j  d¡d }t ||¡| _tj| fi |¤Ž d S )NÚforce_file_typeÚ.éÿÿÿÿ)Ú_ReadExcelFromFile__file_nameÚgetÚsplitr   Úget_a_pluginÚ_ReadExcelFromFile__parserr   Ú__init__)ÚselfÚ	file_nameÚparser_libraryÚkeywordsÚ	file_type© r   úT/var/www/html/env/lib/python3.10/site-packages/pyexcel/plugins/sources/file_input.pyr      s   zReadExcelFromFile.__init__c                 C   s   t j | j¡\}}||fS )N)ÚosÚpathr
   r   )r   r   r   r   r   r   Úget_source_info   s   z!ReadExcelFromFile.get_source_infoc                 C   s   | j j| jfi | j¤Ž}|S )zE
        Return a dictionary with only one key and one value
        )r   Ú
parse_filer   Ú	_keywords)r   Úsheetsr   r   r   Úget_data#   s   zReadExcelFromFile.get_data)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r      s
    

r   )r   r   Úpyexcel.sourcer   Úpyexcel.internalr   r   r   r   r   r   Ú<module>   s
    	