3
]^r              
   @   s  d 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Zddl	Z	ddl
Z
ddlZddlmZmZmZ ddlmZ ejjdZdejkrejd ZedkrejjeZnedkrdZnejjedZdd	 Zd
d Zdd Zdd Ze Zde  ZG dd de Z!dd Z"dd Z#dd Z$dd Z%dd Z&dd Z'dd  Z(ej)e*e	j+e&e$e'd!d" d#d" e(d$	Z,d%d& Z-dAd(d)Z.d*d+ Z/d,d- Z0ej1d.d/ Z2d0d1 Z3G d2d3 d3ej4Z4G d4d5 d5ej5Z5G d6d7 d7ej6Z7G d8d9 d9Z8G d:d; d;Z9G d<d= d=e8e9Z:d>e
j;dfd?d@Z<dS )BzIutilities for Pylint configuration :

* pylintrc
* pylint.d (PYLINTHOME)
    N)AnyDictTuple)utils~Z
PYLINTHOMEz	.pylint.dc             C   s&   | j tjd} tjjtd| |df S )N_z%s%s%sz.stats)replaceosseppathjoinPYLINT_HOME)	base_nameZrecurs r   //tmp/pip-build-8app2_gc/pylint/pylint/config.py_get_pdata_path>   s    r   c             C   sD   t | d}y t|d}tj|S Q R X W n tk
r>   i S X d S )N   rb)r   openpickleload	Exception)base	data_filestreamr   r   r   load_resultsC   s    
r   c             C   s   t jjtsByt jt W n& tk
r@   tdt tjd Y nX t	|d}y&t
|d}tj| | W d Q R X W n< ttfk
r } ztd||f tjd W Y d d }~X nX d S )NzUnable to create directory %s)filer   wbzUnable to create file %s: %s)r	   r   existsr   mkdirOSErrorprintsysstderrr   r   r   dumpIOError)resultsr   r   r   exr   r   r   save_resultsL   s    
r(   c              C   s`  t jjdrt jjdS t jjdr0t jjdS t jjdrt jjt j } xxt jjt jj| drt jjt jj| d} t jjt jj| drt jj| dS t jjt jj| drNt jj| dS qNW dt jkrt jjt jd rt jd }nHt jjd}|dkr
d}n,t jj|d}t jj|s6t jj|dd}t jj|s\t jjd	rXd	}nd
}|S )zKsearch the pylint rc file and return its path if it find it, else None
    pylintrcz	.pylintrcz__init__.pyz..PYLINTRCr   /rootz.configz/etc/pylintrcN)r   r+   )	r	   r   r   abspathisfilegetcwdr   environ
expanduser)curdirr)   Z	user_homer   r   r   find_pylintrcZ   s2    
r2   af  
The following environment variables are used:
    * PYLINTHOME
    Path to the directory where persistent data for the run will be stored. If
not found, it defaults to ~/.pylint.d/ or .pylint.d (in the current working
directory).
    * PYLINTRC
    Path to the configuration file. See the documentation for the method used
to search for configuration file.
c               @   s   e Zd ZdZdS )UnsupportedActionzBraised by set_option when it doesn't know what to do for an actionN)__name__
__module____qualname____doc__r   r   r   r   r3      s   r3   c             C   s<   t j|}x,|D ]$}|| krd}tj|||| f qW |S )Nz-option %s: invalid value: %r, should be in %s)r   
_check_csvoptparseOptionValueError)choicesnamevaluevaluesZ	csv_valuemsgr   r   r   _multiple_choice_validator   s    

r@   c             C   s$   || kr d}t j|||| f |S )Nz-option %s: invalid value: %r, should be in %s)r9   r:   )r;   r<   r=   r?   r   r   r   _choice_validator   s    rA   c             C   s
   t j|S )N)r   r8   )r   r<   r=   r   r   r   _csv_validator   s    rB   c             C   s   t |dr|S tj|S )Npattern)hasattrrecompile)r   r<   r=   r   r   r   _regexp_validator   s    
rG   c                s    fddt  |D S )Nc                s   g | ]}t  |qS r   )rG   ).0val)r   r<   r   r   
<listcomp>   s    z)_regexp_csv_validator.<locals>.<listcomp>)rB   )r   r<   r=   r   )r   r<   r   _regexp_csv_validator   s    rK   c             C   sD   t |trt|S |dkrdS |d	kr*dS d}tj|| |f d S )
NyyesTnnoFz<option %s: invalid yn value %r, should be in (y, yes, n, no))rL   rM   )rN   rO   )
isinstanceintboolr9   r:   )optr   r=   r?   r   r   r   _yn_validator   s    
rT   c             C   s   |sd}t j|tj|S )Nzindent string can't be empty.)r9   r:   r   _unquote)rS   r   r=   r?   r   r   r   _non_empty_string_validator   s    
rV   c             C   s   t | d ||S )Nr;   )rA   )rS   r<   r=   r   r   r   <lambda>   s    rW   c             C   s   t | d ||S )Nr;   )r@   )rS   r<   r=   r   r   r   rW      s   )	stringrQ   regexp
regexp_csvcsvynchoicemultiple_choicenon_empty_stringc             C   st   | t krtd|  yt |  |||S  tk
rn   yt |  |S  tk
rh   tjd||| f Y nX Y nX d S )NzUnsupported type "%s"z"%s value (%r) should be of type %s)
VALIDATORSr   	TypeErrorr9   r:   )Zopttypeoptdictoptionr=   r   r   r   _call_validator   s    rd    c             C   s0   y|d }W n t k
r    | S X t|||| S )zreturn a validated value for an option according to its type

    optional argument name is only used for error message formatting
    type)KeyErrorrd   )r=   rb   r<   _typer   r   r   	_validate   s
    ri   c                s    fdd| j D S )Nc                s0   g | ](}t |d dpd kr|jtjk	r|qS )levelr   )getattrhelpr9   SUPPRESS_HELP)rH   rc   )outputlevelr   r   rJ      s   z"_level_options.<locals>.<listcomp>)option_list)grouprn   r   )rn   r   _level_options   s    
rq   c             C   s   | j dks| j r|jS |jd dd }y| j jj| }W n tk
rT   d}Y n2X |j|}|j||}t	|j
||}tj||}|tjks| r| j}|jj| jt|S )zPatch OptionParser.expand_default with custom behaviour

    This will handle defaults to avoid overriding values in the
    configuration file.
    Nr      )parserdefault_tagrl   
_long_optsoptions_manager_all_optionsrg   get_option_defoption_attrnamerk   configr   Z_format_option_valuer9   
NO_DEFAULTNO_DEFAULT_VALUEr   str)selfrc   optnameproviderr=   rb   r   r   r   _expand_default   s    

r   c              c   s(   t j} ztt j_d V  W d | t j_X d S )N)r9   HelpFormatterr   expand_default)Zorig_defaultr   r   r   _patch_optparse  s
    
r   c             C   s   t | j||S )N)r@   r;   )rS   r<   r=   r   r   r   #_multiple_choices_validating_option  s    r   c               @   s   e Zd Zejjd Zejjddg ZejejjZe	ed< e
ed< eed< eed< eed< eed< d	d
 Zdd Zeejjd< dd ZdS )OptionrY   rZ   r[   r\   r^   r_   hiderj   c             O   s0   t jj| f|| t| dr,| jr,t j| _d S )Nr   )r9   r   __init__rD   r   rm   rl   )r~   optsattrsr   r   r   r   .  s    zOption.__init__c             C   sv   | j dkrV| jd kr tjd| t| jttfsrtjdtt | jjdd  | n| jd k	rrtjd| j  | d S )	Nr]   r^   z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)'r   z#must not supply choices for type %r)r]   r^   )	rf   r;   r9   OptionErrorrP   tuplelistr}   split)r~   r   r   r   _check_choice3  s    


zOption._check_choicerr   c             C   sL   | j ||}| jdkr4t|| j}|r4|j| |}| j| j| j||||S )Nnamed)convert_valuerf   rk   destupdatetake_actionaction)r~   rS   r=   r>   rs   Zexistentr   r   r   processG  s    

zOption.processN)rY   rZ   r[   r\   r^   r_   )r4   r5   r6   r9   r   TYPESATTRScopyTYPE_CHECKERrG   rK   rB   rT   r   rV   r   r   CHECK_METHODSr   r   r   r   r   r     s&        r   c               @   s&   e Zd Zdd ZdddZdd ZdS )	OptionParserc             O   s    t jj| f|dti| d S )Noption_class)r9   r   r   r   )r~   r   argskwargsr   r   r   r   W  s    zOptionParser.__init__Nc             C   s   |d kr| j }t|dd}|j|  g }|j|jd |j  | jrd|jtjj	| | |jd xB| j
D ]8}|j|krl|jst||rl|j|j| |jd qlW |j  dj|d d S )Noutput_levelr   Options
re   r   )	formatterrk   store_option_stringsappendformat_headingindentro   r9   OptionContainerformat_option_helpoption_groupsrj   descriptionrq   format_helpdedentr   )r~   r   rn   resultrp   r   r   r   r   Z  s"    


zOptionParser.format_option_helpc             C   s   || j krtj||S )zDisable abbreviations.)	_long_optr9   BadOptionError)r~   rS   r   r   r   _match_long_opto  s    

zOptionParser._match_long_opt)N)r4   r5   r6   r   r   r   r   r   r   r   r   V  s   
r   c               @   st   e Zd ZdddZdd Zdd	 Zd
d ZdddZedd Z	edd Z
edd Zedd Zedd ZdS )_ManHelpFormatterr      O   c             C   s   t jj| |||| d S )N)r9   r   r   )r~   indent_incrementmax_help_positionwidthshort_firstr   r   r   r   x  s    z_ManHelpFormatter.__init__c             C   s   d|j   S )Nz.SH %s
)upper)r~   headingr   r   r   r     s    z _ManHelpFormatter.format_headingc             C   s   |S )Nr   )r~   r   r   r   r   format_description  s    z$_ManHelpFormatter.format_descriptionc             C   s|   y
|j }W n tk
r(   | j|}Y nX |jrl| j|}djdd |j D }|jdd}|jdd}nd}d	||f S )
N c             S   s   g | ]}|j  qS r   )strip)rH   lr   r   r   rJ     s    z3_ManHelpFormatter.format_option.<locals>.<listcomp>\z\\z	[current:z	[default:re   z.IP "%s"
%s
)option_stringsAttributeErrorformat_option_stringsrl   r   r   
splitlinesr   )r~   rc   	optstring	help_texthelp_stringr   r   r   format_option  s    

z_ManHelpFormatter.format_optionr   c             C   sr   d}y|j  }W n tk
r,   |j }Y nX | j||j}t|drT| j||j}d| j|||| j	||f S )Nre   	long_descz%s
%s
%s
%s)
Z_get_prog_namer   get_prog_nameformat_short_descriptionr   rD   format_long_descriptionr   format_titleformat_synopsis)r~   	optparserpkginfosectionr   pgm
short_descr   r   r   format_head  s    

z_ManHelpFormatter.format_headc             C   s$   dt j d d  }d| ||| f S )Nz%d-%02d-%02d   z.TH %s %s "%s" %s)time	localtime)r   r   dater   r   r   r     s    z_ManHelpFormatter.format_titlec             C   s   d| |j  f S )Nz.SH NAME
.B %s
\- %s
)r   )r   r   r   r   r   r     s    z*_ManHelpFormatter.format_short_descriptionc             C   s   d|  S )Nz6.SH SYNOPSIS
.B  %s
[
.I OPTIONS
] [
.I <arguments>
]
r   )r   r   r   r   r     s    
z!_ManHelpFormatter.format_synopsisc             C   sR   dj dd |j D }|jdd}|j j| rB|t| d  }d| |j f S )Nr   c             s   s   | ]}|j  V  qd S )N)lstrip)rH   liner   r   r   	<genexpr>  s    z<_ManHelpFormatter.format_long_description.<locals>.<genexpr>z
.
z

z.SH DESCRIPTION
.B %s
%s
)r   r   r   lower
startswithlenr   )r   r   r   r   r   r     s    z)_ManHelpFormatter.format_long_descriptionc             C   s<   dt | d| j| j| j| jf }t| dr8|d| j 7 }|S )Nz}.SH SEE ALSO
/usr/share/doc/pythonX.Y-%s/

.SH BUGS
Please report bugs on the project's mailing list:
%s

.SH AUTHOR
%s <%s>
Zdebian_name	copyrightz
.SH COPYRIGHT
%s
)rk   modnameZmailinglistauthorauthor_emailrD   r   )r   tailr   r   r   format_tail  s    


z_ManHelpFormatter.format_tailN)r   r   r   r   )r   )r4   r5   r6   r   r   r   r   r   staticmethodr   r   r   r   r   r   r   r   r   r   w  s   


r   c               @   s   e Zd ZdZd+ddZd,ddZd-d	d
Zdd Zdd Zdd Z	dd Z
dd Zdf dfddZd.ddZdd Zd/ddZdd Zd d! Zd"d# Zd0d$d%Zd1d'd(Zd2d)d*ZdS )3OptionsManagerMixInzLHandle configuration from both a configuration file and command line optionsNc             C   s@   || _ | j||d g | _tj | _i | _i | _i | _d| _	d S )N)versionr   )
config_filereset_parsersoptions_providerscollectionsOrderedDictrw   _short_options_nocallback_options	_mygroups	_maxlevel)r~   usager   r   r   r   r   r     s    
zOptionsManagerMixIn.__init__re   c             C   s:   t jdd| _tt||d| _| | j_t| jjj	| _
d S )N#;)inline_comment_prefixes)r   r   )r   r   )configparserConfigParsercfgfile_parserr   r   cmdline_parserrv   setr   r   _optik_option_attrs)r~   r   r   r   r   r   r     s
    
z!OptionsManagerMixIn.reset_parsersTc       
         s   |j dkstdxDtt| jD ]&}|j | j| j kr"| jj|| P q"W | jj| dd |jD }t|df }|r|r| j	|j
j |j|| n$x"|D ]\}}| j|| j|| qW x<|D ]4\ } j   fdd|jD }	| j	 ||	| qW dS )zregister an options providerr   z!provider's priority can't be >= 0c             S   s   g | ]}d |d kr|qS )rp   r   r   )rH   rc   r   r   r   rJ     s    zAOptionsManagerMixIn.register_options_provider.<locals>.<listcomp>r   c                s(   g | ] }|d  j ddj  kr|qS )r   rp   re   )getr   )rH   rc   )gnamer   r   rJ   &  s   N)priorityAssertionErrorranger   r   insertr   optionsrk   add_option_groupr<   r   r7   add_optik_optionr   )
r~   r   	own_groupiZnon_group_spec_optionsgroupsrS   rb   ZgdocZgoptionsr   )r   r   register_options_provider  s*    

z-OptionsManagerMixIn.register_options_providerc             C   s   || j kr| j | }nRtj| j|j d}| jj| |j|_|| j |< |dkrh|| jjkrh| jj	| x |D ]\}}| j
|||| qnW d S )N)titleDEFAULT)r   r9   OptionGroupr   
capitalizer  rj   r   	_sectionsadd_sectionr  )r~   Z
group_namer   r  r   rp   rS   rb   r   r   r   r  ,  s    

z$OptionsManagerMixIn.add_option_groupc             C   s@   | j |||\}}|j||}|| j|< t| j|jp6d| _d S )Nr   )optik_option
add_optionrw   maxr   rj   )r~   r   ZoptikcontainerrS   rb   r   rc   r   r   r   r  A  s    
z$OptionsManagerMixIn.add_optik_optionc             C   s   t j |}d|kr|| j|< nd|d< | j|d< d|krpd|krj|jddk	rj|d dkrj|d  d7  < |d= d	t| g}d
|kr|| j|d
 < |jd|d
   |d
= x(t|j D ]}|| j	kr|j
| qW ||fS )zjget our personal option definition and return a suitable form for
        use with optik/optparse
        r   callbackdefaultrl   N
store_truestore_falsez [current: %default]z--short-)r  r  )r   r   cb_set_provider_optionr   r}   r   r   r   keysr   pop)r~   r   rS   rb   r   keyr   r   r   r  G  s(    


z OptionsManagerMixIn.optik_optionc             C   sF   |j dr|dd }n| j|dd  }|dkr6d}| j|| dS )z!optik callback for option settingz--rr   Nr   )r   r   global_set_option)r~   rc   rS   r=   rs   r   r   r   r  f  s    
z*OptionsManagerMixIn.cb_set_provider_optionc             C   s   | j | j|| dS )z)set option on the correct option providerN)rw   
set_option)r~   rS   r=   r   r   r   r  s  s    z%OptionsManagerMixIn.global_set_optionc             C   s   i }g }xv| j D ]l}xf|j D ]Z\}}|dkr4|j}||kr>qdd |D }|sRq||krd|j| |j|g }	|	|7 }	qW qW |ptj}d}
x:|D ]2}|
rtd|d tj	||j
 t||  d}
qW dS )zrwrite a configuration file according to the current configuration
        into the given stream or stdout
        Nc             S   s6   g | ].\}}}|j d dk	r|j d r|||fqS )rf   NZ
deprecated)r   )rH   rN   dvr   r   r   rJ     s   z7OptionsManagerMixIn.generate_config.<locals>.<listcomp>Fr   )r   T)r   options_by_sectionr<   r   
setdefaultr"   stdoutr!   r   Zformat_sectionr   sorted)r~   r   Zskipsectionsencodingr   sectionsr   r   r  Z
alloptionsZprintedr   r   r   generate_configw  s0    


z#OptionsManagerMixIn.generate_configr   c             C   s2   t  " t| j|||ptj| jd W d Q R X d S )N)r   rj   )r   _generate_manpager   r"   r"  r   )r~   r   r   r   r   r   r   generate_manpage  s    z$OptionsManagerMixIn.generate_manpagec             C   s   x| j D ]}|j  qW dS )z-initialize configuration using default valuesN)r   load_defaults)r~   r   r   r   r   load_provider_defaults  s    z*OptionsManagerMixIn.load_provider_defaultsc                s  d}x| j krdjdg| d }| jkr0P |f fdd	}ddjd	g|  }d
||d} jd } j| j|| | j||ff7  _|d7 }qW |dkr j}|dk	rtj	j
|}tj	j|stdj||otj	j|}	|	rX j}
tj|ddd}|
j| W dQ R X x<t|
jj D ]*\}}|j  r*|r*||
j|j < q*W |sbdS |	r|djtj	j|}nd}t|tjd dS )zrread the configuration file but do not load it (i.e. dispatching
        values to each options provider)
        r   r  longz-helpc                s   t  j| tjd d S )Nr   )r!   rl   r"   exit)rc   rS   rI   prj   )r~   r   r   helpfunc  s    z6OptionsManagerMixIn.read_config_file.<locals>.helpfuncz%s verbose help.r   Zmorer  )r   r  rl   r   Nz#The config file {:s} doesn't exist!rZ	utf_8_sig)r$  zUsing config file {}z1No config file found, using default configuration)r   )r   r   rw   r   r  r   r  r   r	   r   r0   r   r%   formatr   ior   	read_filer   r  itemsisupperr   r,   r!   r"   r#   )r~   r   verboseZ	helplevelrS   r.  Zhelpmsgrb   r   Zuse_config_filers   fpsectr>   r?   r   )r~   r   read_config_file  s@    

z$OptionsManagerMixIn.read_config_filec             C   sb   | j }xV|j D ]J}xD|j|D ]6\}}y| j|| W q  ttjfk
rT   w Y q X q W qW dS )zddispatch values previously read from a configuration file to each
        options provider)
        N)r   r%  r3  r  rg   r9   r   )r~   rs   r   rc   r=   r   r   r   load_config_file  s    z$OptionsManagerMixIn.load_config_filec             K   s
   | j |S )z4override configuration according to given parameters)load_configuration_from_config)r~   r   r   r   r   load_configuration  s    z&OptionsManagerMixIn.load_configurationc             C   s<   x6|j  D ]*\}}|jdd}| j| }|j|| q
W d S )Nr   r  )r3  r   rw   r  )r~   rz   rS   Z	opt_valuer   r   r   r   r:    s    
z2OptionsManagerMixIn.load_configuration_from_configc             C   s   t   |dkr tjdd }nt|}| jj|d\}}xJ| jD ]@}|j}x4|jj	 D ]&}t
||d}|dkrrqXt||| qXW qBW |S Q R X dS )ziOverride configuration according to command line parameters

        return additional arguments
        Nr   )r   )r   r"   argvr   r   
parse_argsr   rz   __dict__r  rk   setattr)r~   r   r  r   rz   attrr=   r   r   r   load_command_line_configuration  s    z3OptionsManagerMixIn.load_command_line_configurationr   c             C   s:   t j| j|j |d}||_t| j|| _| jj| dS )z,add a dummy option section for help purpose )r	  r   N)r9   r  r   r  rj   r  r   r  )r~   r	  r   rj   rp   r   r   r   add_help_section  s
    z$OptionsManagerMixIn.add_help_sectionc          	   C   s&   || j j_t  | j j S Q R X dS )z.return the usage string for available options N)r   r   r   r   r   )r~   rj   r   r   r   rl     s    
zOptionsManagerMixIn.help)NN)re   N)T)r   N)NN)N)r   )r   )r4   r5   r6   r7   r   r   r  r  r  r  r  r  r&  r(  r*  r8  r9  r;  r:  rA  rB  rl   r   r   r   r   r     s&   



 !


1

	r   c               @   sf   e Zd ZdZdZdZf ZdZdd Zdd Z	dd
dZ
dd ZdddZdd Zdd ZdddZd	S )OptionsProviderMixInz-Mixin to provide options to an OptionsManagerr   r  r   c             C   s   t j | _| j  d S )N)r9   Valuesrz   r)  )r~   r   r   r   r     s    
zOptionsProviderMixIn.__init__c             C   sV   xP| j D ]F\}}|jd}|dkr|dkr4| j|}|jd}| j|||| qW dS )z,initialize the provider using default valuesr   r  Nr  )r  r   rx   r  )r~   rS   rb   r   r  r   r   r   r)    s    


z"OptionsProviderMixIn.load_defaultsNc             C   s&   |dkr| j |}|jd|jddS )z-get the config attribute corresponding to optNr   r  r   )rx   r   r   )r~   rS   rb   r   r   r   ry   *  s    
z$OptionsProviderMixIn.option_attrnamec             C   s   t | j| j|dS )z*get the current value for the given optionN)rk   rz   ry   )r~   rS   r   r   r   option_value0  s    z!OptionsProviderMixIn.option_valuec             C   s\  |dkr| j |}|dk	r&t|||}|dkr:|jdd}|dkr\t| j| j|||  n|dkr|t| j| j||d n|dkrt| j| j||d n|d	kr2| j||}t| j|d}|dkrt|tt	fr|}n|dk	rg }|j
| t| j|| n,t|t	r&t| j|||f  n
|j
| n&|d
krP|d
 d||d nt|dS )z?method called to set an option (registered in the options list)Nr   storer  countr   r  r   r   r  )r  rG  )rx   ri   r   r?  rz   ry   rk   rP   r   r   r   r3   )r~   r   r=   r   rb   Z_listr   r   r   r  4  s8    




zOptionsProviderMixIn.set_optionc             C   sH   | j s
tx"| j D ]}|d |kr|d S qW tjd|| jf |dS )z7return the dictionary defining an option given its namer   r   zno such option %s in section %rN)r  r   r9   r   r<   )r~   rS   rc   r   r   r   rx   U  s    
z#OptionsProviderMixIn.get_option_defc             c   s   i }x6| j D ],\}}|j|jdg j||| j|f qW d|krTd|jdfV  x&t|j D ]\}}|j |fV  qbW dS )ztreturn an iterator on options grouped by section

        (section, [list of (optname, optdict, optvalue)])
        rp   N)	r  r!  r   r   rE  r  r#  r3  r   )r~   r%  r   rb   r   r  r   r   r   r   _  s    z'OptionsProviderMixIn.options_by_sectionc             c   s6   |d kr| j }x"|D ]\}}||| j|fV  qW d S )N)r  rE  )r~   r  r   rb   r   r   r   options_and_valuesn  s    z'OptionsProviderMixIn.options_and_valuesr   )N)NN)N)r4   r5   r6   r7   r   r<   r  rj   r   r)  ry   rE  r  rx   r   rH  r   r   r   r   rC    s   

!
rC  c               @   s   e Zd ZdZdd ZdS )ConfigurationMixInz]basic mixin for simple configurations which don't need the
    manager / providers model
    c             O   s   |s|j dd tj| f|| tj|  t| dd sg | _xT| jD ]J\}}y|d j df}W n tk
rx   wFY nX || jkrF| jj	| qFW | j
| dd d S )Nr   re   r   rp   F)r  )r!  r   r   rC  rk   r   r  r   rg   r   r  )r~   r   r   r   rb   Zgdefr   r   r   r   z  s    

zConfigurationMixIn.__init__N)r4   r5   r6   r7   r   r   r   r   r   rI  u  s   rI  r   c             C   sP   t  }||_| |_t|j| |||d t| j||d t|j||d d S )N)r   )r   r   rs   r!   r   r   r   )r   r   r   r   rj   r   r   r   r   r'    s    r'  )re   )=r7   r   r   
contextlibr   r1  r9   r	   r   rE   r"   r   typingr   r   r   Zpylintr   r   r0   Z	USER_HOMEr/   r   dirnamer   r   r   r(   r2   r*   globalsZENV_HELPr   r3   r@   rA   rB   rG   rK   rT   rV   rU   rQ   rF   r`   rd   ri   rq   r   contextmanagerr   r   r   r   r   r   r   rC  rI  r"  r'  r   r   r   r   <module>#   sx   

	"	
	
:!{  "c