o
    /h                     @   sL   d dl Z d dlZddlmZ dd Zedkr$e ee jdd  dS dS )    N   )	Premailerc              	   C   s|  t jdd}|jdddt ddtjdd	 |jd
ddt ddtjdd	 |jddtdd |jddddd |jdddddd |jddddd d |jd!dd"d#d$d |jd%dd&dd'd |jd(dd)dd*d |jd+dd,dd-d |jd.d/d0d1d2 |jd3dd4d5d2 |jd6d7d8d9d: |jd;d7d<d=d: |jd>d?d@g dA |jdBdddCdDdE |jdFdddGdH |jdIdJdKdL |jdMdddNdH |jdOdddPdH || }|j	r|j	
 |_	|j }t|dQr|dJ}tdVi d/|d|jd|jd|jd |jd$|jd'|jd-|jd8|jd<|jd0|jd4|jd?|j	dC|jdR|jdS|j}|j|j |j!|j"dT dUS )Wa   Command-line tool to transform html style to inline css

    Usage::

        $ echo '<style>h1 { color:red; }</style><h1>Title</h1>' |         python -m premailer
        <h1 style="color:red"></h1>
        $ cat newsletter.html | python -m premailer
    zpython -m premailer [options])usagez-fz--file?rz0Specifies the input file.  The default is stdin.infile)nargstypehelpdefaultdestz-oz--outputwz2Specifies the output file.  The default is stdout.outfilez
--base-urlNbase_url)r   r	   r   z--remove-internal-linksTz0Remove links that start with a '#' like anchors.preserve_internal_links)r   r
   r   z--exclude-pseudoclassesFz5Pseudo classes like p:last-child', p:first-child, etc
store_trueexclude_pseudoclasses)r   r
   actionr   z--preserve-style-tagsz:Do not delete <style></style> tags from the html document.keep_style_tagsz--remove-star-selectorsz?All wildcard selectors like '* {color: black}' will be removed.store_falseinclude_star_selectorsz--remove-classesz-Remove all class attributes from all elementsremove_classesz--capitalize-float-marginz>Capitalize float and margin properties for outlook.com compat.capitalize_float_marginz--strip-importantz-Remove '!important' for all css declarations.strip_importantz--methodhtmlmethodz=The type of html to output. 'html' for HTML, 'xml' for XHTML.)r   r   r
   z--base-path	base_pathz*The base path for all external stylsheets.z--external-styleappendexternal_stylesz0The path to an external stylesheet to be loaded.)r   r   r
   z
--css-textcss_textz#CSS text to be applied to the html.z--disable-basic-attributesdisable_basic_attributesz3Disable provided basic attributes (comma separated))r   r
   r   z--disable-validationdisable_validationz5Disable CSSParser validation of attributes and values)r   r   r   r
   z--prettyz Pretty-print the outputted HTML.)r   r   r
   z
--encodingzutf-8z%Output encoding. The default is utf-8)r   r
   z--allow-insecure-sslz4Skip SSL certificate verification for external URLs.z--allow-loading-external-filesz-Allow opening any non-HTTP external file URL.decodeallow_insecure_sslallow_loading_external_files)encodingpretty_printr    )#argparseArgumentParseradd_argumentFileTypesysstdinstdoutstr
parse_argsr    splitr   readhasattrr"   r   r   r   r   r   r   r   r   r   r   r   r   r!   r#   r$   r   write	transformr%   pretty)argsparseroptionsr   pr'   r'   F/var/www/html/myenv/lib/python3.10/site-packages/premailer/__main__.pymain   sR  





	
r<   __main__)r,   r(   	premailerr   r<   __name__exitargvr'   r'   r'   r;   <module>   s     @