
    Hf                         d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	 ddl
mZ dZd	d
ddddddedddddiZ G d de          Zd ZdS )z
    pyexcel.plugins.sources.http
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Representation of http sources

    :copyright: (c) 2015-2022 by Onni Software Ltd.
    :license: New BSD License
    )	constants)AbstractSource)PY2request)PARSER   )paramszAapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheetztext/csvcsvztext/tab-separated-valuestsvz.application/vnd.oasis.opendocument.spreadsheetodszapplication/vnd.ms-excelxlsxlsxz.application/vnd.ms-excel.sheet.macroenabled.12xlsmz	text/htmlhtmlc                       e Zd ZdZej        gZej        ej	        fZ
ej        fZej        gZej        ZddZd Zd ZdS )
HttpSourcez6
    Multiple sheet data source via http protocol
    Nc                 8    || _         t          j        | fi | d S N)_HttpSource__urlr   __init__)selfurlkeywordss      ^/var/www/ffwdstore.be/apps/py-env/lib/python3.11/site-packages/pyexcel/plugins/sources/http.pyr   zHttpSource.__init__*   s(    
1111111    c                    t          j        | j                  }|                                }t          r|j        }n|                                }t                              |d           }|t          | j                  }| j
                            dd           }t          j        ||          }|                                } |j        |fi | j
        }|S )Nparser_library)r   urlopenr   infor   typeget_content_typeFILE_TYPE_MIME_TABLEget_get_file_type_from_url	_keywordsr   get_a_pluginreadparse_file_content)	r   
connectionr   	mime_type	file_typer   aparsercontentsheetss	            r   get_datazHttpSource.get_data.   s    _TZ00
   	0	II--//I(,,Y==	/
;;I++,<dCC%i@@//##++GFFt~FFr   c                     | j         d fS r   )r   )r   s    r   get_source_infozHttpSource.get_source_info>   s    z4r   r   )__name__
__module____qualname____doc__r	   URLfieldsr   SHEETBOOKtargetsREAD_ACTIONactions
attributeskeyr   r/   r1    r   r   r   r      s          j\F	/G$&G*J
*C2 2 2 2            r   r   c                 <    |                      d          }|d         S )N.)split)r   	extensions     r   r$   r$   B   s    		#IR=r   N)r5   pyexcelr   pyexcel.sourcer   pyexcel._compactr   r   pyexcel.internalr    r	   XLSXr"   r   r$   r?   r   r   <module>rK      s     + * * * * * ) ) ) ) ) ) ) ) ) ) ) ) ) ) # # # # # #      J 4e&4f                        F    r   