ó
¬X[c           @   sƒ   d  Z  d d l Z d d l Z d d l m Z m Z e j j e j j e	 ƒ ƒ Z
 e j j e
 d d ƒ Z d „  Z d d „ Z d S(   s4   A Jupyter-aware wrapper for the yarn package manageriÿÿÿÿN(   t   whicht
   subprocesst   stagings   yarn.jsc         C   s”   t  |  ƒ }  t j d k r€ d d l } d d l } t j |  g | d ƒ } | j | j | j ƒ | j	 ƒ  | j
 | j ƒ n t j |  | ƒ d S(   s  Execvp, except on Windows where it uses Popen.

    The first argument, by convention, should point to the filename
    associated with the file being executed.

    Python provides execvp on Windows, but its behavior is problematic
    (Python bug#9148).
    t   ntiÿÿÿÿNi   (   R    t   ost   namet   signalt   sysR   t   Popent   SIGINTt   SIG_IGNt   waitt   exitt
   returncodet   execvp(   t   cmdt   argvR   R   t   p(    (    s1   lib/python2.7/site-packages/jupyterlab/jlpmapp.pyR      s    	
c         C   s.   |  p t  j d }  t d d t g |  ƒ d S(   s$   Run node and return the result.
    i   t   nodeN(   R   R   R   t	   YARN_PATH(   R   (    (    s1   lib/python2.7/site-packages/jupyterlab/jlpmapp.pyt   main%   s    (   t   __doc__R   R   t   jupyterlab_launcher.processR    R   t   patht   dirnamet   abspatht   __file__t   HEREt   joinR   R   t   NoneR   (    (    (    s1   lib/python2.7/site-packages/jupyterlab/jlpmapp.pyt   <module>   s   	