ó
¬X[c           @   s/  d  Z  d d l m Z m Z m Z d d l m Z m Z d d l m	 Z	 m
 Z
 d d l m Z d d l m Z d d l m Z m Z m Z m Z m Z m Z e e ƒ Z d	 e d
 <d e d <d e d <e e ƒ Z i i e d 6d 6d f e d <e Z e ƒ  Z e e k rd e e f Z n  d e f d „  ƒ  YZ e e ƒ Z d e d
 <d e f d „  ƒ  YZ d e f d „  ƒ  YZ e e ƒ Z  d e  d
 <e e ƒ Z! i i e d 6d 6d f e! d <i i e d 6d 6d  f e! d! <i i e d" 6d 6d# f e! d" <d e f d$ „  ƒ  YZ" e" j# Z$ Z% e& d% k r+e$ ƒ  n  d& S('   s#   A tornado based Jupyter lab server.iÿÿÿÿ(   t   NotebookAppt   aliasest   flags(   t
   JupyterAppt   base_aliases(   t   Boolt   Unicodei   (   t   __version__(   t   load_jupyter_server_extension(   t   buildt   cleant   get_app_dirt   get_user_settings_dirt   get_app_versiont   get_workspaces_dirs   LabBuildApp.app_dirs   app-dirs   LabBuildApp.namet   names   LabBuildApp.versiont   versiont	   dev_buildt   LabBuildApps   Build in Development modet   devs   %s (dev), %s (app)c           B   s‰   e  Z e Z d  Z e Z e Z e d d e	 d d ƒZ
 e d d e	 d d ƒZ e d d e	 d d ƒZ e e d e	 d d ƒZ d	 „  Z RS(
   sú   
    Build the JupyterLab application

    The application is built in the JupyterLab app directory in `/staging`.
    When the build is complete it is put in the JupyterLab app `/static`
    directory, where it is used to serve the application.
    t    t   configt   helps   The app directory to build int
   JupyterLabs!   The name of the built applications$   The version of the built applications:   Whether to build in dev mode (defaults to production mode)c         C   sJ   |  j  s d n d } t d |  j d |  j d |  j d | d |  j ƒ d  S(   Ns
   build:prodR	   t   app_dirR   R   t   commandt   logger(   R   R	   R   R   R   t   log(   t   selfR   (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyt   start=   s    !(   t   __name__t
   __module__R   t   descriptiont   build_aliasesR   t   build_flagsR   R   t   TrueR   R   R   t   FalseR   R   (    (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR   %   s   				s   LabCleanApp.app_dirt   LabCleanAppc           B   s;   e  Z e Z d  Z e Z e d d e d d ƒZ d „  Z	 RS(   s‰   
    Clean the JupyterLab application

    This will clean the app directory by removing the `staging` and `static`
    directories.
    R   R   R   s   The app directory to cleanc         C   s   t  |  j ƒ d  S(   N(   R
   R   (   R   (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR   T   s    (
   R   R   R   R    t   clean_aliasesR   R   R#   R   R   (    (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR%   G   s   	t
   LabPathAppc           B   s   e  Z e Z d  Z d „  Z RS(   s<  
    Print the configured paths for the JupyterLab application

    The application path can be configured using the JUPYTERLAB_DIR environment variable.
    The user settings path can be configured using the JUPYTERLAB_SETTINGS_DIR
        environment variable or it will fall back to
        `/lab/user-settings` in the default Jupyter configuration directory.
    The workspaces path can be configured using the JUPYTERLAB_WORKSPACES_DIR
        environment variable or it will fall back to
        '/lab/workspaces' in the default Jupyter configuration directory.
    c         C   s(   d t  ƒ  GHd t ƒ  GHd t ƒ  GHd  S(   Ns   Application directory:   %ss   User Settings directory: %ss   Workspaces directory %s(   R   R   R   (   R   (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR   f   s    (   R   R   R   R    R   (    (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR'   X   s   s   LabApp.app_dirt	   core_modet   LabApps   Start the app in core mode.s	   core-modet   dev_modes2   Start the app in dev mode for running from source.s   dev-modet   watchs   Start the app in watch mode.c           B   sM  e  Z e Z d  Z d Z e Z e Z e	 d e
 e
 j j ƒ  d f d e e j j ƒ  d f d e e j j ƒ  d f d e e j j ƒ  d f ƒ Z e d d e d	 d
 ƒZ e e ƒ  d e d	 d ƒZ e e ƒ  d e d	 d ƒZ e e ƒ  d e d	 d ƒZ e e d e d	 d ƒZ e e d e d	 d ƒZ e e d e d	 d ƒZ d „  Z RS(   sB  
    JupyterLab - An extensible computational environment for Jupyter.

    This launches a Tornado based HTML Server that serves up an
    HTML5/Javascript JupyterLab client.

    JupyterLab has three different modes of running:

    * Core mode (`--core-mode`): in this mode JupyterLab will run using the JavaScript
      assets contained in the installed `jupyterlab` Python package. In core mode, no
      extensions are enabled. This is the default in a stable JupyterLab release if you
      have no extensions installed.
    * Dev mode (`--dev-mode`): uses the unpublished local JavaScript packages in the
      `dev_mode` folder.  In this case JupyterLab will show a red stripe at the top of
      the page.  It can only be used if JupyterLab is installed as `pip install -e .`.
    * App mode: JupyterLab allows multiple JupyterLab "applications" to be
      created by the user with different combinations of extensions. The `--app-dir` can
      be used to set a directory for different applications. The default application
      path can be found using `jupyter lab path`.
    s°  
        jupyter lab                       # start JupyterLab
        jupyter lab --dev-mode            # start JupyterLab in development mode, with no extensions
        jupyter lab --core-mode           # start JupyterLab in core mode, with no extensions
        jupyter lab --app-dir=~/myjupyterlabapp # start JupyterLab with a particular set of extensions
        jupyter lab --certfile=mycert.pem # use SSL/TLS certificate
    R	   i    R
   t   patht   pathss   /labR   R   s'   The default URL to redirect to from `/`s,   The app directory to launch JupyterLab from.s    The directory for user settings.s   The directory for workspacess„  Whether to start the app in core mode. In this mode, JupyterLab
        will run using the JavaScript assets that are within the installed
        JupyterLab Python package. In core mode, third party extensions are disabled.
        The `--dev-mode` flag is an alias to this to be used when the Python package
        itself is installed in development mode (`pip install -e .`).
        s  Whether to start the app in dev mode. Uses the unpublished local
        JavaScript packages in the `dev_mode` folder.  In this case JupyterLab will
        show a red stripe at the top of the page.  It can only be used if JupyterLab
        is installed as `pip install -e .`.
        s&   Whether to serve the app in watch modec         C   sO   t  t |  ƒ j ƒ  d } |  j j d t ƒ sK |  j j | ƒ t |  ƒ n  d S(   sX  Load any extensions specified by config.

        Import the module, then call the load_jupyter_server_extension function,
        if one exists.

        If the JupyterLab server extension is not enabled, it will
        be manually loaded with a warning.

        The extension API is experimental, and may change in future releases.
        s<   JupyterLab server extension not enabled, manually loading...t
   jupyterlabN(	   t   superR)   t   init_server_extensionst   nbserver_extensionst   getR$   R   t   warnR   (   R   t   msg(    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR0   Æ   s
    (   R   R   R   R    t   examplest   lab_aliasesR   t	   lab_flagsR   t   dictR   t
   splitlinesR%   R'   t   subcommandsR   R#   t   default_urlR   R   R   t   user_settings_dirR   t   workspaces_dirR   R$   R(   R*   R+   R0   (    (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyR)   ~   s2   							t   __main__N('   t   __doc__t   notebook.notebookappR    R   R   t   jupyter_core.applicationR   R   t	   traitletsR   R   t   _versionR   t	   extensionR   t   commandsR	   R
   R   R   R   R   R8   R!   R"   R#   R   t   app_versionR   R&   R%   R'   R6   R7   R)   t   launch_instancet   maint   launch_new_instanceR   (    (    (    s0   lib/python2.7/site-packages/jupyterlab/labapp.pyt   <module>   sF   .


	

^