How to use the traitlets.default function in traitlets

To help you get started, we’ve selected a few traitlets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jupyterhub / binderhub / binderhub / registry.py View on Github external
    @default("_docker_config")
    def _load_docker_config(self):
        if not os.path.exists(self.docker_config_path):
            self.log.warning("No docker config at %s", self.docker_config_path)
            return {}
        self.log.info("Loading docker config %s", self.docker_config_path)
        with open(self.docker_config_path) as f:
            return json.load(f)
github krassowski / jupyterlab-lsp / py_src / jupyter_lsp / server.py View on Github external
    @default("cmd")
    def _default_cmd(self):
        """ command arguments to launch jsonrpc-ws-proxy
        """
        return [self.nodejs, self.jsonrpc_ws_proxy]
github jupyterlab / jupyterlab_server / jupyterlab_server / handlers.py View on Github external
    @default('workspaces_url')
    def _default_workspaces_url(self):
        return ujoin(self.app_url, 'workspaces/')
github creare-com / podpac / podpac / core / authentication.py View on Github external
    @tl.default("aws_secret_access_key")
    def _get_secret_access_key(self):
        return settings["AWS_SECRET_ACCESS_KEY"]
github nfultz / nb2mail / nb2mail / __init__.py View on Github external
    @default('file_extension')
    def _file_extension_default(self):
        return '.mail'
github pixiedust / pixiegateway / pixiegateway / chartsManager.py View on Github external
    @default('chart_storage_class')
    def chart_storage_class_default(self):
        return os.getenv('PG_CHART_STORAGE', 'pixiegateway.chartsManager.SQLLiteChartStorage')
github jupyterhub / jupyterhub / jupyterhub / app.py View on Github external
    @default('authenticator')
    def _authenticator_default(self):
        return self.authenticator_class(parent=self, db=self.db)
github ipython-contrib / jupyter_contrib_nbextensions / src / jupyter_contrib_nbextensions / application.py View on Github external
    @default('log_format')
    def _log_format_default(self):
        """Override default log format to include time."""
        return ('%(color)s['
                '%(levelname)1.1s %(asctime)s %(name)s'
github jupyterhub / oauthenticator / oauthenticator / oauth2.py View on Github external
    @default("authorize_url")
    def _authorize_url_default(self):
        return os.environ.get("OAUTH2_AUTHORIZE_URL", "")
github dask / dask-gateway / dask-gateway-server / dask_gateway_server / managers / jobqueue / base.py View on Github external
    @default("dask_gateway_jobqueue_launcher")
    def _default_launcher_path(self):
        return (
            shutil.which("dask-gateway-jobqueue-launcher")
            or "dask-gateway-jobqueue-launcher"
        )