o
    Ke5  ã                   @   s"   d Z ddlmZ G dd„ dƒZdS )aÚ  
Python Markdown

A Python implementation of John Gruber's Markdown.

Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/

Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (http://www.freewisdom.org).
Currently maintained by Waylan Limberg (https://github.com/waylan),
Dmitry Shachnev (https://github.com/mitya57) and Isaac Muse (https://github.com/facelessuser).

Copyright 2007-2018 The Python Markdown Project (v. 1.7 and later)
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
Copyright 2004 Manfred Stienstra (the original version)

License: BSD (see LICENSE.md for details).
é   )ÚparseBoolValuec                   @   sN   e Zd ZdZi Zdd„ Zddd„Zdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ ZdS )Ú	Extensionz( Base class for extensions to subclass. c                 K   s   |   |¡ dS )z( Initiate Extension and set up configs. N)Ú
setConfigs)ÚselfÚkwargs© r   úLD:\Projects\ConvertPro\env\Lib\site-packages\markdown/extensions/__init__.pyÚ__init__%   s   zExtension.__init__Ú c                 C   s   || j v r| j | d S |S )z8 Return a setting for the given key or an empty string. é    ©Úconfig)r   ÚkeyÚdefaultr   r   r   Ú	getConfig)   s   
zExtension.getConfigc                    ó   ‡ fdd„ˆ j  ¡ D ƒS )z( Return all configs settings as a dict. c                    s   i | ]}|ˆ   |¡“qS r   )r   ©Ú.0r   ©r   r   r   Ú
<dictcomp>2   s    z(Extension.getConfigs.<locals>.<dictcomp>©r   Úkeysr   r   r   r   Ú
getConfigs0   ó   zExtension.getConfigsc                    r   )z7 Return all `config` descriptions as a list of tuples. c                    s   g | ]}|ˆ j | d  f‘qS )é   r   r   r   r   r   Ú
<listcomp>6   s    z+Extension.getConfigInfo.<locals>.<listcomp>r   r   r   r   r   ÚgetConfigInfo4   r   zExtension.getConfigInfoc                 C   sL   t | j| d tƒrt|ƒ}| j| d du rt|dd�}|| j| d< dS )z: Set a `config` setting for `key` with the given `value`. r   NT)Zpreserve_none)Ú
isinstancer   Úboolr   )r   r   Úvaluer   r   r   Ú	setConfig8   s
   zExtension.setConfigc                 C   s0   t |dƒr	| ¡ }|D ]
\}}|  ||¡ qdS )z@ Set multiple `config` settings given a dict or list of tuples. ÚitemsN)Úhasattrr!   r    )r   r!   r   r   r   r   r   r   @   s
   
ÿzExtension.setConfigsc                 C   s   t d| jj| jjf ƒ‚)zÒ
        Add the various processors and patterns to the Markdown Instance.

        This method must be overridden by every extension.

        Keyword arguments:

        * md: The Markdown instance.

        z8Extension "%s.%s" must define an "extendMarkdown"method.)ÚNotImplementedErrorÚ	__class__Ú
__module__Ú__name__)r   Úmdr   r   r   ÚextendMarkdownH   s
   ÿÿzExtension.extendMarkdownN)r
   )r&   r%   Ú__qualname__Ú__doc__r   r	   r   r   r   r    r   r(   r   r   r   r   r      s    	
r   N)r*   Úutilr   r   r   r   r   r   Ú<module>   s    