o
    ¦<:eÐ  ã                   @   sD   d dl mZ ddlmZ ddlmZ ddlmZ G dd„ deƒZd	S )
é   )ÚBaseé   )ÚWrongConverterError)Úrun_shell_commandé    )ÚPathc                       s4   e Zd Zd	‡ fdd„Zdedef‡ fdd„Z‡  ZS )
ÚOdtConverterÚreturnNc                    s   t ƒ  ¡  d S )N)ÚsuperÚ__init__)Úself©Ú	__class__© úg/var/www/html/file-convertor/convertpro/convertor/docconvertor/fileconverter/converter/odt_converter.pyr      s   zOdtConverter.__init__Úinput_file_pathÚoutput_file_formatc                    sz   t ƒ  ||¡ | jdkrtd| jƒ‚| j| jkrdS | j dd¡}d|› d| j› dt| jƒj› d	�}t	d
|› �ƒ t
|ƒS )Nz.odtr   )z3Output file format is the same as input file formatFÚ.Ú z soffice --headless --convert-to z "z" --outdir "ú"zShell Command: )r
   Úinitialize_detailsÚinput_file_formatr   r   Úreplacer   r   ÚparentÚprintr   )r   r   r   ÚformatÚshell_commandr   r   r   Úconvert
   s   
"zOdtConverter.convert)r	   N)Ú__name__Ú
__module__Ú__qualname__r   Ústrr   Ú__classcell__r   r   r   r   r      s    r   N)	Úbaser   Úutils.errorsr   Úutils.document_converterr   Úpathlibr   r   r   r   r   r   Ú<module>   s
    