B
    ©‰Adw  ã               @   s^   d dl mZ d dlmZ d dlZdddddd	d
dddddœZe e¡ dd„ ZdZdd„ Z	dS )é    )ÚBaseOxmlElement)ÚnsmapNz5http://schemas.openxmlformats.org/drawingml/2006/mainz9http://schemas.microsoft.com/office/drawing/2016/SVG/mainzGhttp://schemas.openxmlformats.org/officeDocument/2006/custom-propertiesz'urn:schemas-microsoft-com:office:officez8http://schemas.openxmlformats.org/drawingml/2006/picturezChttp://schemas.openxmlformats.org/officeDocument/2006/relationshipszurn:schemas-microsoft-com:vmlzDhttp://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypesz<http://schemas.openxmlformats.org/wordprocessingml/2006/mainzFhttp://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawingz8http://schemas.openxmlformats.org/drawingml/2006/diagram)ÚaZasvgÚcpÚoZpicÚrÚvÚvtÚwZwpZdgmc             C   s&   t | tƒr|  |¡S | j|tdS dS )z¾Performs an XPath query on the given element and returns all matching
       elements.
       Works with lxml.etree._Element and with
       docx.oxml.xmlchemy.BaseOxmlElement elements.
    )Ú
namespacesN)Ú
isinstancer   ÚxpathÚNS)ÚelementZ	xpath_str© r   úC/var/www/html/venv/lib/python3.7/site-packages/docxcompose/utils.pyr      s    

r   ))ÚYÚy)ÚDÚd)ZddddZEEEE)ZdddÚE)zam/pmzAM/PM)zAM/PMr   c             C   s$   xt D ]\}}t ||| ¡} qW | S )N)Údate_format_mapÚreÚsub)Ú
format_strZword_formatZpython_formatr   r   r   Úword_to_python_date_format-   s    r   )
Zdocx.oxml.xmlchemyr   Zdocx.oxml.nsr   r   r   Úupdater   r   r   r   r   r   r   Ú<module>   s"   
	