관리-도구
편집 파일: prepstyles.cpython-311.pyc
� P�Dg^ � �| � d Z ddlmZ ddlZddlZddlmZ ddlZddl Z ddd�Z d� Zd � Ze d k r e� � dS dS )z� Adapt a word-processor-generated styles.odt for odtwriter use: Drop page size specifications from styles.xml in STYLE_FILE.odt. See https://docutils.sourceforge.io/docs/user/odt.html#page-size � )�ElementTreeN)�mkstempz/urn:oasis:names:tc:opendocument:xmlns:style:1.0z;urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0)�style�foc �� � t j | � � }|� d� � }d }t j |d�� � D ]7\ }}|dk r"t j |d |d � � �-|dk r|�|}�8|� � � |� dt � � � D ]D}t |j � � D ]-}|� d t d z � � r|j |= �.�Et � � }t j t j |d d� � d t j � � } |� � � D ]f} | j dk r+| � | t j |d�� � � � �8| � | |� | j � � � � �g| � � � |� � � t+ j |d | � � d S )Nz styles.xml)�start�start-ns)�eventsr r � r z.//style:page-layout-properties)� namespacesz{%s}r �wb�wzUTF-8)�encoding)�zipfile�ZipFile�open�etree� iterparse�register_namespace�close�findall� NAMESPACES�list�attrib� startswithr �os�fdopen�ZIP_DEFLATED�infolist�filename�writestr�tostring�read�shutil�move)r �zin�styles�root�event�elem�el�attr�tempname�zout�items ��/builddir/build/BUILD/imunify360-venv-2.4.0/opt/imunify360/venv/lib/python3.11/site-packages/docutils/writers/odf_odt/prepstyles.py� prepstyler1 s� � � �/�(� #� #�C� �X�X�l� #� #�F��D���v�6K�L�L�L� � ���t��J����$�T�!�W�d�1�g�6�6�6�6� �g� � ��|���� �L�L�N�N�N��l�l�<�&0� � 2� 2� $� $�����O�O� $� $�D����v� �4�(8�8�9�9� $��I�d�O�� $� �y�y�H��?�2�9�X�a�[�$�7�7��"�/�1� 1�D� ����� 9� 9���=�L�(�(��M�M�$���t�g� F� F� F�G�G�G�G��M�M�$������ 7� 7�8�8�8�8��J�J�L�L�L��I�I�K�K�K� �K����X�&�&�&�&�&� c �Z � t j dd � } t | � � dk s | d dv rbt t t j �� � t dt j d z t j �� � t j d� � | d }t |� � d S )Nr r )z-hz--help)�filezUsage: %s STYLE_FILE.odt )�sys�argv�len�print�__doc__�stderr�exitr1 )�argsr s r0 �mainr= C s� � ��8�A�B�B�<�D� �4�y�y�A�~�~��a��$4�4�4� �g�C�J�'�'�'�'� �*�S�X�a�[�8�s�z�J�J�J�J��������A�w�H� �h�����r2 �__main__)r9 � xml.etreer r r5 r �tempfiler r$ r r r1 r= �__name__� r2 r0 �<module>rC s� ��� � +� *� *� *� *� *� � � � � ���� � � � � � � � � � � � � � � ?� G�� � �"'� "'� "'�J� � � �z����D�F�F�F�F�F� �r2