Procházet zdrojové kódy

turn static_url_prefix into a configurable trait and add some aliases to old notebook aliases

Zsailer před 4 roky
rodič
revize
9600a9d0cb
4 změnil soubory, kde provedl 13 přidání a 10 odebrání
  1. 2 1
      examples/example_check.py
  2. 2 1
      jupyterlab/browser_check.py
  3. 5 4
      jupyterlab/labapp.py
  4. 4 4
      setup.py

+ 2 - 1
examples/example_check.py

@@ -43,7 +43,8 @@ def main():
         """
         name = __name__
         serverapp_config = {
-            "open_browser": False
+            "open_browser": False,
+            "base_url": "/foo/"
         }
         ip = '127.0.0.1'
 

+ 2 - 1
jupyterlab/browser_check.py

@@ -164,7 +164,8 @@ class BrowserApp(LabApp):
     """
     name = __name__
     serverapp_config = {
-        "open_browser": False
+        "open_browser": False,
+        "base_url": "/foo/"
     }
     ip = '127.0.0.1'
     flags = test_flags

+ 5 - 4
jupyterlab/labapp.py

@@ -451,9 +451,10 @@ class LabApp(NBClassicConfigShimMixin, LabServerApp):
     aliases['app-dir'] = 'LabApp.app_dir'
     aliases.update({
         'watch': 'LabApp.watch',
+        'open_browser': 'ServerApp.open_browser',
+        'base_url': 'ServerApp.base_url'
     })
 
-
     flags['core-mode'] = (
         {'LabApp': {'core_mode': True}},
         "Start the app in core mode."
@@ -526,7 +527,7 @@ class LabApp(NBClassicConfigShimMixin, LabServerApp):
     def _default_app_dir(self):
         app_dir = get_app_dir()
         if self.core_mode:
-            app_dir = HERE 
+            app_dir = HERE
             self.log.info('Running JupyterLab in core mode')
         elif self.dev_mode:
             app_dir = DEV_DIR
@@ -563,8 +564,8 @@ class LabApp(NBClassicConfigShimMixin, LabServerApp):
     def _default_static_dir(self):
         return pjoin(self.app_dir, 'static')
 
-    @property
-    def static_url_prefix(self):
+    @default('static_url_prefix')
+    def _default_static_url_prefix(self):
         if self.override_static_url:
             return self.override_static_url
         else:

+ 4 - 4
setup.py

@@ -156,7 +156,7 @@ setup_args = dict(
 setup_args['install_requires'] = [
     'ipython',
     'tornado!=6.0.0, !=6.0.1, !=6.0.2',
-    'jupyterlab_server~=2.0.0b1',
+    'jupyterlab_server~=2.0.0b3',
     'nbclassic~=0.2.0rc4',
     'jinja2>=2.10'
 ]
@@ -164,9 +164,9 @@ setup_args['install_requires'] = [
 
 setup_args['extras_require'] = {
     'test': [
-        'pytest==5.3.2', 
-        'pytest-cov', 
-        'pytest-tornasync', 
+        'pytest==5.3.2',
+        'pytest-cov',
+        'pytest-tornasync',
         'pytest-console-scripts',
         'pytest-check-links',
         'requests',