ó
 –Qc           @   sÕ   d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m	 Z	 d d l m
 Z
 d d l m Z d „  Z d „  Z d „  Z e j d	 d d
 „ Z e d k rÑ e ƒ  n  d S(   s-   
Main command-line interface to PyInstaller.
iÿÿÿÿN(   t   get_version(   t   logger(   t   miscc         C   sm   |  j  } g  |  _  x* | D]" } |  j  j | j t j ƒ ƒ q Wt j j | |  j  } t	 j
 d | ƒ | S(   Ns   wrote %s(   t   pathext   extendt   splitt   ost   pathsept   PyInstallert   makespect   maint   __dict__R   t   info(   t   optst   argst	   temppathst   pt	   spec_file(    (    sS   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\main.pyt   run_makespec!   s    
	 c         C   s   t  j j | | |  j  d  S(   N(   R   t   buildR
   R   (   R   R   t
   pyi_config(    (    sS   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\main.pyt	   run_build-   s    c      	   C   s&   |  j  d d d t d d d d ƒd  S(   Ns   -vs	   --versiont   defaultt   actiont
   store_truet   helps#   Show program version info and exit.(   t
   add_optiont   False(   t   parser(    (    sS   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\main.pyt   __add_options1   s    i   c         C   s+  t  j ƒ  yý t j d d ƒ } t | ƒ t j j | ƒ t j j | ƒ t j j | ƒ t j	 j
 | ƒ | j |  ƒ \ } } t j j | | ƒ | j r± t ƒ  GHt d ƒ ‚ n  | sÇ | j d ƒ n  | d j d ƒ rç | d } n t | | ƒ } t | | | ƒ Wn t k
 r&t d ƒ ‚ n Xd S(   s¦   
    pyi_args     allows running PyInstaller programatically without a subprocess
    pyi_config   allows checking configuration once when running multiple tests
    t   usages:   %prog [opts] <scriptname> [ <scriptname> ...] | <specfile>i    s?   Requires at least one scriptname file or exactly one .spec-files   .specs   Aborted by user request.N(   R   t   check_not_running_as_roott   optparset   OptionParserR   R   R	   R   t   logt   compatt   __add_obsolete_optionst
   parse_argst   __process_optionst   versionR    t
   SystemExitt   errort   endswithR   R   t   KeyboardInterrupt(   t   pyi_argsR   R   R   R   R   (    (    sS   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\main.pyt   run5   s,    
		
	t   __main__(   t   __doc__R   R    t   syst   PyInstaller.makespecR   t   PyInstaller.buildt   PyInstaller.compatt   PyInstaller.logR    R   t   PyInstaller.utilsR   R   R   R   t   argvt   NoneR-   t   __name__(    (    (    sS   C:\Users\Salopaasi\My Documents\pyinstaller-pyinstaller-275d4c9\PyInstaller\main.pyt   <module>   s    			)