
bc           @   s&  d  Z  d Z d d l Z d d l Z d d l Z d d l m Z y d d l Z Wn e k
 ri e	 Z n Xd d l
 m Z m Z m Z m Z d d l m Z m Z d d l m Z m Z m Z d d l m Z d d	 l m Z d
 Z e j d  Z d f  d     YZ d f  d     YZ d   Z d S(   s}   distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
s   $Id$iN(   t   message_from_file(   t   DistutilsOptionErrort   DistutilsArgErrort   DistutilsModuleErrort   DistutilsClassError(   t   FancyGetoptt   translate_longopt(   t   check_environt	   strtoboolt   rfc822_escape(   t   log(   t   DEBUGs   utf-8s   ^[a-zA-Z]([a-zA-Z0-9_]*)$t   Distributionc           B   s  e  Z d  Z d] d^ d_ d` db g Z d Z dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds dt du dv dw g Z e d<   e  Z i d d 6Z	 da d=  Z
 d>   Z da da d? d@  Z dA   Z da dB  Z dC   Z dD   Z dE   Z dF   Z d d g  dG  Z dH   Z dI   Z dJ   Z dK   Z dL   Z dM   Z d dN  Z da dO  Z dP dQ  Z e j dR  Z dS   Z  dT   Z! dU   Z" dV   Z# dW   Z$ dX   Z% dY   Z& dZ   Z' d[   Z( d\   Z) RS(x   s  The core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    t   verboset   vs   run verbosely (default)i   t   quiett   qs!   run quietly (turns verbosity off)s   dry-runt   ns   don't actually do anythingt   helpt   hs   show detailed help messages   no-user-cfgs-   ignore pydistutils.cfg in your home directorys   Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
s   help-commandss   list all available commandst   names   print package namet   versiont   Vs   print package versiont   fullnames   print <package name>-<version>t   authors   print the author's names   author-emails    print the author's email addresst
   maintainers   print the maintainer's names   maintainer-emails$   print the maintainer's email addresst   contacts7   print the maintainer's name if known, else the author'ss   contact-emails@   print the maintainer's email address if known, else the author'st   urls   print the URL for this packaget   licenses    print the license of the packaget   licences   alias for --licenset   descriptions   print the package descriptions   long-descriptions"   print the long package descriptiont	   platformss   print the list of platformst   classifierss   print the list of classifierst   keywordss   print the list of keywordst   providess+   print the list of packages/modules providedt   requiress+   print the list of packages/modules requiredt	   obsoletess0   print the list of packages/modules made obsoletec         C   s   t  |  d  S(   Ni    (   R   (   t   x(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   <lambda>w   t    c         C   si  d |  _  d |  _ d |  _ x! |  j D] } t |  | d  q% Wt   |  _ x: |  j j D], } d | } t |  | t |  j |   qX Wi  |  _	 d |  _ d |  _ d |  _ i  |  _ g  |  _ d |  _ i  |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ d |  _ i  |  _ i  |  _ | r | j d  } | d k	 r| d =xY | j    D]H \ } } |  j! |  } x* | j    D] \ }	 }
 d |
 f | |	 <qWqzWn  d | k r#| d | d <| d =d	 } t" d k	 rt" j# |  q#t$ j% j& | d
  n  x | j    D] \ } }
 t' |  j d |  rot |  j d |  |
  q0t' |  j |  rt |  j | |
  q0t' |  |  rt |  | |
  q0d t( |  } t" d k	 rt" j# |  q0t$ j% j& | d
  q0Wn  t) |  _* |  j d k	 r[x@ |  j D]2 } | j+ d  s;Pn  | d k r"t, |  _* Pq"q"Wn  |  j-   d S(   s0  Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        i   i    t   get_R'   t   optionss   setup scriptR   R   s:   'licence' distribution option is deprecated; use 'license's   
t   set_s   Unknown distribution option: %st   -s   --no-user-cfgN(.   R   t   dry_runR   t   display_option_namest   setattrt   DistributionMetadatat   metadatat   _METHOD_BASENAMESt   getattrt   cmdclasst   Nonet   command_packagest   script_namet   script_argst   command_optionst
   dist_filest   packagest   package_datat   package_dirt
   py_modulest	   librariest   headerst   ext_modulest   ext_packaget   include_dirst
   extra_patht   scriptst
   data_filest   passwordt   command_objt   have_runt   gett   itemst   get_option_dictt   warningst   warnt   syst   stderrt   writet   hasattrt   reprt   Truet   want_user_cfgt
   startswitht   Falset   finalize_options(   t   selft   attrst   attrt   basenamet   method_nameR)   t   commandt   cmd_optionst   opt_dictt   optt   valt   msgt   keyt   arg(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   __init__   s    			
 																							c         C   s6   |  j  j |  } | d k r2 i  } |  j  | <n  | S(   s   Get the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N(   R8   RI   R4   (   RX   R]   t   dict(    (    s$   /usr/lib/python2.7/distutils/dist.pyRK   !  s    R'   c   	      C   s  d d l  m } | d  k r8 |  j j   } | j   n  | d  k	 rb |  j | |  | d } n  | s} |  j | d  d  Sx | D] } |  j j |  } | d  k r |  j | d |  q |  j | d |  | |  } x, | j d  D] } |  j | d |  q Wq Wd  S(   Ni(   t   pformats     s   no commands known yets   no option dict for '%s' commands   option dict for '%s' command:s   
(	   t   pprintRg   R4   R8   t   keyst   sortt   announceRI   t   split(	   RX   t   headert   commandst   indentRg   t   cmd_nameR_   t   outt   line(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   dump_option_dicts,  s(    		c         C   s  g  } t    t j j t j d j  } t j j | d  } t j j |  r` | j	 |  n  t j
 d k rx d } n d } |  j r t j j t j j d  |  } t j j |  r | j	 |  q n  d } t j j |  r | j	 |  n  t r|  j d d	 j |   n  | S(
   s  Find as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        t	   distutilss   distutils.cfgt   posixs   .pydistutils.cfgs   pydistutils.cfgt   ~s	   setup.cfgs   using config files: %ss   , (   R   t   ost   patht   dirnameRN   t   modulest   __file__t   joint   isfilet   appendR   RT   t
   expanduserR   Rk   (   RX   t   filest   sys_dirt   sys_filet   user_filenamet	   user_filet
   local_file(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   find_config_filesI  s&    		!c         C   s  d d l  m  } | d  k r+ |  j   } n  t rA |  j d  n  |   } x | D] } t rq |  j d |  n  | j |  x | j   D]x } | j |  } |  j |  } xQ | D]I } | d k r | j	 | |  }	 | j
 d d  } | |	 f | | <q q Wq W| j   qQ Wd |  j k rx |  j d j   D] \ } \ }
 }	 |  j j	 |  } yY | rt |  | t |	   n5 | d k rt |  | t |	   n t |  | |	  Wq8t k
 r} t |  q8Xq8Wn  d  S(   Ni(   t   ConfigParsers"   Distribution.parse_config_files():s     reading %st   __name__R+   t   _t   globalR   R,   (   R   R,   (   R   R4   R   R   Rk   t   readt   sectionsR)   RK   RI   t   replaceRe   R8   RJ   t   negative_optR.   R   t
   ValueErrorR   (   RX   t	   filenamesR   t   parsert   filenamet   sectionR)   R_   R`   Ra   t   srct   aliasRb   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   parse_config_filesy  s<    	&c         C   s  |  j    } g  |  _ t | |  j  } | j |  j  | j i d d 6 | j d |  j d |   } | j	   } t
 j |  j  |  j |  r d Sx, | r |  j | |  } | d k r d Sq W|  j r |  j | d t |  j  d k d |  j d S|  j st d	  n  d
 S(   s  Parse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        R   R   t   argst   objectNt   display_optionsi    Rn   s   no commands suppliedi   (   t   _get_toplevel_optionsRn   R   R   t   set_negative_aliasesR   t   set_aliasest   getoptR7   t   get_option_orderR
   t   set_verbosityR   t   handle_display_optionst   _parse_command_optsR4   R   t
   _show_helpt   lenR   (   RX   t   toplevel_optionsR   R   t   option_order(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   parse_command_line  s,    				
	c         C   s   |  j  d g S(   s   Return the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        s   command-packages=s0   list of packages that provide distutils commandsN(   s   command-packages=Ns0   list of packages that provide distutils commands(   t   global_optionsR4   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s     c         C   s  d d l  m } | d } t j |  s9 t d |  n  |  j j |  y |  j |  } Wn t k
 rz } t	 |  n Xt
 | |  s t d |  n  t | d  o t | j t  s t d d |  n  |  j } t | d	  r| j   } | j | j  n  t | d
  r9t | j t  r9t | j  } n g  } | j |  j | j |  | j |  | j | d  \ } }	 t |	 d  r|	 j r|  j | d d d | g d St | d
  r\t | j t  r\d }
 xm | j D]b \ } } } } t |	 | j |   rd }
 t | d  r2|   qKt d | | f   qqW|
 r\d Sn  |  j |  } x0 t |	  j   D] \ } } d | f | | <q~W| S(   s  Parse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        i(   t   Commandi    s   invalid command name '%s's&   command class %s must subclass Commandt   user_optionss   command class %s must provide s+   'user_options' attribute (a list of tuples)R   t   help_optionsi   R   R   Rn   Nt   __call__sY   invalid help function %r for help option '%s': must be a callable object (function, etc.)s   command line(   t   distutils.cmdR   t
   command_ret   matcht
   SystemExitRn   R~   t   get_command_classR   R   t
   issubclassR   RQ   t
   isinstanceR   t   listR   t   copyt   updateR   t   fix_help_optionst   set_option_tableR   R   R   R   R   t   get_attr_nameRK   t   varsRJ   (   RX   R   R   R   R]   t	   cmd_classRb   R   R   t   optst   help_option_foundt   help_optiont   shortt   desct   funcR_   R   t   value(    (    s$   /usr/lib/python2.7/distutils/dist.pyR     sf    


	
c         C   s   x d D]w } t  |  j |  } | d k r1 q n  t | t  r g  | j d  D] } | j   ^ qP } t |  j | |  q q Wd S(   s   Set final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        R!   R   t   ,N(   R!   R   (   R2   R0   R4   R   t   strRl   t   stripR.   (   RX   RZ   R   t   elm(    (    s$   /usr/lib/python2.7/distutils/dist.pyRW   R  s    (c   
      C   sb  d d l  m } d d l m } | rm | r; |  j   } n	 |  j } | j |  | j |  j d  d GHn  | r | j |  j	  | j d d  d GHn  x |  j
 D] } t | t  r t | |  r | }	 n |  j |  }	 t |	 d  r#t |	 j t  r#| j |	 j t |	 j   n | j |	 j  | j d	 |	 j  d GHq W| |  j  GHd
 S(   sb  Show help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        i(   t	   gen_usage(   R   s   
Global options:R'   s*   Information display options (just display s!   information, ignore any commands)R   s   Options for '%s' command:N(   t   distutils.coreR   R   R   R   R   R   t
   print_helpt   common_usageR   Rn   R   t   typeR   R   RQ   R   R   R   R   R   R6   (
   RX   R   R   R   Rn   R   R   R)   R]   t   klass(    (    s$   /usr/lib/python2.7/distutils/dist.pyR   _  s6    			c   	      C   s  d d l  m } |  j r: |  j   d GH| |  j  GHd Sd } i  } x |  j D] } d | | d <qP Wx | D] \ } } | ro | j |  ro t |  } t |  j	 d |    } | d k r d	 j
 |  GHn" | d k r d j
 |  GHn | GHd } qo qo W| S(   s   If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        i(   R   R'   i   i    R(   R!   R   R   R    R"   R#   R$   s   
(   R!   R   (   R    R"   R#   R$   (   R   R   t   help_commandst   print_commandsR6   R   RI   R   R2   R0   R|   (	   RX   R   R   t   any_display_optionst   is_display_optiont   optionR`   Ra   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s,    	
	c         C   s   | d GHxq | D]i } |  j  j |  } | s@ |  j |  } n  y | j } Wn t k
 rf d } n Xd | | | f GHq Wd S(   sZ   Print a subset of the list of all commands -- used by
        'print_commands()'.
        t   :s   (no description available)s
     %-*s  %sN(   R3   RI   R   R   t   AttributeError(   RX   Rn   Rm   t
   max_lengtht   cmdR   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   print_command_list  s    	
c         C   s   d d l  } | j j } i  } x | D] } d | | <q% Wg  } x6 |  j j   D]% } | j |  sO | j |  qO qO Wd } x3 | | D]' } t |  | k r t |  } q q W|  j | d |  | r H|  j | d |  n  d S(   sn  Print out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        iNi   i    s   Standard commandss   Extra commands(	   t   distutils.commandR]   t   __all__R3   Ri   RI   R~   R   R   (   RX   Rt   t   std_commandst   is_stdR   t   extra_commandsR   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s*    		c   	      C   s   d d l  } | j j } i  } x | D] } d | | <q% Wg  } x6 |  j j   D]% } | j |  sO | j |  qO qO Wg  } xv | | D]j } |  j j |  } | s |  j |  } n  y | j } Wn t	 k
 r d } n X| j | | f  q W| S(   s>  Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        iNi   s   (no description available)(
   R   R]   R   R3   Ri   RI   R~   R   R   R   (	   RX   Rt   R   R   R   R   t   rvR   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_command_list  s(    

c         C   s   |  j  } t | t  s | d k r- d } n  g  | j d  D] } | d k r= | j   ^ q= } d | k r | j d d  n  | |  _  n  | S(   s9   Return a list of packages from which commands are loaded.R'   R   s   distutils.commandi    N(   R5   R   R   R4   Rl   R   t   insert(   RX   t   pkgst   pkg(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_command_packages  s    		4c         C   s   |  j  j |  } | r | Sx |  j   D] } d | | f } | } y t |  t j | } Wn t k
 rv q) n Xy t | |  } Wn' t k
 r t	 d | | | f  n X| |  j  | <| SWt	 d |   d S(   so  Return the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        s   %s.%ss3   invalid command '%s' (no class '%s' in module '%s')s   invalid command '%s'N(
   R3   RI   R   t
   __import__RN   Rz   t   ImportErrorR2   R   R   (   RX   R]   R   t   pkgnamet   module_namet
   klass_namet   module(    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s(    
c         C   s   |  j  j |  } | r | r t r9 |  j d |  n  |  j |  } | |   } |  j  | <d |  j | <|  j j |  } | r |  j | |  q n  | S(   s  Return the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        s<   Distribution.get_command_obj(): creating '%s' command objecti    (   RG   RI   R   Rk   R   RH   R8   t   _set_command_options(   RX   R]   t   createt   cmd_objR   R)   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_command_objA  s    	c         C   s  | j    } | d k r* |  j |  } n  t rD |  j d |  n  x_| j   D]Q\ } \ } } t r |  j d | | | f  n  y t t | j  } Wn t	 k
 r g  } n Xy | j
 } Wn t	 k
 r i  } n Xy t | t  }	 | | k r|	 rt | | | t |   nc | | k rJ|	 rJt | | t |   n8 t | |  rlt | | |  n t d | | | f  WqQ t k
 r}
 t |
  qQ XqQ Wd S(   sy  Set the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').
        s#     setting options for '%s' command:s       %s = %s (from %s)s1   error in %s: command '%s' has no such option '%s'N(   t   get_command_nameR4   RK   R   Rk   RJ   t   mapR   t   boolean_optionsR   R   R   R   R.   R   RQ   R   R   (   RX   RG   t   option_dictt   command_nameR   t   sourceR   t	   bool_optst   neg_optt	   is_stringRb   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR   \  s<    	

i    c         C   s   d d l  m } t | |  s7 | } |  j |  } n | j   } | j sP | S| j   d | _ d |  j | <|  j |  | r x' | j	   D] } |  j
 | |  q Wn  | S(   s  Reinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        i(   R   i    (   R   R   R   R   R   t	   finalizedt   initialize_optionsRH   R   t   get_sub_commandst   reinitialize_command(   RX   R]   t   reinit_subcommandsR   R   t   sub(    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s    	
	c         C   s   t  j  | |  d  S(   N(   R
   (   RX   Rb   t   level(    (    s$   /usr/lib/python2.7/distutils/dist.pyRk     s    c         C   s%   x |  j  D] } |  j |  q
 Wd S(   s   Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N(   Rn   t   run_command(   RX   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   run_commands  s    c         C   sZ   |  j  j |  r d St j d |  |  j |  } | j   | j   d |  j  | <d S(   s  Do whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Ns
   running %si   (   RH   RI   R
   t   infoR   t   ensure_finalizedt   run(   RX   R]   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s    	

c         C   s"   t  |  j p |  j p g   d k S(   Ni    (   R   R:   R=   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_pure_modules  s    c         C   s   |  j  o t |  j   d k S(   Ni    (   R@   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_ext_modules  s    c         C   s   |  j  o t |  j   d k S(   Ni    (   R>   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_c_libraries  s    c         C   s   |  j    p |  j   S(   N(   R   R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_modules  s    c         C   s   |  j  o t |  j   d k S(   Ni    (   R?   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_headers  s    c         C   s   |  j  o t |  j   d k S(   Ni    (   RD   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_scripts  s    c         C   s   |  j  o t |  j   d k S(   Ni    (   RE   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   has_data_files  s    c         C   s$   |  j    o# |  j   o# |  j   S(   N(   R   R  R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   is_pure  s    (   R   R   s   run verbosely (default)i   (   R   R   s!   run quietly (turns verbosity off)(   s   dry-runR   s   don't actually do anything(   R   R   s   show detailed help messageN(   s   no-user-cfgNs-   ignore pydistutils.cfg in your home directory(   s   help-commandsNs   list all available commands(   R   Ns   print package name(   R   R   s   print package version(   R   Ns   print <package name>-<version>(   R   Ns   print the author's name(   s   author-emailNs    print the author's email address(   R   Ns   print the maintainer's name(   s   maintainer-emailNs$   print the maintainer's email address(   R   Ns7   print the maintainer's name if known, else the author's(   s   contact-emailNs@   print the maintainer's email address if known, else the author's(   R   Ns   print the URL for this package(   R   Ns    print the license of the package(   R   Ns   alias for --license(   R   Ns   print the package description(   s   long-descriptionNs"   print the long package description(   R   Ns   print the list of platforms(   R    Ns   print the list of classifiers(   R!   Ns   print the list of keywords(   R"   Ns+   print the list of packages/modules provided(   R#   Ns+   print the list of packages/modules required(   R$   Ns0   print the list of packages/modules made obsolete(*   R   t
   __module__t   __doc__R4   R   R   R   R   R-   R   Re   RK   Rs   R   R   R   R   R   RW   R   R   R   R   R   R   R   R   R   R   R
   t   INFORk   R   R   R   R  R  R  R  R  R  R  (    (    (    s$   /usr/lib/python2.7/distutils/dist.pyR   "   s    	
                     					0.	C		]	1	(		!	#		'+)	
								R/   c           B   s+  e  Z d  Z d3 Z d4 d  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 d"   Z d#   Z d$   Z d%   Z d&   Z e Z d'   Z d(   Z d)   Z d*   Z d+   Z d,   Z d-   Z d.   Z d/   Z  d0   Z! d1   Z" d2   Z# RS(5   s]   Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    R   R   R   t   author_emailR   t   maintainer_emailR   R   R   t   long_descriptionR!   R   R   R   t   contact_emailR    t   download_urlR"   R#   R$   c         C   s   | d  k	 r" |  j t |   n d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _	 d  |  _
 d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   R4   t   read_pkg_filet   openR   R   R   R  R   R  R   R   R   R  R!   R   R    R  R"   R#   R$   (   RX   Rx   (    (    s$   /usr/lib/python2.7/distutils/dist.pyRe     s&    																c            s  t  |      f d   }   f d   }   d } | d  |  _ | d  |  _ | d  |  _ | d  |  _ d |  _ | d  |  _ d |  _ | d	  |  _	 | d
  |  _
 d   k r | d  |  _ n	 d |  _ | d  |  _ | d  |  _ d   k r| d  j d  |  _ n  | d  |  _ | d  |  _ | d k ru| d  |  _ | d  |  _ | d  |  _ n d |  _ d |  _ d |  _ d S(   s-   Reads the metadata values from a file object.c            s     |  } | d k r d  S| S(   Nt   UNKNOWN(   R4   (   R   R   (   Rb   (    s$   /usr/lib/python2.7/distutils/dist.pyt   _read_field  s    
c            s&     j  |  d   } | g  k r" d  S| S(   N(   t   get_allR4   (   R   t   values(   Rb   (    s$   /usr/lib/python2.7/distutils/dist.pyt
   _read_list#  s    s   metadata-versionR   R   t   summaryR   s   author-emails	   home-pageR   s   download-urlR   R!   R   t   platformt
   classifiers   1.1R#   R"   R$   N(   R    R   R   R   R   R4   R   R  R  R   R   R  R  Rl   R!   R   R    R#   R"   R$   (   RX   t   fileR  R  t   metadata_version(    (   Rb   s$   /usr/lib/python2.7/distutils/dist.pyR    s:    
					c         C   sA   t  t j j | d  d  } z |  j |  Wd | j   Xd S(   s7   Write the PKG-INFO file into the release tree.
        s   PKG-INFOt   wN(   R  Rw   Rx   R|   t   write_pkg_filet   close(   RX   t   base_dirt   pkg_info(    (    s$   /usr/lib/python2.7/distutils/dist.pyt   write_pkg_infoM  s    c         C   s  d } |  j  s3 |  j s3 |  j s3 |  j s3 |  j r< d } n  |  j | d |  |  j | d |  j    |  j | d |  j    |  j | d |  j    |  j | d |  j	    |  j | d |  j
    |  j | d	 |  j    |  j | d
 |  j    |  j r |  j | d |  j  n  t |  j    } |  j | d |  d j |  j    } | rv|  j | d |  n  |  j | d |  j    |  j | d |  j    |  j | d |  j    |  j | d |  j    |  j | d |  j    d S(   s9   Write the PKG-INFO format data to a file object.
        s   1.0s   1.1s   Metadata-Versiont   Namet   Versiont   Summarys	   Home-paget   Authors   Author-emailt   Licenses   Download-URLt   DescriptionR   t   Keywordst   Platformt
   Classifiert   Requirest   Providest	   ObsoletesN(   R"   R#   R$   R    R  t   _write_fieldt   get_namet   get_versiont   get_descriptiont   get_urlt   get_contactt   get_contact_emailt   get_licenseR	   t   get_long_descriptionR|   t   get_keywordst   _write_listt   get_platformst   get_classifierst   get_requirest   get_providest   get_obsoletes(   RX   R  R   t	   long_descR!   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR  V  s0    		c         C   s$   | j  d | |  j |  f  d  S(   Ns   %s: %s
(   RP   t   _encode_field(   RX   R  R   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR.  x  s    c         C   s(   x! | D] } |  j  | | |  q Wd  S(   N(   R.  (   RX   R  R   R  R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR8  {  s    c         C   s6   | d  k r d  St | t  r, | j t  St |  S(   N(   R4   R   t   unicodet   encodet   PKG_INFO_ENCODINGR   (   RX   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR?    s
    c         C   s   |  j  p d S(   NR  (   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR/    s    c         C   s   |  j  p d S(   Ns   0.0.0(   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR0    s    c         C   s   d |  j    |  j   f S(   Ns   %s-%s(   R/  R0  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_fullname  s    c         C   s   |  j  |  j  p d S(   NR  (   R?  R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt
   get_author  s    c         C   s   |  j  p d S(   NR  (   R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_author_email  s    c         C   s   |  j  |  j  p d S(   NR  (   R?  R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_maintainer  s    c         C   s   |  j  p d S(   NR  (   R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_maintainer_email  s    c         C   s(   |  j  |  j  p' |  j  |  j  p' d S(   NR  (   R?  R   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR3    s    c         C   s   |  j  p |  j p d S(   NR  (   R  R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR4    s    c         C   s   |  j  p d S(   NR  (   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR2    s    c         C   s   |  j  p d S(   NR  (   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR5    s    c         C   s   |  j  |  j  p d S(   NR  (   R?  R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR1    s    c         C   s   |  j  |  j  p d S(   NR  (   R?  R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR6    s    c         C   s   |  j  p g  S(   N(   R!   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR7    s    c         C   s   |  j  p d g S(   NR  (   R   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR9    s    c         C   s   |  j  p g  S(   N(   R    (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR:    s    c         C   s   |  j  p d S(   NR  (   R  (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   get_download_url  s    c         C   s   |  j  p g  S(   N(   R#   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR;    s    c         C   s:   d d  l  } x | D] } | j j |  q W| |  _ d  S(   Ni(   t   distutils.versionpredicatet   versionpredicatet   VersionPredicateR#   (   RX   R   Rt   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   set_requires  s    c         C   s   |  j  p g  S(   N(   R"   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR<    s    c         C   sY   g  | D] } | j    ^ q } x* | D]" } d d  l } | j j |  q& W| |  _ d  S(   Ni(   R   RI  RJ  t   split_provisionR"   (   RX   R   R   Rt   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   set_provides  s
    c         C   s   |  j  p g  S(   N(   R$   (   RX   (    (    s$   /usr/lib/python2.7/distutils/dist.pyR=    s    c         C   s:   d d  l  } x | D] } | j j |  q W| |  _ d  S(   Ni(   RI  RJ  RK  R$   (   RX   R   Rt   R   (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   set_obsoletes  s    (   R   R   R   R  R   R  R   R   R   R  R!   R   R   R   R  R   R    R  R"   R#   R$   N($   R   R  R	  R1   R4   Re   R  R!  R  R.  R8  R?  R/  R0  RC  RD  RE  RF  RG  R3  R4  R2  R5  t   get_licenceR1  R6  R7  R9  R:  RH  R;  RL  R<  RN  R=  RO  (    (    (    s$   /usr/lib/python2.7/distutils/dist.pyR/     sN         	4			"																										c         C   s/   g  } x" |  D] } | j  | d d ! q W| S(   s   Convert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    i    i   (   R~   (   R)   t   new_optionst
   help_tuple(    (    s$   /usr/lib/python2.7/distutils/dist.pyR     s    (    R	  t   __revision__RN   Rw   t   ret   emailR    RL   R   R4   t   distutils.errorsR   R   R   R   t   distutils.fancy_getoptR   R   t   distutils.utilR   R   R	   Rt   R
   t   distutils.debugR   RB  t   compileR   R   R/   R   (    (    (    s$   /usr/lib/python2.7/distutils/dist.pyt   <module>   s(   $
"   