瀏覽代碼

Update docstrings and make sure call to `jupyter lab workspaces` exits with an error.

Afshin Darian 6 年之前
父節點
當前提交
cbd3094345
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      jupyterlab/labapp.py

+ 16 - 0
jupyterlab/labapp.py

@@ -123,6 +123,11 @@ class LabWorkspaceExportApp(JupyterApp):
     version = version
     version = version
     description = """
     description = """
     Export a JupyterLab workspace
     Export a JupyterLab workspace
+
+    If no arguments are passed in, this command will export the default
+        workspace.
+    If a workspace name is passed in, this command will export that workspace.
+    If no workspace is found, this command will export an empty workspace.
     """
     """
 
 
     def start(self):
     def start(self):
@@ -155,6 +160,9 @@ class LabWorkspaceImportApp(JupyterApp):
     version = version
     version = version
     description = """
     description = """
     Import a JupyterLab workspace
     Import a JupyterLab workspace
+
+    This command will import a workspace from a JSON file. The format of the
+        file must be the same as what the export functionality emits.
     """
     """
 
 
     def start(self):
     def start(self):
@@ -224,6 +232,9 @@ class LabWorkspaceApp(JupyterApp):
     version = version
     version = version
     description = """
     description = """
     Import or export a JupyterLab workspace
     Import or export a JupyterLab workspace
+
+    There are two sub-commands for export or import of workspaces. This app
+        should not otherwise do any work.
     """
     """
 
 
     subcommands = dict()
     subcommands = dict()
@@ -236,6 +247,11 @@ class LabWorkspaceApp(JupyterApp):
         LabWorkspaceImportApp.description.splitlines()[0]
         LabWorkspaceImportApp.description.splitlines()[0]
     )
     )
 
 
+    def start(self):
+        super().start()
+        print('Either `export` or `import` must be specified.')
+        sys.exit(1)
+
 
 
 lab_aliases = dict(aliases)
 lab_aliases = dict(aliases)
 lab_aliases['app-dir'] = 'LabApp.app_dir'
 lab_aliases['app-dir'] = 'LabApp.app_dir'