Skip to content

Commit 1e0c6c5

Browse files
committed
revert deletion of jupyter server hidden files config
1 parent 43175fd commit 1e0c6c5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

jupyter_ai_jupyternaut/extension_app.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from __future__ import annotations
22
from asyncio import get_event_loop_policy
33
from jupyter_server.extension.application import ExtensionApp
4+
from jupyter_server.serverapp import ServerApp
45
import os
56
from tornado.web import StaticFileHandler
67
from traitlets import List, Unicode, Dict
8+
from traitlets.config import Config
79
from typing import TYPE_CHECKING
810

911
from .config import ConfigManager, ConfigRestAPI
@@ -205,3 +207,26 @@ def initialize_settings(self):
205207

206208
# Initialize SecretsManager and bind it to global settings dictionary
207209
self.settings["jupyternaut.secrets_manager"] = EnvSecretsManager(parent=self)
210+
211+
212+
def _link_jupyter_server_extension(self, server_app: ServerApp):
213+
"""Setup custom config needed by this extension."""
214+
c = Config()
215+
c.ContentsManager.allow_hidden = True
216+
c.ContentsManager.hide_globs = [
217+
"__pycache__", # Python bytecode cache directories
218+
"*.pyc", # Compiled Python files
219+
"*.pyo", # Optimized Python files
220+
".DS_Store", # macOS system files
221+
"*~", # Editor backup files
222+
".ipynb_checkpoints", # Jupyter notebook checkpoint files
223+
".git", # Git version control directory
224+
".venv", # Python virtual environment directory
225+
"venv", # Python virtual environment directory
226+
"node_modules", # Node.js dependencies directory
227+
".pytest_cache", # PyTest cache directory
228+
".mypy_cache", # MyPy type checker cache directory
229+
"*.egg-info", # Python package metadata directories
230+
]
231+
server_app.update_config(c)
232+
super()._link_jupyter_server_extension(server_app)

0 commit comments

Comments
 (0)