
    r}f                     >   d dl mZmZmZ d dlmZ d dlmZ d dlmZ d dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlmZ ddlmZmZ dd	lmZmZ dd
lmZmZmZmZmZ dZdZdZdZ dZ!dZ"dZ#dZ$g dZ%g dZ&g dZ'	 	 	 dHde(de(de(dede(dede(ef         d eedf         d!e)d"e)d#ee(df         d$e(fd%Z*	 	 	 	 dId&ee+e(eef         de(dee(df         dede(dede(ef         d eedf         d!e)d"e)d#ee(df         d$e(fd'Z,d$e)fd(Z-d) Z.d*e(de(d$e(fd+Z/de0de(d$e0fd,Z1dJde0de(de(fd-Z2d. Z3d/ Z4	 	 	 dKd0Z5dLd2Z6d3 Z7d$efd4Z8d$efd5Z9d6e(d$e(fd7Z:d$e(fd8Z;d$e(fd9Z<dMd:e=d;e=d$e)fd<Z>dNd:e=d;e=d$e)fd>Z?dOd?Z@	 	 	 	 dPdAee(df         dBee(df         dCe(dDe)d$df
dEZAdF ZBdG ZCdaDdaEdS )Q    )absolute_importprint_functionwith_statement)Iterable)Union)	GeneratorNPath   )logger_check_log_handler)DEFAULT_TARGET_FOLDERdownload_pandoc)
cast_bytescast_unicodestring_typesurl2pathurlparseu   Juho Vepsäläinenzbebraw@gmail.comzJessica Tegnerz)https://github.com/JessicaTegner/pypandocz1.13MITzThin wrapper for pandoc.z>=3.6)
setuptoolsz
pip>=8.1.0zwheel>=0.25.0)zDevelopment Status :: 4 - BetazEnvironment :: ConsolezIntended Audience :: Developersz*Intended Audience :: System Administratorsz&License :: OSI Approved :: MIT LicensezOperating System :: POSIXzProgramming Language :: PythonzTopic :: Text Processingz#Topic :: Text Processing :: Filtersz#Programming Language :: Python :: 3z%Programming Language :: Python :: 3.6z%Programming Language :: Python :: 3.7z%Programming Language :: Python :: 3.8z%Programming Language :: Python :: 3.9z&Programming Language :: Python :: 3.10z&Programming Language :: Python :: 3.11z&Programming Language :: Python :: 3.12z;Programming Language :: Python :: Implementation :: CPythonz8Programming Language :: Python :: Implementation :: PyPy)convert_fileconvert_textget_pandoc_formatsget_pandoc_versionget_pandoc_pathr    utf-8TFsourcetoformat
extra_argsencoding
outputfilefiltersverify_formatsandboxcworkdirreturnc
                 T    t          | |          } t          | |d|||||||	
  
        S )a  Converts given `source` from `format` to `to`.

    :param str source: Unicode string or bytes (see encoding)

    :param str to: format into which the input should be converted; can be one of
            `pypandoc.get_pandoc_formats()[1]`

    :param str format: the format of the inputs; can be one of `pypandoc.get_pandoc_formats()[1]`

    :param list extra_args: extra arguments (list of strings) to be passed to pandoc
            (Default value = ())

    :param str encoding: the encoding of the input bytes (Default value = 'utf-8')

    :param str outputfile: output will be written to outputfile or the converted content
            returned if None. The output filename can be specified as a string
            or pathlib.Path object. (Default value = None)

    :param list filters: pandoc filters e.g. filters=['pandoc-citeproc']

    :param bool verify_format: Verify from and to format before converting. Should only be set False when confident of the formats and performance is an issue.
            (Default value = True)

    :param bool sandbox: Run pandoc in pandocs own sandbox mode, limiting IO operations in readers and writers to reading the files specified on the command line. Anyone using pandoc on untrusted user input should use this option. Note: This only does something, on pandoc >= 2.15
            (Default value = False)

    :returns: converted string (unicode) or an empty string if an outputfile was given
    :rtype: unicode

    :raises RuntimeError: if any of the inputs are not valid of if pandoc fails with an error
    :raises OSError: if pandoc is not found; make sure it has been installed and is available at
            path.
    stringr!   r#   r$   r%   r&   r'   )_as_unicode_convert_input)
r   r   r    r!   r"   r#   r$   r%   r&   r'   s
             J/var/www/rtfcompare/venv/lib/python3.11/site-packages/pypandoc/__init__.pyr   r   7   sB    H **F&&(B:%/(5w#+- - - -    source_filec
                   	 	t          j                    	|dk    rt          j        d           t	          |           r)t          | |          }t          | |d||||||	
  
        S t          | t                    rt          |           } nCt          | t                    rd | D             } n!t          | t                    rd | D             } t          | t                    r	fd| D             } n_t          | t                    r	fd	| D             } n;t          | t                    r&|                                 r| nt          	|           } g }
t          | t                    rB| D ]6}|
                    t          j        t          |                               7|
g k    r| }
n=|
                    t          j        t          |                                |
g k    r| g}
t          |
          st!          d
          t          |
d         |          }t#          |
          dk    r|
d         }
t          |
|d||||||	
  
        S )ac  Converts given `source` from `format` to `to`.

    :param (str, list, pathlib.Path) source_file: If a string, should be either
            an absolute file path, relative file path, or a file pattern (like dir/*.md).
            If a list, should be a list of file paths, file patterns, or pathlib.Path
            objects. In addition, pathlib.Path objects as well as the generators produced by
            pathlib.Path.glob may be specified.

    :param str to: format into which the input should be converted; can be one of
            `pypandoc.get_pandoc_formats()[1]`

    :param str format: the format of the inputs; will be inferred from the source_file with an
            known filename extension; can be one of `pypandoc.get_pandoc_formats()[1]`
            (Default value = None)

    :param list extra_args: extra arguments (list of strings) to be passed to pandoc
            (Default value = ())

    :param str encoding (deprecated): the encoding of the input bytes (Default value = 'utf-8')

    :param str outputfile: output will be written to outputfile or the converted content
            returned if None. The output filename can be specified as a string
            or pathlib.Path object. (Default value = None)

    :param list filters: pandoc filters e.g. filters=['pandoc-citeproc']

    :param bool verify_format: Verify from and to format before converting. Should only be set False when confident of the formats and performance is an issue.
            (Default value = True)

    :param bool sandbox: Run pandoc in pandocs own sandbox mode, limiting IO operations in readers and writers to reading the files specified on the command line. Anyone using pandoc on untrusted user input should use this option. Note: This only does something, on pandoc >= 2.15
            (Default value = False)

    :returns: converted string (unicode) or an empty string if an outputfile was given
    :rtype: unicode

    :raises RuntimeError: if any of the inputs are not valid of if pandoc fails with an error
    :raises OSError: if pandoc is not found; make sure it has been installed and is available at
            path.
    Nr   zThe 'encoding' parameter will be removed in version 1.13. Just remove the parameter, because currently the method does not use it.pathr+   c                 ,    g | ]}t          |          S r   r	   .0xs     r.   
<listcomp>z convert_file.<locals>.<listcomp>       4441tAww444r/   c                 ,    g | ]}t          |          S r   r	   r4   s     r.   r7   z convert_file.<locals>.<listcomp>   r8   r/   c                 \    g | ](}|                                 r|nt          |          )S r   is_absoluter
   r5   r6   r'   s     r.   r7   z convert_file.<locals>.<listcomp>   s4    XXXqAMMOOBqqh1B1BXXXr/   c              3   d   K   | ]*}|                                 r|nt          |          V  +d S Nr;   r=   s     r.   	<genexpr>zconvert_file.<locals>.<genexpr>   s>      XXqAMMOOBqqh1B1BXXXXXXr/   zsource_file is not a valid pathr   r   )osgetcwdr   warning_is_network_path_identify_format_from_pathr-   
isinstancestrr
   listr   r<   extendglob_identify_pathRuntimeErrorlen)r0   r   r    r!   r"   r#   r$   r%   r&   r'   discovered_source_filessingle_sources            `  r.   r   r   b   s   Z 9;; 7  \  	]  	]  	]$$ -+K@@k662*%/(5w#+- - - 	- +s## 5;''	K	&	& 544444	K	+	+ 544444 +t$$ `XXXXKXXX	K	+	+ `XXXXKXXX	K	&	& `%0%<%<%>%>_kkDS^D_D_ !
 +t$$ 4( 	J 	JM#**49S5G5G+H+HIIII"b((&1#&&ty[1A1A'B'BCCC"b(('2m#122 ><==='(?(BFKKF
"##q(("9!"<1662R\!+W$17') ) ) )r/   c                     t          | t                    r| D ]}t          |          s dS dS d}	 t          j                            |           }nD# t          $ r5 t          j                            |                     d                    }Y n Y nxY w|sq	 t          t          j	        |                     dk    }nJ# t          $ r; t          t          j	        |                     d                              dk    }Y n Y nxY w|s	 t          |           }|j        dv rd}nV|j        r|j        r
|j        rd}n>|j        dk    r3|j        r,t          j                            t          |                     }n# t          $ r Y nw xY w|S )NFTr   r   httphttpsfile)rF   rH   rK   rA   r2   existsUnicodeEncodeErrorencoderM   rJ   r   schemenetlocr   AttributeError)r   rO   is_pathresults       r.   rK   rK      s   &$ # 	 	M!-00 uutG'..(( 9 9 9'..w!7!788 	$)F++,,1GG! 	B 	B 	B$)FMM'$:$:;;<<AGGG	D 	f%%F} 111 ;6= ;V[ ;&((V[('..&)9)9:: 	 	 	D	 Ns7   A <BB%B? ?ADDA1E> >
F
Fc                    	 t          |           }|j        dv rdS |j        r|j        r	|j        rdS |j        dk    r3|j        r,t          j                            t          |                     S n# t          $ r Y nw xY wdS )NrQ   TrT   F)r   rX   rY   r2   rA   rU   r   rZ   )r   r\   s     r.   rD   rD      s    &!!=---4] 	4v} 	4 	44]f$$$7>>(6"2"2333   5s   A2 A2 =A2 2
A?>A?
sourcefilec                 v    |p7t           j                            |           d                             d          S )Nr   .)rA   r2   splitextstrip)r^   r    s     r.   rE   rE     s0    ?RW%%j11!4::3???r/   c                 f    |dk    r*	 t          | |          } n# t          t          f$ r Y nw xY w| S )Nr   r"   )r   UnicodeDecodeErrorrV   )r   r"   s     r.   r,   r,   
  sQ    7	!&8<<<FF"$67 	 	 	D	Ms    ..c                 x    t          |           }|rt          | |          }d}nt          | |          } d}| ||fS )Nr2   r*   )rK   rE   r,   )r   r    r"   r2   
input_types        r.   _identify_input_typerh     sN    &!!D +FF;;

VX..
6:%%r/   c                 t    dddd}|                     | |           } | d d         dk    rd| dd          z   } | S )Ndocbookmarkdownlatex)dbkmdtex   restrst)get)fmtformatss     r.   normalize_formatrv      sU     G
 ++c3

C
2A2w&c!""goJr/   c                 "   t          |           } t          |          }| st          d          t                      \  }}t          |           |vr5t          dt          |           dd                    |                    t          |          }t
          j                            |          d         }||vr4|dk    r.|dk    r(t          d|d	d                    |                    |d
v r|st          d|z            |dk    r|t          |t                    r|dd          dk    rt          d          n/t          |t                    r|j        dk    rt          d          ||k    rt          d|z            d}| |fS )NzMissing format!zInvalid input format! Got "z" but expected one of these: z, r   pdf.luazInvalid output format! Got z but expected one of these: odtdocxepubepub3rx   z.Output to %s only works by using a outputfile.z.pdfz;PDF output needs an outputfile with ".pdf" as a fileending.z+PDF output can't contain any extensions: %srl   )rv   rL   r   _get_base_formatjoinrA   r2   ra   rF   rG   r
   suffix)r    r   r#   from_formats
to_formatsbase_to_formatfile_extensions          r.   _validate_formatsr   -  s   f%%F	"		B .,---133L*|33l (((($))L*A*A*ACD D 	D &b))NW%%b))!,Nj((e##f$$l		* 5 5 578 8 	8 @@@@<~M
 
 	
  j#&& 		"##&(("Q   ) 
D)) 	 F**"Q  
 LrQRRR2:r/   c
                    t                       t          j        d           t                       |r)t          j        d           t	          |||          \  }}nt          |          }t          |          }t          j        d           |dk    }
|
st          | t                    r| g}n| }ng }t          |          }t          d|z   g}|
                    d|z              ||z  }|r%|
                    dt          |          z              |rNt          dd	          r*t          j        d
           |
                    d           nt          j        d           |                    |           |Jt          |t                    r|                                }d |D             }|                    |           t           j                                        }t           j                            t           j                            t           j                            t.                              d          }|                    dd          t           j        z   |z   |d<   t4          j        dk    rdnd}t!          j                    }|	r||	k    rt!          j        |	           t          j        d           t=          j        ||
rt<          j         nd t<          j         t<          j         ||          }|	t!          j        |           |j!        1tE          d|j!        d|j#        $                                          |
r*	 tK          | d          } n# tL          tN          f$ r Y nw xY w	 |(                    |
r| nd           \  }}n%# tR          $ r tE          d|j!        z            w xY w	 |dv r|dk    s|*                    d          }n# tL          $ r tE          d          w xY w	 |*                    d          }n# tL          $ r tE          d          w xY w|j!        dk    rtE          d|j!        d|          |r*tW          |          D ]\  }}t          j,        ||           |S )NzEnsuring pandoc path...zVerifying format...zIdentifying input type...r*   z--from=z--to=z	--output=      zAdding sandbox argument...z	--sandboxzLSandbox argument was used, but pandoc version is too low. Ignoring argument.c                 L    g | ]!}|                     d           rd|z   nd|z   "S )ry   z--lua-filter=z	--filter=)endswithr4   s     r.   r7   z"_convert_input.<locals>.<listcomp>  s8    ]]]PQAJJv$6$6K_q  K!O]]]r/   filesPATH win32   r   zRunning pandoc...)stdinstdoutstderrenvcreationflagszPandoc died with exitcode "z" before receiving input: r   rd   z1Pandoc died with exitcode "%s" during conversion.rz   -zPandoc output was not utf-8.z" during conversion: )-r   r   debug_ensure_pandoc_pathr   rv   rF   rG   sorted__pandoc_pathappendensure_pandoc_minimal_versionrC   rI   r   splitrA   environcopyr2   r   dirnamerealpath__file__rs   pathsepsysplatformrB   chdir
subprocessPopenPIPE
returncoderL   r   readr   re   rV   communicateOSErrordecode_classify_pandoc_logginglog)r   r    rg   r   r!   r#   r$   r%   r&   r'   string_input
input_fileargsfnew_env
files_pathcreation_flagold_wdpr   r   levelmsgs                          r.   r-   r-   e  s    
L*+++ "*+++&vr:>>
!&))b!!
L,---)L fc"" 	  JJJJ

##J9v-.DKK"JD 3K#j//1222 k(2.. 	kL5666KK$$$$NijjjKK
 g|,, 	&mmooG]]U\]]]A jooGbgoobg.>.>x.H.HII7SSJkk&"--
:ZGGFO"%,'"9"9JJqMY[[F Fh&&

L$%%%!-7joo4#	% 	% 	%A 
 L lKL<<<KL8==???\
 
 	

  	999FF"$67 	 	 	D	a'Gvv4HH a a a NRSR^_```a
;===*PSBSBS]]7++F ; ; ;9:::;;w'' ; ; ;9:::;
 	|qlFGlllTZTZ[
 
 	

  #26:: 	# 	#JE3Juc"""" Ms6   M   M43M48N "N7;O O59P P)WARNINGc              #     K   fd}|                      d          }|                    d          }t          j        d|          }|}n0||                    d          |                    d                   }|                    d                    |          d          g}|D ]}t          j        d|          }|} ||          d                    |          fV  ||                    d          |                    d                   }|                    d                    |          d          g}|	                    |            ||          d                    |          fV  d S )Nc                 @    ddddd}| |vr	|         }n||          }|S )N(         
   )ERRORr   INFODEBUGr   )pandoc_level	level_mapr   default_levels      r.   get_python_levelz2_classify_pandoc_logging.<locals>.get_python_level  sC      " " "	
 y((m,EEl+Er/   
r   z	\[(.*?)\]r   z[{}] r   )
r   popresearchstartendreplacer    r   r   )	rawr   r   msgsfirstr   r   log_msgsr   s	    `       r.   r   r     s}          99T??DHHQKKEY|U++F ~$V\\!__VZZ]]:;gnn\::B??@H 
 
<--""<00$))H2E2EEEEEv||Avzz!}}<=LGNN<$@$@"EEFH

<
(
($))H*=*=
======r/   c                 8    t          j        d|           d         S )a  
    According to http://johnmacfarlane.net/pandoc/README.html#general-options,
    syntax extensions for markdown can be individually enabled or disabled by
    appending +EXTENSION or -EXTENSION to the format name.
    Return the base format without any extensions.
    z\+|-r   )r   r   )r    s    r.   r   r     s     8GV$$Q''r/   c                     t                       t          j        dk    rdnd} t          j        t
          dgt          j        t          j        t          j        |           }|                                }|d                                         	                    d          }|j
        dk    rt                      S t          j        t
          dgt          j        t          j        t          j        |           }|                                }|d                                         	                    d          }d |D             d	 |D             fS )
zg
    Dynamic preprocessor for Pandoc formats.
    Return 2 lists. "from_formats" and "to_formats".
    r   r   r   z--list-output-formats)r   r   r   r   Fz--list-input-formatsc                 6    g | ]}|                                 S r   rb   r5   r   s     r.   r7   z&get_pandoc_formats.<locals>.<listcomp>;       ###!AGGII###r/   c                 6    g | ]}|                                 S r   r   r   s     r.   r7   z&get_pandoc_formats.<locals>.<listcomp>;       %=%=%=Aaggii%=%=%=r/   )r   r   r   r   r   r   r   r   r   
splitlinesr   get_pandoc_formats_pre_1_18)r   r   commoutin_s        r.   r   r     s*   
 "%,'"9"9JJqM	/0o#	% 	% 	%A ==??D
q'..


%
%e
,
,C|q*,,,	./o#	% 	% 	%A ==??D
q'..


%
%e
,
,C##s###%=%=%=%=%===r/   c                      t                       t          j        dk    rdnd} t          j        t
          dgt          j        t          j        |           }|                                }|d                                         	                    d          }|j
        dk    sd|vrt          dt          |          z            d	                    |d
|                    d                             }|                    d          }t!          j        dd|d                                       d          }t!          j        dd|d
                                       d          }d |D             d |D             fS )zz
    Dynamic preprocessor for Pandoc formats for version < 1.18.
    Return 2 lists. "from_formats" and "to_formats".
    r   r   r   z-h)r   r   r   FzOptions:zBCouldn't call pandoc to get output formats. Output from pandoc:
%s r   zOutput formats: zInput\sformats:\s|\*|\[.*?\]r   ,z
\*|\[.*?\]c                 6    g | ]}|                                 S r   r   r   s     r.   r7   z/get_pandoc_formats_pre_1_18.<locals>.<listcomp>V  r   r/   c                 6    g | ]}|                                 S r   r   r   s     r.   r7   z/get_pandoc_formats_pre_1_18.<locals>.<listcomp>V  r   r/   )r   r   r   r   r   r   r   r   r   r   r   rL   rG   r   indexr   r   sub)r   r   r   	help_texttxtauxr   r   s           r.   r   r   >  sg   
 "%,'"9"9JJqM	o#		% 	% 	%A ==??DQ  ++E22I|qJi77`t99% & & 	&
((9Qyz:::;
<
<C
))&
'
'C
&0"c!f
=
=
C
CC
H
HC
&CF
+
+
1
1#
6
6C##s###%=%=%=%=%===r/   pandoc_pathc                    t           j                                        }t          j        dk    rdnd}dt           j        vrt          j                    |d<   t          j        | dgt          j	        t          j	        ||          }|
                                }|d                                                             d          }|j        dk    st          |          dk    rt          dt!          |          z            t#          j        d	          }|d                                         D ]}|                    |          r|} n|S )
Nr   r   r   HOMEz	--version)r   r   r   r   FzGCouldn't call pandoc to get version information. Output from pandoc:
%sz^\d+(\.\d+){1,}$)rA   r   r   r   r   tempfile
gettempdirr   r   r   r   r   r   r   rM   rL   rG   r   compiler   match)	r   r   r   r   r   	out_linesversion_patterntokversions	            r.   _get_pandoc_versionr   [  sE   jooG"%,'"9"9JJqMRZ"-//	k"o#	% 	% 	%A ==??DQ  ++E22I|qC	NNa// )+.t995 6 6 	6 j!455O|!!##    %% 	GE	 Nr/   c                  b    t           "t                       t          t                    a t           S )a  Gets the Pandoc version if Pandoc is installed.

    It will probe Pandoc for its version, cache it and return that value. If a cached version is
    found, it will return the cached version and stop probing Pandoc
    (unless :func:`clean_version_cache()` is called).

    :raises OSError: if pandoc is not found; make sure it has been installed and is available at
            path.
    )	__versionr   r   r   r   r/   r.   r   r   t  s)     '66	r/   c                  ,    t                       t          S )a  Gets the Pandoc path if Pandoc is installed.

    It will return a path to pandoc which is used by pypandoc.

    This might be a full path or, if pandoc is on PATH, simple `pandoc`. It's guaranteed
    to be callable (i.e. we could get version information from `pandoc --version`).
    If `PYPANDOC_PANDOC` is set and valid, it will return that value. If the environment
    variable is not set, either the full path to the included pandoc or the pandoc in
    `PATH` or a pandoc in some of the more usual (platform specific) install locations
    (whatever is the higher version) will be returned.

    If a cached path is found, it will return the cached path and stop probing Pandoc
    (unless :func:`clean_pandocpath_cache()` is called).

    :raises OSError: if pandoc is not found
    )r   r   r   r/   r.   r   r     s    " r/   majorminorc                     d t                                          d          D             }|d         t          |           k    rdS |d         t          |           k    o|d         t          |          k    S )a,  Check if the used pandoc fulfill a minimal version requirement.

    :param int major: pandoc major version, such as 1 or 2.

    :param int minor: pandoc minor version, such as 10 or 11.

    :returns: True if the installed pandoc is above the minimal version, False otherwise.
    :rtype: bool
    c                 ,    g | ]}t          |          S r   intr4   s     r.   r7   z1ensure_pandoc_minimal_version.<locals>.<listcomp>      ???!s1vv???r/   r`   r   Tr   r   r   r  r   r   r   s      r.   r   r     p     @?13399#>>???GqzCJJt1:U#@
c%jj(@@r/   '  c                     d t                                          d          D             }|d         t          |           k     rdS |d         t          |           k    o|d         t          |          k    S )a,  Check if the used pandoc fulfill a maximal version requirement.

    :param int major: pandoc major version, such as 1 or 2.

    :param int minor: pandoc minor version, such as 10 or 11.

    :returns: True if the installed pandoc is below the maximal version, False otherwise.
    :rtype: bool
    c                 ,    g | ]}t          |          S r   r   r4   s     r.   r7   z1ensure_pandoc_maximal_version.<locals>.<listcomp>  r  r/   r`   r   Tr   r  r  s      r.   ensure_pandoc_maximal_versionr	    r  r/   c                  
   t                       t          \t          j                            t          j                            t          j                            t                              dd          } d| g}t          j	        
                    d          rdnt          j	        }	 |dk    r?|                    t          j                            t          |         d                     n>|                    t          j                            t          |         d                     n#  Y nxY w|dk    r|                    d           |dk    r0|                    t          j                            t          j        dd                     t          j        dd           rd|                    t          j                            d	                     |                    t          j                            d
                     t          j        dd           rd|                    t          j                            d                     |                    t          j                            d                     |                    t          j                            t          j        dd                     |                    t          j                            t          j        dd                     t          j        dd           rt          j        d          g}g d}|D ]}t          j                            |          }d}	 t#          |          }nX# t$          $ rK t          j                            |          r)d                    |          }t+          j        |           Y w xY wd |                    d          D             }t1          |          t1          |          k     r5|                    d           t1          |          t1          |          k     5||k    r|a|}t          .t          j                            d          r't+          j        t5          j        d                     nt          j                            d          r't+          j        t5          j        d                     nEt          j                            d          r&t+          j        t5          j        d                     t+          j        t5          j        d                     t+          j        t5          j        d                     t9          d          d S d S )Nr   pandoclinuxr   z
pandoc.exez~/.bin/pandocScriptsProgramFilesz!${ProgramFiles}\Pandoc\pandoc.exez!${ProgramFiles}\Pandoc\Pandoc.exezProgramFiles(x86)z&${ProgramFiles(x86)}\Pandoc\pandoc.exez&${ProgramFiles(x86)}\Pandoc\Pandoc.exebinPYPANDOC_PANDOC)r   r   r   z0.0.0z/Found {}, but not using it because of an error:c                 ,    g | ]}t          |          S r   r   r4   s     r.   r7   z'_ensure_pandoc_path.<locals>.<listcomp>  s    AAA!s1vvAAAr/   r`   r   z/usr/local/bin/brewz\                    Maybe try:

                        brew install pandoc
                z/usr/bin/apt-getzd                    Maybe try:

                        sudo apt-get install pandoc
                z/usr/bin/yumz\                    Maybe try:

                    sudo yum install pandoc
                zz                See http://johnmacfarlane.net/pandoc/installing.html
                for installation options
            z]                ---------------------------------------------------------------

            zNo pandoc was found: either install pandoc and add it
to your PATH or or call pypandoc.download_pandoc(...) or
install pypandoc wheels with included pandoc.)r   r   rA   r2   r   r   r   r   r   r   
startswithr   r   exec_prefixgetenv
expandvars
expanduserr   	ExceptionrU   r    r   	exceptionr   rM   infotextwrapdedentr   )included_pandocsearch_pathspfcurr_versionr2   version_stringlog_msgr   s           r.   r   r     s    ',,rwrw7G7G7Q7Q'R'R'.: : /2//88JWWcl	W}}##BGLL1Fr1JL$Y$YZZZZ##BGLL1Fr1JH$U$UVVV	D==000 ==S_i V VWWW y.. _##BG$6$67\$]$]^^^##BG$6$67\$]$]^^^y,d33 d##BG$6$67a$b$bccc##BG$6$67a$b$bccc 	BGLL%NNOOOBGLL%JJKKK 9&-- 	:I&7889L yy  	' 	'D 7%%d++D$N	!4T!:!:   7>>$'' . ((.t $W--- BA~';';C'@'@AAAGg,,\!2!222q!!! g,,\!2!222 %% $& w~~344 HO -      
  233 HO -      
 // HO -     
 K )      K )       J K K K{ B ! s    )BD- -D1M''AN<;N<latesturltargetfolderr   delete_installerc                 z   |wt           j                            dd          t           j        z   t           j                            t           j                            |                    z   t           j        d<   	 t                       dS # t          $ r% t          | |||           t                       Y dS w xY w)zTry to install pandoc if it isn't installed.

    Parameters are passed to download_pandoc()

    :raises OSError: if pandoc cannot be installed
    Nr   r   r#  r$  r   r%  )
rA   r   rs   r   r2   abspathr  r   r   r   r'  s       r.   ensure_pandoc_installedr)  "  s     Z^^FB77"*DrwWYW^WiWijvWwWwGxGxx
6
   C%1 ')9	; 	; 	; 	; 	s   ;B +B:9B:c                  
    d a d S r?   )r   r   r/   r.   clean_version_cacher+  A  s    IIIr/   c                  
    d a d S r?   )r   r   r/   r.   clean_pandocpath_cacher-  F  s    MMMr/   )r   r   NNTFN)Nr   r   NNTFN)r   )r   NNTFN)r   )r   )r  )r(   N)NNr"  F)F
__future__r   r   r   typingr   r   r   rA   r   r   r   r   r  rJ   pathlibr
   handlerr   r   pandoc_downloadr   r   	py3compatr   r   r   r   r   
__author____author_email____maintainer____url____version____license____description____python_requires____setup_requires____classifiers____all__rG   boolr   rH   r   rK   rD   rE   anyr,   rh   rv   r   r-   r   r   r   r   r   r   r   r  r   r	  r   r)  r+  r-  r   r   r   r/   r.   <module>rA     s   F F F F F F F F F F                   				 				     



          / / / / / / / / C C C C C C C C Q Q Q Q Q Q Q Q Q Q Q Q Q Q"
% "
5, BBB   ,   W^pt?C(- (- (- (-C (-H (-RU (-!$T/2(-AFxQU~AV(-ko(-(-.3CI.>(-HK(- (- (- (-V aeae[`+/i) i)U4dI#=> i)3 i)uUXZ^U^O_ i)$i)25i)JOPTVY[_P_J`i)x~.i)CGi)VZi)  T	*i) 58i) i) i) i)X&d & & & &P   @# @c @c @ @ @ @s S S    & & &C &# & & & &
 
 
5 5 5p ?A@D+/x x x xv0> 0> 0> 0>f( ( (>H > > > >B>X > > > >:C C    2C    $    (A A A3 AT A A A A"A A A3 A A A A A dK dK dK dKN 26:>(027 c4i 0 ).sDy)9$' .2 =A   >  
  
 	r/   