
    c<g^r                        S r SSKrSSKrSSKrSSKrSSKrSSKrSSKrSSKrSSK	r	SSK
r
SSKJr  SSKrSSKrSSKrSSKJrJr  SSKJr  SSKJr  SSKJrJrJrJrJr  \r0 q0 qS rS	\
R@                  S
\!S\
RD                  SS4S jr# " S S\5      r$S r%S r&S r'S r(S r)S r*S r+S r,S r-S r.S r/S r0S r1S r2S r3S r4S  r5S! r6S" r7S# r8S$ r9 " S% S&\R2                  5      r: " S' S(\R4                  5      r; " S) S*\Rx                  Rz                  Rz                  5      r>S+\R~                  S,\R~                  SS4S- jr@ " S. S/\Rx                  R                  R                  5      rBg)0a}  DistUtilsExtra.auto

This provides a setup() method for setuptools and DistUtilsExtra which infers as
many setup() arguments as possible. The idea is that your setup.py only needs
to have the metadata and some tweaks for unusual files/paths, in a "convention
over configuration" paradigm.

This currently supports:

 * Python modules (./*.py, only in root directory)
 * Python packages (all directories with __init__.py)
 * Docbook-XML GNOME help files (help/<language>/{*.xml,*.omf,figures})
 * GtkBuilder and Qt4 user interfaces (*.ui) [installed into
   prefix/share/<projectname>/]
 * D-Bus (*.conf and *.service)
 * GSettings schemas (*.gschema.xml)
 * polkit (*.policy.in)
 * Desktop files (*.desktop.in) [into prefix/share/applications, or
   prefix/share/autostart if they have "autostart" anywhere in the path]
 * KDE4 notifications (*.notifyrc.in)
 * Apport hooks (apport/*) [installed into /usr/share/apport/package-hooks]
 * scripts (all in bin/, and ./<projectname>
 * Auxiliary data files (in data/*) [into prefix/share/<projectname>/]
 * automatic po/POTFILES.in (with all source files which contain _())
 * automatic MANIFEST (everything except swap and backup files, *.pyc, and
   revision control)
 * manpages (*.[0-9])
 * icons (data/icons/<size>/<category>/*.{svg,png})
 * files which should go into /etc (./etc/*, copied verbatim)
 * determining "requires" from import statements in source code
 * determining "provides" from shipped packages and modules

If you follow above conventions, then you don't need any po/POTFILES.in,
./setup.cfg, or ./MANIFEST.in, and just need the project metadata (name,
author, license, etc.) in ./setup.py.
    N)reduce)CommandDistribution)	FileError)__version__)build_extra
build_help
build_i18nbuild_iconspylintc                  *  ^ [        U 5      q[        R                  5       q[        R	                  [        U R                  S/ 5      5      5        [        [        S5        [        [        S5        / SQmS[        S[        4U4S jjn[         Vs1 s H  o!" U5      (       a  M  UiM     snq[        U 5        [        U [        5        [        U [        5        [        U [        5        [        U [        5        [!        U [        5        [#        U [        5        [%        U [        5        ['        U [        5        [)        U [        5        [+        U [        5        [-        U [        5        S[.        R0                  ;  a  [3        U [        5        [4        R6                  " S0 U D6  [        (       ac  [9        S	5        [:        R<                  " 5       n[?        [        5       H/  nURA                  US
S9RC                  US
S9n[9        SU 35        M1     ggs  snf )z7Auto-inferring extension of standard setuptools.setup()scriptssetup.pyz	setup.cfg)etcDistUtilsExtradebianpathreturnc                    > T H6  nU R                  U[        R                  R                  -   5      (       d  M6    g   SU ;   $ )NTz
.egg-info/)
startswithosr   sep)r   
ignore_dirignore_dirss     5/usr/lib/python3/dist-packages/DistUtilsExtra/auto.pyshould_be_ignored setup.<locals>.should_be_ignoredd   s9    %JzBGGKK788 & t##    cleanzGWARNING: the following files are not recognized by DistUtilsExtra.auto:replace)errorsz  N )"src_findsrc_allcopysrcupdatesetgetsrc_marksrc_markglobstrbool
__cmdclass	__modules
__packages
__provides__dbus	__gschema__apport_hooks__data	__scripts
__stdfiles__ui
__manpagessysargv
__requires
setuptoolssetupprintlocalegetpreferredencodingsortedencodedecode)attrsr   fencf_locr   s        @r   r>   r>   Q   s    uoG
,,.C NN3uyyB/01S*k"
 6K$ $ $ 
6c!21!51c
6CueSucuc
5#eS5#
5#eSucucchh5'"u
sWX))+AHHSH3::3y:QEBug,  ) 7s   H#Hunused_functionr   excinfor   c                 b    [         R                  " [        5      nUR                  SXS   5        g )Nzerror removing %s: %s   )logging	getLogger__name__warning)rI   r   rJ   loggers       r   
_log_errorrR      s%    x(F
NN*D!*=r   c                      ^  \ rS rSrSr/ SQrS/rS\S\\	\
R                  4   SS4U 4S	 jjrSS
 jrSS jrSS jrSrU =r$ )clean_build_tree   zclean up build/ directory))zbuild-base=bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))allaz7remove all build output, not just temporary by-productsrW   distkwargsr   Nc                 H   > [         TU ]  " U40 UD6  U R                  5         g )N)super__init__initialize_optionsselfrY   rZ   	__class__s      r   r]   clean_build_tree.__init__   s!    ((!r   c                      SU l         S U l        g )NFrW   
build_baser`   s    r   r^   #clean_build_tree.initialize_options   s    04r   c                 (    U R                  SS5        g )Nbuild)re   re   )set_undefined_optionsrf   s    r   finalize_options!clean_build_tree.finalize_options   s    ""7,HIr   c                 6   U R                   (       d   e[        R                  R                  U R                   5      (       aX  [        R
                  " [        5      R                  SU R                   5        [        R                  " U R                   [        S9  g g )Nzremoving '%s')onerror)re   r   r   existsrM   rN   rO   infoshutilrmtreerR   rf   s    r   runclean_build_tree.run   s[    77>>$//**h',,_dooNMM$//:> +r   rd   r   N)rO   
__module____qualname____firstlineno__descriptionuser_optionsboolean_optionsr   dictr,   typingAnyr]   r^   rk   rs   __static_attributes____classcell__ra   s   @r   rT   rT      sT    -KL gO"\ "T#vzz/5J "t "5J? ?r   rT   c                    U R                  S0 5      nUR                  S[        R                  5        UR                  S[        5        UR                  S[        5        UR                  S[        R                  5        UR                  S[
        5        UR                  S[        5        UR                  S[        5        UR                  S	[        R                  5        g
)z#Default cmdclass for DistUtilsExtracmdclassri   r	   r
   r   installr   sdistr   N)	
setdefaultr   build_help_autobuild_i18n_autor   install_autorT   
sdist_autor   )rE   vs     r   r.   r.      s     	R(ALL+112LL/LL/LL 7 78LLL)LL*+LL*%LL6==)r   c                    SU ;   aB  U S    H8  n[        U5        [        U[        R                  R	                  US5      5        M:     gU R                  S/ 5      n[        US5       H_  n[        R                  R                  U;  d  M#  UR                  [        R                  R                  U5      S   5        [        X5        Ma     g)zDefault modules
py_modules*.pyNr   )
r?   r+   r   r   joinr   src_fileglobr   appendsplitext)rE   r&   modmodsrF   s        r   r/   r/      s     u&C#Jbggll378 ' 	L"-D#v&77;;aKK((+A./  'r   c                    SU ;   a7  U S    H-  n[        U[        R                  R                  US5      5        M/     gU R	                  S/ 5      n[        US5       H  nUR                  S[        R                  R                   35      (       a  M6  [        R                  R                  U5      nUR                  U5        [        U[        R                  R                  US5      5        M     g)zDefault packagespackagesr   N__init__.pydata)
r+   r   r   r   r   r   r   r   dirnamer   )rE   r&   pkgr   rF   s        r   r0   r0      s     U$Cbggll378 %
B/H#}-<<$rww{{m,--ggooa S"'',,sF34 .r   c                    U R                  S/ 5      n/ n[        US5       H>  nS[        U5      R                  5       ;   d  M"  [	        X5        UR                  U5        M@     U(       a  UR                  SU45        / n/ n[        US5       H  n[        U5      R                  5        Vs/ s H  owR                  5       PM     nnSU;  a  MA  U H8  nUR                  S5      (       d  M  [	        X5        UR                  U5          M}     [	        X5        UR                  U5        M     U(       a  UR                  SU45        U(       a  UR                  S	U45        g
g
s  snf )z D-Bus configuration and services
data_filesz*.confz+-//freedesktop//DTD D-BUS Bus Configurationz/etc/dbus-1/system.d/z	*.servicez[D-BUS Service]zUser=zshare/dbus-1/system-serviceszshare/dbus-1/servicesN)	r   r   openreadr*   r   	readlinesstripr   )	rE   r&   r   	dbus_confrF   session_servicesystem_servicelineliness	            r   r2   r2      s:    	r*A I#x(8DGLLNJSQ ) 	)956ON#{+*.q'*;*;*=>*=$*=>E)Dw'' %%a(	  S""1% , 	0.AB	)?;<  ?s   +E"c                     U R                  S/ 5      nSn[        X5      nU(       a+  [        X5        [        US5        UR                  SU45        gg)zInstall GSettings schema filesr   z*.gschema.xmlz*gschemas.compiledzshare/glib-2.0/schemas/N)r   r   r+   r   )rE   r&   r   schema_globschemass        r   r3   r3     sR     	r*A!K3,GS&S./	+W56 r   c                 
   U R                  S/ 5      n/ nSU ;   d   S5       e[        US5       H7  nUR                  S5      (       d  M  UR                  U5        [	        X5        M9     U(       a  UR                  SU45        gg)zApport hooksr   name/You need to set the "name" property in setup.pyr   zapport/zshare/apport/package-hooks/N)r   r   r   r   r*   )rE   r&   r   hooksrF   s        r   r4   r4     s|    r*A EU?MMM?#v&<<	""LLOS ' 	/78 r   c                 :   U R                  S/ 5      nSU ;   d   S5       eUR                  5        H  nUR                  S5      (       d  M  UR                  S5      (       a  M3  UR                  S5      (       a  MK  UR                  S5      (       a  Mc  [        R
                  R                  U5      (       dV  UR                  [        R
                  R                  SU S   [        R
                  R                  US	S
 5      5      U/45        [        X5        M     g
)zInstall auxiliary data files.

This installs everything from data/ except data/icons/ and *.in files (which
are handled differently) into prefix/share/<projectname>/.
r   r   r   zdata/zdata/icons/z.desktop.inz.notifyrc.inshare   N)r   r%   r   endswithr   r   islinkr   r   r   r*   )rE   r&   r   rF   s       r   r5   r5   !  s     	r*AU?MMM?XXZLL!!LL//JJ}--JJ~..77>>!$$WW\\'5="''//!AB%:PQTUSVW S r   c                 &   SU ;   d   S5       e/ nUR                  5        H  nUR                  S5      (       d
  X0S   :X  d  M#  [        R                  " U5      n[        R
                  " UR                  5      (       a@  UR                  [        R                  -  (       a  UR                  U5        [        X5        M  [        R                  " UR                  5      (       d  M  [        X5        M     U(       a  U R                  S/ 5      nXR-  ngg)zInstall scripts.

This picks executable scripts in bin/*, and an executable ./<projectname>.
Other scripts have to be added manually; this is to avoid automatically
installing test suites, build scripts, etc.
r   r   zbin/r   N)r%   r   r   lstatstatS_ISREGst_modeS_IEXECr   r*   S_ISLNKr   )rE   r&   r   rF   str   s         r   r6   r6   :  s     U?MMM?GXXZ<<1f#5!B||BJJ''BJJ,Eq! bjj))   Y+	 r   c                    [        US5        [        US5        [        US5        [        US5        [        US5        [        US5        / n[        US5      R                  [        US5      5       H?  n[        R                  R
                  U;  d  M#  UR                  U5        [        X5        MA     U(       aS  S	U ;   d   S
5       eU R                  S/ 5      R                  [        R                  R                  SSU S	   5      U45        gg)zIInstall/mark standard files.

This covers COPYING, AUTHORS, README, etc.
zCOPYING*zLICENSE*AUTHORSMANIFEST.inMANIFESTTODOzREADME*NEWSr   r   r   r   docN)
r+   r   unionr   r   r   r   r*   r   r   )rE   r&   readmerF   s       r   r7   r7   S  s    
 j!j!i m$j!f F#y)//S&0IJ77;;aMM!S K Q QQr*11WW\\'5%-8&A	
 r   c                    / n[        US5       H  n[        US5      nUR                  5       nUSUR                  5       -   -  nUSUR                  5       -   -  nUR                  5         SU;   d  SU;   d  Mi  [	        X5        UR                  U5        M     U(       aR  SU ;   d   S5       eU R                  S/ 5      R                  [        R                  R                  S	U S   5      U45        g
g
)z Install GtkBuilder/Qt *.ui files*.uirb   
s
   <interfaces   <ui version=r   r   r   r   N)
r   r   readlinecloser*   r   r   r   r   r   )rE   r&   uirF   fd
firstliness         r   r8   r8   m  s     
B#v&!T][[]
ebkkm++
ebkkm++


J&/Z*GSIIaL ' 
Q QQr*11WW\\'5=126	
 
r   c           	         0 n[        US5       H}  n[        U5       nU H`  nUR                  S5      (       a  M  UR                  S5      (       a/  [        X5        UR	                  US   / 5      R                  U5          O   SSS5        M     U R	                  S/ 5      nUR                  5        H:  u  pxUR                  [        R                  R                  SSSU 35      U45        M<     g! , (       d  f       M  = f)	zInstall manpagesz*.[0123456789]z."z.TH Nr   r   man)
r   r   r   r*   r   r   itemsr   r   r   )	rE   r&   mansrF   r   r   r   sectionfiless	            r   r9   r9     s     D#/0!W??4((??6**S$OOAbE2.55a8  W 1 	r*A**,	"'',,wWI?GH ' Ws   A'C11
D 	c                    XS   ;   a  g[        U5       H  nX2S   ;   d  M    g    [        U5      n[        US5      (       a  UR                  (       d  gUR                  US   ;   a  gSUR                  ;   =(       da    SUR                  ;   =(       dK    UR                  R                  [        R                  R                  [        R                  5      5      (       + $ ! [         ab     U (       a  [        U  SU 35      n Ne ! [         a'    [        R                  R                  SU S35          g[        [        4 a      gf = f[        [        4 a     gf = f)	zACheck if given Python module is not included in Python or locallyprovidesF.zERROR: Python module z not found
__file__zdist-packageszsite-packages)_module_parents
__import__ImportErrorr:   stderrwriteRuntimeError
ValueErrorhasattrr   rO   r   r   r   r   )
cur_modulemodulerE   mr   s        r   __external_modr     sB   
 z""V$j!! % ( 3
##3<< ||uZ(( 	3<<' 	Ecll*	E||&&rwwr{{'CDD7  	 J<q!9: 	JJ4VHLIJj) 	 	 *%  sA   C   
E+DD-E2E5EEEEEc           	         [         R                  R                  [         R                  R                  [         R                  R	                  U5      S5      5      (       a<  SR                  UR                  [         R                  R                  5      SS 5      nOSn [        US5       nUR                  5       R                  S5      n[        R                  " XQ5      nSSS5        [        R                  " W5       GH1  n[        U[        R                  5      (       a^  UR                   HN  nUR                   (       d  M  [#        X8R                   U5      (       d  M3  U R%                  UR                   5        MP     [        U[        R&                  5      (       d  M  UR(                  S:X  a3  UR                   H!  n	U R%                  SU	R                    35        M#     M  UR(                  (       d  M  [#        X7R(                  U5      (       d  GM  U R%                  UR(                  5        GM4     g! , (       d  f       GN\= f! [*         a9  n
[,        R.                  R1                  S	U S
[3        U
5       S35         Sn
A
gSn
A
ff = f)zsAdd all imported modules from file to imports set.

This filters out modules which are shipped with Python itself.
r   r   Nr   r   zUTF-8zgi.repositorygi.repository.zWARNING: syntax errors in z: 
)r   r   ro   r   r   splitr   r   r   rD   astparsewalk
isinstanceImportnamesr   r   add
ImportFromr   SyntaxErrorr:   r   r   r,   )importsfilerE   r   rF   file_contenttreenodealiasr   es              r   __add_importsr     s   
 
ww~~bggll277??4#8-HIIXXdjj5cr:;
 
J$668??73L99\0D  HHTND$

++!ZZEzzznZU&S&SEJJ/ ( $//;;/1 $

nTYYK$@A !+ [[[^JU%S%SKK, #	    J

5dV2c!fXRHIIJsP   I +6H6!AI I !<I !AI 7I  I 6
I I 
J/JJc              #      #    U R                  S5      nUR                  5         U(       a-  SR                  U5      v   UR                  5         U(       a  M,  gg7f)z$Iterate over all parents of a moduler   N)r   popr   )r   	hierarchys     r   r   r     s?      		#IMMO
hhy!! )s   AAAc                     [        5       nU  HW  nUR                  S5      (       a  UR                  U5        M,  [        U5       H  nX0;   d  M
    MD     UR                  U5        MY     [	        U5      $ )zFilter out modules which are already covered by a parent module

E. g. this transforms ['os.path', 'os', 'foo.bar.baz', 'foo.bar'] to
['os', 'foo.bar'].
r   )r(   r   r   r   rB   )modulesresultr   ps       r   __filter_namespacer     sc     UF<<())JJqM #A| $ JJqM  &>r   c                    SU ;   a  g[        5       nU H  nUS:X  a  M  UR                  S[        R                  R                   35      (       a  M>  [        R                  R                  U5      S   nUS:X  aD   [        U5       nUR                  5       nSSS5        WR                  S5      (       a  SU;  a  M  OUS	:w  a  M  [        X#U 5        M     [        U5      U S'   g! , (       d  f       NT= f! [        [        4 a     M  f = f)
z*Determine requires (if not set explicitly)requiresNr   r   rL    z#!python.py)r(   r   r   r   r   r   r   r   UnicodeDecodeErrorIOErrorr   r   )rE   r$   r   sextrF   r   s          r   r<   r<     s     UeG 
?<<$rww{{m,--ggq!!$"9!W::<D  ??4((HD,@ -AE\g%(! $ +73E* W&0 s0   ;C6C%C6%
C3	/C63C66D
	D
c                    SU ;   a  g[        U R                  S/ 5      5      nU R                  S/ 5       H<  nUR                  UR                  [        R
                  R                  S5      5        M>     [        U5      U S'   g)z*Determine provides (if not set explicitly)r   Nr   r   r   )listr)   r   r    r   r   r   r   )rE   unused_src_allr   r   s       r   r1   r1   #  sg     UEIIlB/0HYYz2&		"''++s34 '*84E*r   c                 X   [        5       n[        U R                  S/ 5      5      nU R                  S/ 5       H  u  p4UR                  U5        M     [        R                  " S5       GH=  u  pSnUR                  S5      (       a  USS nUS:X  a  SnUR                  S5      (       d1  UR                  [        R                  R                  S5      S	   S
;   a  Ms  UR                  [        R                  R                  SS5      5      (       a  M  U H  n[        R                  R                  U5      S   nUR                  S5      (       d  US;   a  MC  US:X  a  US:X  d  US:X  a  MW  [        R                  R                  XV5      nX;  d  M}  UR                  U5        M     GM@     U$ )zgFind source files.

This ignores all source files which are explicitly specified as setup()
arguments.
r   r   r   z./   Nr  rL   r   )ri   testtestsr   icons).pyc~.mopoz.poPOTFILES.in)r(   r)   r'   r   r   r   r   r   r   r   r   r   )	rE   r&   explicit_r   rootrF   r  r   s	            r   r#   r#   4  s[    %C 599Y+,HIIlB/ 0 ''#,??4  8D3;D??34::bggkk1#=a#@ E
 $

 ??277<<899A''""1%a(C||C  C+?$?t|m1C77<<(D#  '4 Jr   c                     [        5       nU  HO  n[        R                  " [        R                  R	                  U5      U5      (       d  M>  UR                  U5        MQ     U$ )z*Return set of files which match fnameglob.)r(   fnmatchr   r   basenamer   )r&   	fnameglobr   rF   s       r   r   r   ^  sG     UF??277++A.	::JJqM  Mr   c                 &    U R                  U5        g)zRemove path from src.N)remove)r&   r   s     r   r*   r*   h  s     JJtr   c                     U R                  5        H1  n[        R                  " X!5      (       d  M   U R                  U5        M3     g)z/Remove all paths from src which match pathglob.N)r%   r  r  )r&   pathglobrF   s      r   r+   r+   n  s.     XXZ??1''JJqM r   c                   (   ^  \ rS rSrU 4S jrSrU =r$ )r   i{  c                    > [         TU ]  5         U R                  5        H$  nUS    H  n[        R	                  U5        M     M&     g NrL   )r\   rk   get_data_filesr&   r  )r`   data_setfilepathra   s      r   rk    build_help_auto.finalize_options|  s=     " ++-H$QK

8$ ( .r   r"   )rO   rv   rw   rx   rk   r   r   r   s   @r   r   r   {  s    % %r   r   c                   4   ^  \ rS rSrU 4S jrU 4S jrSrU =r$ )r   i  c                   > [         TU ]  5         / n[        [        S5       H$  n[	        [        U5        UR                  U5        M&     U(       aX   [        U R                  5      nUR                  [        R                  R                  SSS5      U45        [        U5      U l        / n/ n/ n[        [        S5       H=  n[	        [        U5        SU;   a  UR                  U5        M,  UR                  U5        M?     [        [        S5       H$  n[	        [        U5        UR                  U5        M&      [        U R                  5      nU(       a  UR                  SU45        U(       a  UR                  S	U45        U(       a.  UR                  S
U R                  R                  5        3U45        [        U5      U l         [	        [        [        R                  R                  U R                   U R                  R                  5        S35      5        g ! [         a    / n GNf = f! [         a    / n Nf = f! ["         a     g f = f)N*.policy.inr   zpolkit-1actions*.desktop.in	autostart*.notifyrc.inzshare/applicationszshare/autostartzshare/kde4/apps/z.pot)r\   rk   r   r&   r*   r   eval	xml_files	TypeErrorr   r   r   reprdesktop_filesdistributionget_namepo_dirKeyError)	r`   policy_filesrF   xfr3  autostart_filesnotify_filesdfra   s	           r   rk    build_i18n_auto.finalize_options  s    "
 c=1AS!" 2 $..) IIrww||GZC\RS!"XDN c>2AS!a&&q)$$Q' 3 c?3AS!" 4	d(()B II+];<II(/:;II)$*;*;*D*D*F)GH,WX!"X	RWW\\$++$2C2C2L2L2N1Ot/TUA  (  	B	  		s7   H 9H/ AI H,+H,/H>=H>
IIc                 &  > Sn/ n [         R                  R                  [         R                  R                  SS5      5      (       Gd  0 n[	        [
        S5      nUR                  [	        [
        S5      5        UR                  [	        [
        S5      5        UR                  [	        [
        S5      5        [	        [
        S5       HH  n[        US	5      R                  5       nS
U;   d  SU;   d  M+  SU;   d  M3  SX5'   UR                  U5        MJ     [        S U R                  R                  [
        5       GH  nU S3n[         R                  " U[         R                  5      (       d  M5  [         R                  R                  U5      S   S:X  d  M]  [         R                  R                  U5      (       a  M  [        US	5      R!                  5       nUR#                  S5      (       d  M  SU;   d  M  [         R$                  " [         R                  R'                  U5      U5        UR                  U5        UR)                  U5        GM     U(       a  [         R                  R+                  S5      (       d  [         R,                  " S5        [        SS5      n	U	R/                  S5        [1        U5       H*  nU	R/                  UR3                  US5      U-    S35        M,     U	R5                  5         Sn[6        T
U ]q  5         U H  n[         R:                  " U5        M     U(       a.  [         R:                  " S5         [         R<                  " S5        gg! U H  n[         R:                  " U5        M     f = f! [>         a     gf = f)zBuild a default POTFILES.inFr  r  r   r,  r.  r*  r   r   s   <interface>
s   <interface s
   class="Gtkz[type: gettext/glade]c                 *    U R                  US   5      $ r#  )r   )xys     r   <lambda>%build_i18n_auto.run.<locals>.<lambda>  s    1r   r  rL   r  s   #!s   pythonzpo/POTFILES.inwz[encoding: UTF-8]
r   TN) r   r   ro   r   r   r$   r'   r   r   r   r   r4  r   accessX_OKr   r   r   symlinkr  r   isdirmkdirr   rB   r)   r   r\   rs   unlinkrmdirOSError)r`   auto_potfiles_inexe_symlinksprefixr   rF   contentsf_pyr   potfiles_inra   s             r   rs   build_i18n_auto.run  s    !0	77>>"'',,t]"CDD$Wf5\'>BC\'?CD\'=AB%gv6A#At}113H(H4(8R'83$;			! 7  .0A0A0L0LgA  S9D		!RWW--GG,,Q/2b8 "t 4 4#At}557??511i46GJJrww'7'7':DA!IIdO(//5 77==.."&'7"=K%%&;<#E]#))VZZ2->-B,C2*FG +%%''+$GKM!		! " II&'  "		! "  sJ   C)M 4M <A0M 0$M "M >.M 0M 8DM N !N 
NN)r3  r0  )rO   rv   rw   rx   rk   rs   r   r   r   s   @r   r   r     s    1f= =r   r   c                   t   ^  \ rS rSrSr/ SQr/ SQrS\S\\	\
R                  4   SS4U 4S	 jjrSS
 jrSrU =r$ )r   i  a  Default values for the 'sdist' command.

Replace the manually maintained MANIFEST.in file by providing information
about what the source tarball created using the 'sdist' command should
contain in normal cases.

It prevents the 'build' directory, version control related files, as well as
compiled Python and gettext files and temporary files from being included in
the source tarball.

It's possible for subclasses to extend the 'filter_prefix' and
'filter_suffix' properties.
)ri   z.gitz.svnz.CVSz.bzrz.shelf)r  r  r  z.swprY   rZ   r   Nc                    > [         TU ]  " U40 UD6  Xl        U R                  R	                  S[
        R                  45        g )N	add_extra)r\   r]   r4  sub_commandsr   r   rV  r_   s      r   r]   sdist_auto.__init__  s:    ((   +z/C/C!DEr   c                    [         R                  R                  S5      (       a  g U R                  R	                  [         R                  R                  SU R                  R                  5       5      5        [        R                  " S5      R                  S5       H  n[        U5      nUR                  5       (       du  X R                  R                  ;   d\  [        [!        UR"                  U R                  5      5      (       d.  [        [!        UR$                  U R&                  5      5      (       a  M  U R                  R	                  U5        M     g )Nr   rY   r   *)r   r   ro   filter_prefixr   r   r4  r5  pathlibPathrglobr,   is_dirfilelistr   anymapr   r   filter_suffixr`   r   rF   s      r   rV  sdist_auto.add_extra  s    77>>-((!!"'',,vt7H7H7Q7Q7S"TULL%++C0DD	A+++s1<<););<==s1::t'9'9:;;MM  # 1r   )r4  ru   )rO   rv   rw   rx   __doc__r[  rc  r   r|   r,   r}   r~   r]   rV  r   r   r   s   @r   r   r     sJ     HM0MF\ FT#vzz/5J Ft F
$ $r   r   r&   dstc                 B   [         R                  " [        5      nU R                  5       (       d  [	        SU  S35      eUR                  5       (       d"  UR                  SU5        UR                  SSS9  [        U R                  5       5       H  nXR                  -  nUR                  5       (       a  [        X45        M3  UR                  5       (       aE  UR                  5       nUR                  SXE5         UR                  SS9  UR!                  U5        M  UR                  SX45         UR                  SS9  ["        R$                  " X45        M     g
! [         a  n[	        SU S	U 35      UeS
nAff = f! [         a  n[	        SU S	U 35      UeS
nAff = f)aM  Copy an entire directory tree 'src' to a new location 'dst'.

Both 'src' and 'dst' must be directory names.  If 'src' is not a
directory, raise FileError.  If 'dst' does not exist, it is
created.  The end result of the copy is that every file in 'src'
is copied to 'dst', and directories under 'src' are recursively
copied to 'dst'.
zcannot copy tree 'z': not a directoryzcreating %sT)parentsexist_okzlinking %s -> %s
missing_okzcould not delete 'z': Nzcopying %s -> %s)rM   rN   rO   r_  r   ro   rp   rI  rB   iterdirr   	copy_tree
is_symlinkreadlinkrJ  rL  
symlink_torq   r%   )r&   rg  logsrc_pathdst_path	link_desterrors          r   rn  rn  -  sv    

H
%C::<<,SE1CDEE::<<$		$	.3;;=)&??h)  "" ))+IHH'=V40 	* HH'<V40 KK++ *  V"4XJc% IJPUUV  V"4XJc% IJPUUVs0   :E/E=
E:#E55E:=
FFFc                   <   ^  \ rS rSrU 4S jrSS jrSS jrSrU =r$ )r   iW  c                    > U R                   (       a3  U R                  S5        U R                  S5        U R                  S5        U R                  5         U R                  5         [        TU ]  5         g )Nr	   r
   r   )
skip_buildrun_command_install_files_from_etc"_install_data_and_scripts_symlinksr\   rs   )r`   ra   s    r   rs   install_auto.runX  sW     ??\*\*]+$$&//1r   c           	      $   [         R                  R                  S5      (       GaY  [        R                  " S5      R                  S5       H  nUR                  5       (       a  M  [        U5      nUR                  S[         R                  R                   35      (       a$  [         R                  R                  U5      (       d  M|   [         R                  " [         R                  R                  U R                  U5      5        M     U R                  (       d  SU l        [        [        R                  " S5      [        R                  " [         R                  R                  U R                  S5      5      5        g g ! [         a     GMC  f = f)Nr   rZ  r  )r   r   rH  r\  r]  r^  r_  r,   r   r   r   rJ  r   r  rL  rn  rd  s      r   r{  $install_auto._install_files_from_etcc  s    77==  U+11#6;;==I||c"''++$788q@Q@QIIbggll499a89 7 99	gll5)7<<TYYPU8V+WX    s   >F  
FFc           
         [         R                  " S5       GH)  u  pnU GH  n[         R                  R                  X5      n[         R                  R	                  U5      (       d  MI  UR                  S5      (       d  UR                  S5      (       d  Mw  UR                  S5      (       a  U R                  n[         R                  R                  U[         R                  R                  R                  UR                  [         R                  R                  5      SS  5      5      nGOhUR                  S5      (       a  [         R                  R                  U R                  SSS	5      n[         R                  R                  U[         R                  R                  R                  UR                  [         R                  R                  5      S
S  5      5      nO[         R                  R                  U R                  SU R                  R                  5       5      n[         R                  R                  U[         R                  R                  R                  UR                  [         R                  R                  5      SS  5      5      n[         R                  R                  U5      n[         R                  R                  U5      (       d  [         R                  " U5        [        R                   " U5      R#                  SS9  [         R$                  " [         R&                  " U5      U5        GM     GM,     g )Nr   z./bin/z./data/z./binr  z./data/iconsr   r  hicolor   Trk  )r   r   r   r   r   r   install_scriptsr   r   install_datar4  r5  r   rH  makedirsr\  r]  rJ  rG  rp  )r`   r   r  r   rF   
target_dirdestds           r   r|  /install_auto._install_data_and_scripts_symlinksu  s    ggclNDUGGLL)ww~~a((<<))Q\\)-D-D||G,,%)%9%9
!ww||&(8(89Mab9Q(R  n55%'WW\\ --w&
  "ww||&(8(89Mab9Q(R  &(WW\\ --w8I8I8R8R8T&
  "ww||&(8(89Mab9Q(R  -A77==++ALL&--->JJr{{1~t4=  +r   )r  ru   )	rO   rv   rw   rx   rs   r{  r|  r   r   r   s   @r   r   r   W  s    	Y$ 5  5r   r   )Crf  r   r  r@   rM   r   r\  rq   r   r:   r}   	functoolsr   r=   setuptools.command.installsetuptools.command.sdistr   r   setuptools.errorsr   r   r   __pkgversionDistUtilsExtra.commandr   r	   r
   r   r   r&   r$   r>   r~   r,   TuplerR   rT   r.   r/   r0   r2   r3   r4   r5   r6   r7   r8   r9   r   r   r   r   r<   r1   r#   r   r*   r+   r   r   commandr   r   r]  rn  r   r   r"   r   r   <module>r     s  #Z     	    
    !  , ' 6   	
4 x>

 ># > >QU >
?w ?@*!"5$ =F	7922
4
*I(,^JB*4<	5"'T%j++ %qj++ qr'$##))// '$^',7<< ',gll ',t ',T>5:%%--55 >5r   