ó
à™xTc           @   sa   d  d l  m Z d  d l Z d  d l Z e d „ Z d „  Z e d k r] e e j d ƒ n  d S(   iÿÿÿÿ(   t   divisionNc         C   s    | s d t  ƒ  Sd t  ƒ  Sd  S(   Ns3   $AUTORUN$>.\%(bundle_prefix)s_install_script.bat
.
sE   $AUTORUN$>.\%(bundle_prefix)s\%(bundle_prefix)s_install_script.bat
.
(   t   vars(   t   bundle_prefixt
   single_dir(    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/bundle_as_exe.pyt   create_autorun   s    c         C   sX  t  |  ƒ d k o |  d d k } | r5 |  d }  n  t  |  ƒ d k oT |  d d k } | rj |  d }  n  t  |  ƒ d k  r± d d l m } d d  l } | d | j j ƒ ‚ n  t j d	 k rÉ d
 } n d } d d  l } | j	 j
 d d | d d g ƒ } | d  k rt d ƒ ‚ n  |  d } | r^t j	 j | ƒ r^d d l m } | d | ƒ ‚ n  |  d }	 |  d }
 d t ƒ  } t d d ƒ j t | | ƒ ƒ | r¸d d t ƒ  } n d d d d t ƒ  } x |
 D] } | d | 7} qØW| d 7} | GHd d l m } | j d | ƒ j ƒ  j ƒ  | sTd d l m } | j d | ƒ n  d  S(    Ni    s   --no-unzipsfxi   s   --single_directoryi   iÿÿÿÿ(   t   UsagesU   %s [--no-unzipsfx] [--single_directory] bundle_prefix platform_string [addl_files...]t   nts   .exet    t   commandt   zipt   search_firstt   .s    Fatal: zip executable not found.(   t   Sorrys(   %s does not exist or is not a directory.s)   %(bundle_prefix)s_%(platform_string)s.zipt   autorunt   ws)   "%(path_zip)s" -q -r -z %(zip_file_name)ss    %(bundle_prefix)ss    %(bundle_prefix)s_sourcess    %(bundle_prefix)s_builds%    %(bundle_prefix)s_install_script.batt    s
    < autorun(   t   easy_run(   t   create_unzipsfxt   zip_file_name(   t   lent   libtbx.utilsR   t   libtbx.load_envt   envt   dispatcher_namet   ost   namet   libtbx.patht   patht   full_command_patht   Nonet   RuntimeErrort   isdirR   R   t   opent   writeR   t   libtbxR   t   fully_bufferedt   raise_if_errorst   show_stdoutt   libtbx.command_lineR   t   create(   t   argst   no_unzipsfxR   R   R"   t
   exe_suffixt   path_zipR   R   t   platform_stringt
   addl_filesR   t   cmdt   addlR   R   (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/bundle_as_exe.pyt   run   sR    ""	



t   __main__i   (	   t
   __future__R    t   sysR   t   FalseR   R0   t   __name__t   argv(    (    (    sO   /public2/ftp/pub/ccp4/6.5/ccp4-6.5/lib/py2/libtbx/command_line/bundle_as_exe.pyt   <module>   s
   	0