ó ž­çSc@s²ddlmZddlmZddlmZddlZddlZddlmZdddd gZ d d „Z e d „Z defd „ƒYZ d e fd„ƒYZdS(iÿÿÿÿ(t convert_path(tlog(tDistutilsOptionErrorN(tCommandt config_filet edit_configt option_basetsetopttlocalcCs’|dkrdS|dkr>tjjtjjtjƒdƒS|dkrtjdkr_dpbd}tjjtd |ƒƒSt d |ƒ‚d S( sGet the filename of the distutils, local, global, or per-user config `kind` must be one of "local", "global", or "user" Rs setup.cfgtglobals distutils.cfgtusertposixt.ts~/%spydistutils.cfgs7config_file() type must be 'local', 'global', or 'user'N( tostpathtjointdirnamet distutilst__file__tnamet expanduserRt ValueError(tkindtdot((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyR s    c Cs¬ddlm}tjd|ƒ|jƒ}|j|gƒx+|jƒD]\}}|d kr„tjd||ƒ|j |ƒqI|j |ƒs¶tjd||ƒ|j |ƒnx­|jƒD]Ÿ\}}|d kr6tjd|||ƒ|j ||ƒ|j |ƒsbtjd||ƒ|j |ƒqbqÃtjd||||ƒ|j|||ƒqÃWqIWtjd |ƒ|s¨t|d ƒ} |j| ƒWd QXnd S( sYEdit a configuration file to include `settings` `settings` is a dictionary of dictionaries or ``None`` values, keyed by command/section name. A ``None`` value means to delete the entire section, while a dictionary lists settings to be changed or deleted in that section. A setting of ``None`` means to delete that setting. iÿÿÿÿ(t ConfigParsersReading configuration from %ssDeleting section [%s] from %ssAdding new section [%s] to %ssDeleting %s.%s from %ss#Deleting empty [%s] section from %ssSetting %s.%s to %r in %ss Writing %stwN(tsetuptools.compatRRtdebugtRawConfigParsertreadtitemstNonetinfotremove_sectiont has_sectiont add_sectiont remove_optiontoptionstsettopentwrite( tfilenametsettingstdry_runRtoptstsectionR&toptiontvaluetf((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyR s:      cBs;eZdZd d dgZddgZd „Zd „ZRS(s<Abstract base class for commands that mess with config filess global-configtgs0save options to the site-wide distutils.cfg files user-configtus7save options to the current user's pydistutils.cfg files filename=R1s-configuration file to use (default=setup.cfg)cCsd|_d|_d|_dS(N(R t global_configt user_configR*(tself((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pytinitialize_options]s  cCs¶g}|jr%|jtdƒƒn|jrD|jtdƒƒn|jdk rf|j|jƒn|s‚|jtdƒƒnt|ƒdkr¦td|ƒ‚n|\|_dS(NR R Ris/Must specify only one configuration file option(R4tappendRR5R*R tlenR(R6t filenames((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pytfinalize_optionsbs   (s global-configR2s0save options to the site-wide distutils.cfg file(s user-configR3s7save options to the current user's pydistutils.cfg file(s filename=R1s-configuration file to use (default=setup.cfg)(t__name__t __module__t__doc__t user_optionstboolean_optionsR7R;(((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyRMs   cBsXeZdZdZddddgejZejd gZd„Zd„Zd„Z RS(s#Save command-line options to a files1set an option in setup.cfg or another config filescommand=tcscommand to set an option forsoption=tos option to sets set-value=tssvalue of the optiontremovetrsremove (unset) the valuecCs5tj|ƒd|_d|_d|_d|_dS(N(RR7R tcommandR/t set_valueRD(R6((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyR7‚s     cCsftj|ƒ|jdks+|jdkr:tdƒ‚n|jdkrb|j rbtdƒ‚ndS(Ns%Must specify --command *and* --options$Must specify --set-value or --remove(RR;RFR R/RRGRD(R6((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyR;‰s  cCs=t|jii|j|jjddƒ6|j6|jƒdS(Nt-t_(RR*RGR/treplaceRFR,(R6((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pytruns #(scommand=RAscommand to set an option for(soption=RBs option to set(s set-value=RCsvalue of the option(sremoveREsremove (unset) the value( R<R=R>t descriptionRR?R@R7R;RK(((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyRts   (tdistutils.utilRRRtdistutils.errorsRRt setuptoolsRt__all__RtFalseRRR(((sC/usr/local/lib/python2.7/site-packages/setuptools/command/setopt.pyts    -'