main.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Copyright (c) Jupyter Development Team.
  2. # Distributed under the terms of the Modified BSD License.
  3. import json
  4. import os
  5. from jupyterlab_server import LabServerApp
  6. HERE = os.path.dirname(__file__)
  7. # Turn off the Jupyter configuration system so configuration files on disk do
  8. # not affect this app. This helps this app to truly be standalone.
  9. os.environ["JUPYTER_NO_CONFIG"] = "1"
  10. with open(os.path.join(HERE, "package.json")) as fid:
  11. version = json.load(fid)["version"]
  12. def _jupyter_server_extension_points():
  13. return [{"module": __name__, "app": ExampleApp}]
  14. class ExampleApp(LabServerApp):
  15. extension_url = "/lab"
  16. default_url = "/lab"
  17. name = __name__
  18. load_other_extensions = False
  19. app_name = "JupyterLab Example App"
  20. app_settings_dir = os.path.join(HERE, "build", "application_settings")
  21. app_version = version
  22. schemas_dir = os.path.join(HERE, "build", "schemas")
  23. static_dir = os.path.join(HERE, "build")
  24. templates_dir = os.path.join(HERE, "templates")
  25. themes_dir = os.path.join(HERE, "build", "themes")
  26. user_settings_dir = os.path.join(HERE, "build", "user_settings")
  27. workspaces_dir = os.path.join(HERE, "build", "workspaces")
  28. if __name__ == "__main__":
  29. ExampleApp.launch_instance()