Sindbad~EG File Manager
�
Mٜg�+ � � � d dl mZ d dlmZ d dlZd dlZd dlmZmZm Z m
Z
mZ d dlm
Z
d dlmZmZ erd dlmZmZmZmZ d dlmZ G d � d
e
� Zy)� )�annotations)�defaultdictN)�
TYPE_CHECKING�Any�DefaultDict�cast�overload)�ExcelWriter)�combine_kwargs�validate_freeze_panes)�ExcelWriterIfSheetExists�FilePath�StorageOptions�WriteExcelBuffer)� ExcelCellc � � � e Zd ZdZdZ d d� fd�
Zed� � Zedd�� Zdd�Z d dd�Z
dd�Zdd �Ze
dd
�� Ze
dd�� Zdd�Z dd
�Z� xZS )� ODSWriter�odf)z.odsc � �� ddl m}
|dk( rt d� �t || � } |
di |��| _ t
�| � |||||�� i | _ y )Nr )�OpenDocumentSpreadsheet�az&Append mode is not supported with odf!)�mode�storage_options�if_sheet_exists�
engine_kwargs� )�odf.opendocumentr �
ValueErrorr �_book�super�__init__�_style_dict)�self�path�engine�date_format�datetime_formatr r r r �kwargsr � __class__s ��E/usr/local/lib/python3.12/site-packages/pandas/io/excel/_odswriter.pyr! zODSWriter.__init__# sa �� � =��3�;��E�F�F�&�}�f�=�
�,�=�}�=��
�
�����+�+�'� �
� ,.��� c � � | j S )z�
Book instance of class odf.opendocument.OpenDocumentSpreadsheet.
This attribute can be used to access engine-specific features.
)r )r# s r* �bookzODSWriter.bookA s � � �z�z�r+ c � � ddl m} | j j |� D �ci c] }|j d� |�� }}|S c c}w )z(Mapping of sheet names to sheet objects.r )�Table�name)� odf.tabler/ r- �getElementsByType�getAttribute)r# r/ �sheet�results r* �sheetszODSWriter.sheetsJ sT � � $� ���4�4�U�;�
�;��
���v�&��-�;� �
� �
��
s �Ac �� � | j j � D ]'