
b-Qc           @   s  d  Z  d d k Z d d k Z d d k Z d d k l Z d d k l Z l Z y# d d k	 l
 Z
 l Z d   Z Wn2 e j
 o& d d k l Z l Z d   Z n Xd d	 k l Z d d
 k l Z d d k l Z l Z l Z d d k l Z d d k l Z d d k l Z l Z d d k l Z d   Z  d   Z! d Z" d e f d     YZ# e$ i% d i&    Z' d   Z( d   Z) d   Z* h d e+ 6d e, 6Z- d   Z. d   Z/ d   Z0 d d d  d! g Z1 d" d" e2 d# d$  Z3 d S(%   s6   setuptools.command.bdist_egg

Build .egg distributionsiN(   t   Command(   t   remove_treet   mkpath(   t   get_patht   get_python_versionc           C   s
   t  d  S(   Nt   purelib(   R   (    (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   _get_purelib   s    (   t   get_python_libR   c           C   s
   t  t  S(   N(   R   t   False(    (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR      s    (   t   log(   t   DistutilsSetupError(   t   get_build_platformt   Distributiont   ensure_directory(   t
   EntryPoint(   t   CodeType(   t
   basestringt   next(   t   Libraryc         C   sI   d |  j o t  i i |   d }  n |  i d  o |  d  }  n |  S(   Nt   .i    t   modulei(   t   ost   patht   splitextt   endswith(   t   filename(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   strip_module   s
    c      
   C   sO   t  | d  } | i d i d d d d |  d d d	 d
 g   | i   d  S(   Nt   ws   
s   def __bootstrap__():s-      global __bootstrap__, __loader__, __file__s!      import sys, pkg_resources, imps:      __file__ = pkg_resources.resource_filename(__name__,%r)s3      __loader__ = None; del __bootstrap__, __loader__s&      imp.load_dynamic(__name__,__file__)s   __bootstrap__()t    (   t   opent   writet   joint   close(   t   resourcet   pyfilet   f(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt
   write_stub"   s    s7   __import__("pkg_resources").declare_namespace(__name__)t	   bdist_eggc           B   s   e  Z d  Z d d d d e   f d  d	 d
 d d f d! d" g Z d	 d d g Z d   Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(#   s   create an "egg" distributions
   bdist-dir=t   bs1   temporary directory for creating the distributions
   plat-name=t   ps;   platform name to embed in generated filenames (default: %s)s   exclude-source-filess+   remove all .py files from the generated eggs	   keep-tempt   ks/   keep the pseudo-installation tree around after s!   creating the distribution archives	   dist-dir=t   ds-   directory to put final built distributions ins
   skip-builds2   skip rebuilding everything (for testing/debugging)c         C   sC   d  |  _ d  |  _ d |  _ d  |  _ d |  _ d  |  _ d  |  _ d  S(   Ni    (   t   Nonet	   bdist_dirt	   plat_namet	   keep_tempt   dist_dirt
   skip_buildt
   egg_outputt   exclude_source_files(   t   self(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   initialize_options]   s    						c         C   s  |  i  d  } |  _ | i |  _ |  i d  j o. |  i  d  i } t i i | d  |  _ n |  i	 d  j o t
   |  _	 n |  i d d  |  i d  j o` t d  d  | i | i t   |  i i   o |  i	  i   } t i i |  i | d  |  _ n d  S(   Nt   egg_infot   bdistt   eggR.   s   .egg(   s   dist_dirs   dist_dir(   t   get_finalized_commandt   ei_cmdR4   R+   R*   t
   bdist_baseR   R   R   R,   R   t   set_undefined_optionsR0   R   t   egg_namet   egg_versionR   t   distributiont   has_ext_modulesR.   (   R2   R8   R9   t   basename(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   finalize_optionsg   s    "c         C   sh  |  i  |  i d  _ t i i t i i t     } |  i i	 g  } |  i _	 x | D] } t
 | t  o t |  d j o t i i | d  or t i i | d  } t i i |  } | | j p | i | t i  o" | t |  d | d f } qqn |  i i	 i |  qV Wz1 t i d |  i   |  i d d d d d  Wd  | |  i _	 Xd  S(	   Nt   installi   i    i   s   installing package data to %st   install_datat   forcet   root(   R+   R7   t   install_libR   R   t   normcaset   realpathR   R=   t
   data_filest
   isinstancet   tuplet   lent   isabst
   startswitht   sept   appendR	   t   infot   call_commandR*   (   R2   t   site_packagest   oldt   itemRG   t
   normalized(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   do_install_data   s"    ! #*c         C   s
   |  i  g S(   N(   R0   (   R2   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   get_outputs   s    c         K   sm   x! t  D] } | i | |  i  q W| i d |  i  | i d |  i  |  i | |  } |  i |  | S(   s8   Invoke reinitialized command `cmdname` with keyword argsR/   t   dry_run(   t   INSTALL_DIRECTORY_ATTRSt
   setdefaultR+   R/   RX   t   reinitialize_commandt   run_command(   R2   t   cmdnamet   kwt   dirnamet   cmd(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRQ      s     c         C   s  |  i  d  t i d |  i  |  i d  } | i } d  | _ |  i i   o |  i	 o |  i  d  n |  i
 d d d } | | _ |  i   \ } } g  |  _ g  } x t |  D] \ } } t i i |  \ }	 }
 t i i |  i t |	  d  } |  i i |  t i d	 |  |  i p t t i i |  |  n | i |  | i t i d
  | | <q W| i |  i    | o | i |  n |  i i o |  i   n |  i } t i i | d  } |  i |  |  i i oC t i i | d  } t i d |  |  i
 d d | d d n |  i  |  t i i | d  } | oi t i d |  |  i pJ t! |  t" | d  } | i# d i |   | i# d  | i$   qnD t i i% |  o0 t i d |  |  i p t i& |  qn t' t i i | d  |  i(    t i i) t i i |  i* d   o t i+ d  n |  i, o |  i-   n t. |  i/ | d |  i0 d |  i d |  i1   |  i2 p t3 |  i d |  i n t4 |  i d g   i d t5   |  i/ f  d  S(   NR4   s   installing library code to %sRA   t
   build_clibRE   t   warn_diri    s   .pys   creating stub loader for %st   /s   EGG-INFOt   scriptss   installing scripts to %st   install_scriptst   install_dirt   no_epi   s   native_libs.txts
   writing %st   wts   
s   removing %ss   depends.txtsx   WARNING: 'depends.txt' will not be used by setuptools 0.6!
Use the install_requires/extras_require setup() args instead.t   verboseRX   t   modet
   dist_filesR%   (6   R\   R	   RP   R+   R7   RD   R*   R=   t   has_c_librariesR/   RQ   t   get_ext_outputst   stubst	   enumerateR   R   R   R   R   RO   RX   R$   R?   t   replaceRN   t   extendt   make_init_filest   byte_compileRH   RV   R   Rd   t   copy_metadata_toR   R   R   R    t   isfilet   unlinkt   write_safety_flagt   zip_safet   existsR4   t   warnR1   t   zap_pyfilest   make_zipfileR0   Ri   t
   gen_headerR-   R   t   getattrR   (   R2   t   instcmdt   old_rootR`   t   all_outputst   ext_outputst
   to_compileR'   t   ext_nameR   t   extR"   t   archive_rootR4   t
   script_dirt   native_libst	   libs_file(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   run   sz    	 			 "
	


%

c         C   s   t  i d  xw t |  i  D]f \ } } } xT | D]L } | i d  o6 t i i | |  } t  i d |  t i	 |  q3 q3 Wq Wd  S(   Ns+   Removing .py files from temporary directorys   .pys   Deleting %s(
   R	   RP   t   walk_eggR+   R   R   R   R   t   debugRv   (   R2   t   baset   dirst   filest   nameR   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR{     s      c         C   sG   t  |  i d d   } | d  j	 o | St i d  t |  i |  i  S(   NRx   s4   zip_safe flag not set; analyzing archive contents...(   R~   R=   R*   R	   Rz   t   analyze_eggR+   Rn   (   R2   t   safe(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRx   
  s
    c   	      C   s%  g  } xt  |  i  D]\ } } } | |  i j o q n x | D] } | i d  o d | j o | t |  i  d i t i d  } |  i i |  oj t	 i
 d |  t i i | d  } |  i p* t | d  } | i t  | i   n | i |  qn PqC qC Wg  | (q W| S(   s%   Create missing package __init__ filess   .pys   __init__.pyi   R   s#   Creating missing __init__.py for %sR   (   R   R+   R   RK   Rp   R   RN   R=   t   has_contents_forR	   Rz   R   R   RX   R   R   t   NS_PKG_STUBR    RO   (	   R2   t
   init_filesR   R   R   R   t   pkgR   R#   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRr     s*      &
 	c   
      C   s)  t  i |  i i p d  } | i d h   i d  } | d  j o d S| i p
 | i o t d | f   n t	 i
 d  } | i } d i | i  } | i d } t i i |  i  } d	 t   } |  i pO t t i i |  i  d
 |  i t |  i d  }	 |	 i |  |	 i   n d S(   NR   s   setuptools.installationt   eggsecutableR   sG   eggsecutable entry point (%r) cannot have 'extras' or refer to a modulei   R   i    sH  #!/bin/sh
if [ `basename $0` = "%(basename)s" ]
then exec python%(pyver)s -c "import sys, os; sys.path.insert(0, os.path.abspath('$0')); from %(pkg)s import %(base)s; sys.exit(%(full)s())" "$@"
else
  echo $0 is not the correct name for this egg file.
  echo Please rename it back to %(basename)s and try again.
  exec false
fi
RX   t   a(   R   t	   parse_mapR=   t   entry_pointst   getR*   t   attrst   extrasR
   t   syst   versiont   module_nameR   R   R   R?   R0   t   localsRX   R   R_   R   R   R    (
   R2   t   epmt   ept   pyverR   t   fullR   R?   t   headerR#   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR}   *  s*    	

"c         C   s   t  i i |  i  } t  i i | d  } xd |  i i i D]S } | i |  o= t  i i | | t	 |   } t
 |  |  i | |  q: q: Wd S(   s*   Copy metadata (egg info) to the target_dirR   N(   R   R   t   normpathR4   R   R8   t   filelistR   RM   RK   R   t	   copy_file(   R2   t
   target_dirt   norm_egg_infot   prefixR   t   target(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRt   S  s     
c      	   C   s  g  } g  } h d |  i  6} x t i |  i   D] \ } } } xJ | D]B } t i i |  d i   t j o | i | | |  qE qE Wx3 | D]+ } | | | d | t i i | |  <q Wq/ W|  i	 i
   o |  i d  } x | i D] }	 t |	 t  o q n | i |	 i  }
 | i |
  } t i i |  i d  p: t i i t i i |  i  |   o | i |  qq q Wn | | f S(   sA   Get a list of relative paths to C extensions in the output distroR   i   Rc   t	   build_exts   dl-(   R+   R   t   walkR   R   t   lowert   NATIVE_EXTENSIONSRO   R   R=   R>   R7   t
   extensionsRI   R   t   get_ext_fullnameR   t   get_ext_filenameR?   RM   Ry   (   R2   R   R   t   pathsR   R   R   R   t	   build_cmdR   t   fullname(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRm   _  s0      # -
 %(   s
   bdist-dir=R&   s1   temporary directory for creating the distributionN(   s   exclude-source-filesNs+   remove all .py files from the generated egg(   s	   dist-dir=R)   s-   directory to put final built distributions in(   s
   skip-buildNs2   skip rebuilding everything (for testing/debugging)(   t   __name__t
   __module__t   descriptionR   R*   t   user_optionst   boolean_optionsR3   R@   RV   RW   RQ   R   R{   Rx   Rr   R}   Rt   Rm   (    (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR%   4   s8    
   		
					R					)	s   .dll .so .dylib .pydc         c   sj   t  i |   } t |  \ } } } d | j o | i d  n | | | f Vx | D] } | VqW Wd S(   s@   Walk an unpacked egg's contents, skipping the metadata directorys   EGG-INFON(   R   R   R   t   remove(   t   egg_dirt   walkerR   R   R   t   bdf(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR     s     c   	   	   C   s   xD t  i   D]6 \ } } t i i t i i |  d |   o | Sq Wt   p t St } x t	 |   D] \ } } } xu | D]m } | i
 d  p | i
 d  o q q | i
 d  p | i
 d  o  t |  | | |  o | } q q Wqi W| S(   Ns   EGG-INFOs   .pys   .pyws   .pycs   .pyo(   t   safety_flagst   itemsR   R   Ry   R   t   can_scanR   t   TrueR   R   t   scan_module(	   R   Rn   t   flagt   fnR   R   R   R   R   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR     s      %	
     (c         C   s   x t  i   D] \ } } t i i |  |  } t i i |  o5 | d  j p t |  | j o t i |  q q | d  j	 o= t |  | j o* t	 | d  } | i
 d  | i   q q Wd  S(   NRh   s   
(   R   R   R   R   R   Ry   R*   t   boolRv   R   R   R    (   R   R   R   R   R#   (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyRw     s         s   zip-safes   not-zip-safec         C   s  t  i i | |  } | d  | j o t S| t |   d i t  i d  } | | o d p d t  i i |  d } t i	 d j  o
 d } n d } t
 | d	  } | i |  t i |  }	 | i   t }
 t i t |	   } x> d
 d g D]0 } | | j o t i d | |  t }
 q q Wd | j o` x] d d d d d d d d d d d g D]0 } | | j o t i d | |  t }
 q`q`Wn d | j oL d | j o? d | j o2 t i d  d j o t i d |  t }
 qn |
 S(   s;   Check whether module possibly uses unsafe-for-zipfile stuffii   R   R   i    i   i   i   t   rbt   __file__t   __path__s   %s: module references %st   inspectt	   getsourcet
   getabsfilet   getsourcefilet   getfilegetsourcelinest
   findsourcet   getcommentst   getframeinfot   getinnerframest   getouterframest   stackt   traces"   %s: module MAY be using inspect.%sR   t   __main__s   2.4s.   %s: top-level module may be 'python -m' script(   i   i   (   R   R   R   R   RK   Rp   RN   R   R   t   version_infoR   t   readt   marshalt   loadR    t   dictt   fromkeyst   iter_symbolsR	   Rz   R   R   (   R   R   R   Rn   R   R   R   t   skipR#   t   codeR   t   symbolst   bad(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR     sB    #,
  
 	 'c         c   sz   x |  i  D] } | Vq
 WxZ |  i D]O } t | t  o	 | Vq# t | t  o  x t |  D] } | Vq_ Wq# q# Wd S(   sB   Yield names and strings used by `code` and its nested code objectsN(   t   co_namest	   co_constsRI   R   R   R   (   R   R   t   const(    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR     s    
  	
 	 c           C   sG   t  i i d  o t  i d j o t St i d  t i d  d  S(   Nt   javat   clis1   Unable to analyze compiled code on this platform.sf   Please ask the author to include a 'zip_safe' setting (either True or False) in the package's setup.py(   R   t   platformRM   R   R	   Rz   (    (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR     s    $RE   Rf   RB   t   install_basei    R   c            s   d d k  } t t i i |   d   t i d |       f d   } | d j o t i	 d j } n | i
 | i g t |  }   pY | i |  | d | }	 x0 t i   D] \ }
 } } | |	 |
 |  q W|	 i   n4 x0 t i   D] \ }
 } } | d |
 |  q W|  S(   sq  Create a zip file from all the files under 'base_dir'.  The output
    zip file will be named 'base_dir' + ".zip".  Uses either the "zipfile"
    Python module (if available) or the InfoZIP "zip" utility (if installed
    and found on the default search path).  If neither tool is available,
    raises DistutilsExecError.  Returns the name of the output zip file.
    iNRX   s#   creating '%s' and adding '%s' to itc            s   x | D]~ } t  i i t  i i | |   } t  i i |  oD | t   d }   p |  i | |  n t i d |  q q Wd  S(   Ni   s   adding '%s'(	   R   R   R   R   Ru   RK   R   R	   R   (   t   zR_   t   namesR   R   R'   (   RX   t   base_dir(    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   visit  s     !s   2.4t   compression(   t   zipfileR   R   R   R_   R	   RP   R*   R   R   t
   ZIP_STOREDt   ZIP_DEFLATEDR   t   ZipFileR   R    (   t   zip_filenameR   Ri   RX   t   compressRj   R   R   R   R   R_   R   R   (    (   RX   R   sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyR|     s"    		  (4   t   __doc__R   R   R   t
   setuptoolsR    t   distutils.dir_utilR   R   t	   sysconfigR   R   R   t   ImportErrort   distutils.sysconfigR   t	   distutilsR	   t   distutils.errorsR
   t   pkg_resourcesR   R   R   R   t   typesR   t   setuptools.compatR   R   t   setuptools.extensionR   R   R$   R   R%   R   R   t   splitR   R   R   Rw   R   R   R   R   R   R   RY   R*   R|   (    (    (    sX   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/setuptools/command/bdist_egg.pyt   <module>   sD   $		 H	
		

	#	
	-	