Exemplo n.º 1
0
    def _default_conf_d_language_servers(self):
        language_servers = {}  # type: KeyedLanguageServerSpecs

        manager = ConfigManager(read_config_path=jupyter_config_path())

        for app in APP_CONFIG_D_SECTIONS:
            language_servers.update(**manager.get(f"jupyter{app}config").get(
                self.__class__.__name__, {}).get("language_servers", {}))

        return language_servers
Exemplo n.º 2
0
    def _default_config_dict(self):
        """load merged config from more jupyter_*_config.d files

        re-uses notebook loading machinery to look through more locations
        """
        manager = ConfigManager(read_config_path=jupyter_config_path())
        conf = {}
        for app in ["_", "_notebook_", "_server_"]:
            conf.update(**manager.get(f"jupyter{app}config").get("StarterManager", {}))
        return conf
Exemplo n.º 3
0
    def _default_config_dict(self):
        """load merged config from more jupyter_*_config.d files

        re-uses notebook loading machinery to look through more locations
        """
        config_path = jupyter_config_path()
        cwd = str(Path.cwd())
        if cwd not in config_path:
            config_path = [cwd, *config_path]
        manager = ConfigManager(read_config_path=config_path)
        conf = {}
        for app in ["_", "_notebook_", "_server_"]:
            more_conf = manager.get(f"jupyter{app}config").get("StarterManager", {})
            conf.update(**more_conf)
        return conf
Exemplo n.º 4
0
    def get_bundler(self, bundler_id):
        """
        Get bundler metadata from config given a bundler ID.

        Parameters
        ----------
        bundler_id: str
            Unique bundler ID within the jupyter_server/bundlerextensions config section

        Returns
        -------
        dict
            Bundler metadata with label, group, and module_name attributes

        Raises
        ------
        KeyError
            If the bundler ID is unknown
        """
        cm = ConfigManager()
        return cm.get('jupyter_server').get('bundlerextensions',
                                            {})[bundler_id]