ó
©¶"Pc           @   sß   d  d l  Z  d  d l Z d  d l m Z d  d l m Z m Z m Z d Z d Z d Z	 d Z
 d Z d	 „  Z e d
 f f Z e d „ Z d d d „  ƒ  YZ d „  Z d d e e d d d d g  d d d g  d d d d „ Z d S(   iÿÿÿÿN(   t   HOMEPATH(   t   is_wint	   is_cygwint	   is_darwinsÏ  # -*- mode: python -*-
a = Analysis(%(scripts)s,
             pathex=%(pathex)s,
             hiddenimports=%(hiddenimports)r,
             hookspath=%(hookspath)r)
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          name=os.path.join(%(distdir)s, '%(exename)s'),
          debug=%(debug)s,
          strip=%(strip)s,
          upx=%(upx)s,
          console=%(console)s %(exe_options)s)
sˆ  # -*- mode: python -*-
a = Analysis(%(scripts)s,
             pathex=%(pathex)s,
             hiddenimports=%(hiddenimports)r,
             hookspath=%(hookspath)r)
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=1,
          name=os.path.join(%(builddir)s, '%(exename)s'),
          debug=%(debug)s,
          strip=%(strip)s,
          upx=%(upx)s,
          console=%(console)s %(exe_options)s)
coll = COLLECT(exe,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=%(strip)s,
               upx=%(upx)s,
               name=os.path.join(%(distdir)s, '%(name)s'))
s$  # -*- mode: python -*-
a = Analysis(%(scripts)s,
             pathex=%(pathex)s,
             hiddenimports=%(hiddenimports)r,
             hookspath=%(hookspath)r)
pyz = PYZ(a.pure)
exe = EXE(pyz,
          a.scripts,
          exclude_binaries=1,
          name=os.path.join(%(builddir)s, '%(exename)s'),
          debug=%(debug)s,
          strip=%(strip)s,
          upx=%(upx)s,
          console=%(console)s %(exe_options)s)
dll = DLL(pyz,
          a.scripts,
          exclude_binaries=1,
          name=os.path.join(%(builddir)s, '%(dllname)s'),
          debug=%(debug)s)
coll = COLLECT(exe, dll,
               a.binaries,
               a.zipfiles,
               a.datas,
               strip=%(strip)s,
               upx=%(upx)s,
               name=os.path.join(%(distdir)s, '%(name)s'))
sR   app = BUNDLE(exe,
             name=os.path.join(%(distdir)s, '%(exename)s.app'))
sP   app = BUNDLE(coll,
             name=os.path.join(%(distdir)s, '%(name)s.app'))
c         C   s   t  j j |  ƒ j d d ƒ S(   Ns   \s   \\(   t   ost   patht   normpatht   replace(   R   (    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   quote_win_filepathj   s    R    c         C   s–   x‰ | D] \ } } t  j j | ƒ | k s; t d | ƒ ‚ |  t | ƒ  | k r |  t | ƒ } | d d k r~ | d } n  | | f Sq Wd  |  f S(   Ns$   path '%s' should already be absolutei    s   \/i   (   R   R   t   abspatht   AssertionErrort   lent   None(   t   filenamet   conversionst	   from_patht   to_namet   rest(    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   make_variable_pathw   s    t   Pathc           B   s   e  Z d  „  Z d „  Z RS(   c         G   s,   t  t j j | ƒ |  _ d  |  _ |  _ d  S(   N(   t   applyR   R   t   joinR   t   variable_prefixt   filename_suffix(   t   selft   parts(    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   __init__…   s    c         C   si   |  j  d  k r- t |  j ƒ \ |  _ |  _  n  |  j d  k rI t |  j ƒ Sd |  j d t |  j  ƒ d S(   Ns   os.path.join(t   ,t   )(   R   R   R   R   R   t   repr(   R   (    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   __repr__ˆ   s
    (   t   __name__t
   __module__R   R   (    (    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyR   „   s   	c         C   sˆ  |  j  d ƒ } | j d d d d d d d t d	 d
 ƒ| j d d d d d d d	 d ƒ| j d d d d d d d	 d ƒ| j d d d	 d ƒ|  j  d ƒ } | j d d d g  d d d d d d d	 d t t j ƒ ƒ| j d d d d d d d  d	 d! ƒ| j d" d d d d# d	 d$ ƒ|  j  d% ƒ } | j d& d' d d d t d	 d( ƒ| j d) d* d d d	 d+ ƒ| j d, d d d t d	 d- ƒ|  j  d. ƒ } | j d/ d0 d1 d d2 d d d t d	 d3 ƒ| j d4 d5 d6 d d2 d d d	 d7 ƒ| j d8 d9 d d: d d; d	 d< ƒ|  j  d= ƒ } | j d> d d? d d@ d	 dA ƒ| j dB dC d dD d	 dE ƒ| j dF dG d g  d dH d dI d d d	 dJ ƒdK S(L   sW   
    Add the `Makespec` options to a option-parser instance or a
    option group.
    s   What to generates   -Fs	   --onefilet   destt   onefilet   actiont
   store_truet   defaultt   helps   create a single file deployments   -Ds   --onedirt   store_falses.   create a single directory deployment (default)s   -os   --outt   workdirt   metavart   DIRsN   generate the spec file in the specified directory (default: current directory)s   -ns   --names@   name to assign to the project (default: first script's basename)s   What to bundle, where to searchs   -ps   --pathst   pathext   appends   set base path for import (like using PYTHONPATH). Multiple directories are allowed, separating them with %s, or using this option multiple timess   --hidden-importt
   MODULENAMEt   hiddenimportssG   import hidden in the script(s). This option can be used multiple times.s   --additional-hooks-dirt	   hookspaths@   additional path to search for hooks (may be given several times)s   How to generates   -ds   --debugs   use the debug (verbose) build of the executable for packaging. This will make the packaged executable be more verbose when run.s   -ss   --strips9   strip the exe and shared libs (don't try this on Windows)s   --noupxsM   do not use UPX even if available (works differently between Windows and *nix)s%   Windows and Mac OS X specific optionss   -cs	   --consoles   --nowindowedt   consoles,   use a console subsystem executable (default)s   -ws
   --windoweds   --noconsoleså   use a windowed subsystem executable, which on Windows does not open the console when the program is launched.On Mac OS X it allows running gui applications and alsocreates an .app bundle.Mandatory for gui applications on Mac OS Xs   -is   --icont	   icon_files$   FILE.ICO or FILE.EXE,ID or FILE.ICNSs(  If FILE is an .ico file, add the icon to the final executable. Otherwise, the syntax 'file.exe,id' to extract the icon with the specified id from file.exe and add it to the final executable. If FILE is an .icns file, add the icon to the final .app bundle on Mac OS X (for Mac not yet implemented)s   Windows specific optionss   --version-filet   version_filet   FILEs+   add a version resource from FILE to the exes   -ms
   --manifests   FILE or XMLs#   add manifest FILE or XML to the exes   -rs
   --resourcet	   resourcess   FILE[,TYPE[,NAME[,LANGUAGE]]]s  add/update resource of the given type, name and language from FILE to the final executable. FILE can be a data file or an exe/dll. For data files, atleast TYPE and NAME need to be specified, LANGUAGE defaults to 0 or may be specified as wildcard * to update all resources of the given TYPE and NAME. For exe/dll files, all resources from FILE will be added/updated to the final executable if TYPE, NAME and LANGUAGE are omitted or specified as wildcard *.Multiple resources are allowed, using this option multiple times.N(   t   add_option_groupt
   add_optiont   FalseR   R   t   pathsept   True(   t   parsert   g(    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   __add_options   sb    i    c         K   sS  | s/ t  j j t  j j |  d ƒ ƒ d } n  d } t  j j d d t j | ƒ } |	 }	 | d  k rƒ t  j ƒ  } |	 j	 | ƒ n |	 j	 t  j ƒ  ƒ | t
 k rº t  j j t
 | ƒ } n  t  j j | ƒ sÜ t  j | ƒ n  d } |
 rd | t |
 ƒ f } n  | r d | t | ƒ f } n  | rjd | k rQd	 | | j d
 d ƒ f } qjd	 | t | ƒ f } n  | r˜t t | ƒ } d | t | ƒ f } n  | p¡g  } t t |  ƒ }  i |  d 6|	 d 6| d 6| d 6| d 6t | ƒ d 6t | ƒ d 6| d 6| d 6| d 6t | ƒ d 6| d  k	 d 6| p,| d 6| d 6} t sFt re| d | d <| d | d <n
 | | d <t rŠt rŠt | d <n  t  j j | | d ƒ } t | d  ƒ } | ræ| j t | ƒ | sE| j t | ƒ qEn_ | r| j t | ƒ | sE| j t | ƒ qEn+ | j t | ƒ | sE| j t | ƒ n  | j ƒ  | S(!   Ni    t   distt   builds   pyi.t    s   %s, version='%s's   %s, icon='%s't   <s   %s, manifest='%s't   's   \'s   %s, resources=%st   scriptsR+   R.   R/   t   namet   distdirt   builddirt   debugt   stript   upxt   cryptt   cryptedR0   t   exe_optionss   .exet   exenames   .dllt   dllnames   .spect   w(   R   R   t   splitextt   basenameR   t   syst   platformR   t   getcwdR,   R    t   existst   makedirsR   R   t   mapR   R   R   R   R   R9   t   opent   writet   onefiletmpltt   bundleexetmpltt   comsrvrtmpltt   bundletmpltt   onedirtmpltt   close(   RB   RC   R"   R0   RF   RG   t   noupxt	   comserverR(   R+   R2   R1   t   manifestR4   RI   R.   R/   t   kwargsRD   RE   RK   t   dt   specfnmt   specfile(    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   mainê   s|    )



(    (   RQ   R   t   PyInstallerR    R   R   R   RY   R]   R[   RZ   R\   R   t   path_conversionsR   R   R<   R   R9   R7   Rf   (    (    (    sE   /home/salopaasi/Documents/Moo/pyinstaller-2.0/PyInstaller/makespec.pyt   <module>   s"   	
	[	