ó
û_¾Tc           @   sš   d  d l  Z  d  d l Z d  d l m Z d  d l m Z d  d l  m Z d  d l Td  d l m	 Z	 m
 Z
 m Z d „  Z d e
 f d	 „  ƒ  YZ d
 „  Z d S(   iÿÿÿÿN(   t   Command(   t   convert_path(   t   log(   t   *(   t   edit_configt   option_baset   config_filec         C   sJ   x$ d D] } | |  k r t  |  ƒ Sq W|  j ƒ  |  g k rF t  |  ƒ S|  S(   s4   Quote an argument for later parsing by shlex.split()t   "t   's   \t   #(   R   R   s   \R	   (   t   reprt   split(   t   argt   c(    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyt   shquote   s     
t   aliasc           B   sU   e  Z d  Z d Z e Z d g e j Z e j d g Z d „  Z	 d „  Z
 d „  Z RS(	   s3   Define a shortcut that invokes one or more commandss0   define a shortcut to invoke one or more commandst   removet   rs   remove (unset) the aliasc         C   s#   t  j |  ƒ d  |  _ d  |  _ d  S(   N(   R   t   initialize_optionst   Nonet   argsR   (   t   self(    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyR      s    	c         C   s>   t  j |  ƒ |  j r: t |  j ƒ d k r: t d ƒ ‚ n  d  S(   Ni   sF   Must specify exactly one argument (the alias name) when using --remove(   R   t   finalize_optionsR   t   lenR   t   DistutilsOptionError(   R   (    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyR   "   s    c         C   s  |  j  j d ƒ } |  j sL d GHd GHx  | D] } d Gt | | ƒ GHq, Wd  St |  j ƒ d k r± |  j \ } |  j r d  } qÝ | | k r¡ d Gt | | ƒ GHd  Sd | GHd  Sn, |  j d } d j t t	 |  j d ƒ ƒ } t
 |  j i i | | 6d 6|  j ƒ d  S(	   Nt   aliasess   Command Aliasess   ---------------s   setup.py aliasi   s    No alias definition found for %ri    t    (   t   distributiont   get_option_dictR   t   format_aliasR   R   R   t   joint   mapR   R   t   filenamet   dry_run(   R   R   R   t   command(    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyt   run*   s&    				(   s   removeR   s   remove (unset) the alias(   t   __name__t
   __module__t   __doc__t   descriptiont   Truet   command_consumes_argumentsR   t   user_optionst   boolean_optionsR   R   R#   (    (    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyR      s   
		c         C   s{   | |  \ } } | t  d ƒ k r+ d } n@ | t  d ƒ k rF d } n% | t  d ƒ k ra d } n
 d | } | |  d | S(	   Nt   globals   --global-config t   users   --user-config t   localt    s   --filename=%rR   (   R   (   t   nameR   t   sourceR"   (    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyR   E   s    			
(   t	   distutilst   ost
   setuptoolsR    t   distutils.utilR   R   t   distutils.errorst   setuptools.command.setoptR   R   R   R   R   R   (    (    (    sz   /var/www/send.findwatt.com/datamanager/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/alias.pyt   <module>   s   
		4