Skip to content

Commit 86df6a4

Browse files
committed
minor changes
1 parent 7a96565 commit 86df6a4

File tree

2 files changed

+3
-17
lines changed

2 files changed

+3
-17
lines changed

jupyter_server/services/contents/filemanager.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,7 @@ def _dir_model(self, path, content=True):
296296
model["size"] = None
297297
os_dir = self._get_os_path(path)
298298
dir_contents = os.listdir(os_dir)
299-
model["item_count"] = len(
300-
[
301-
name
302-
for name in dir_contents
303-
if self.should_list(name)
304-
and (self.allow_hidden or not is_file_hidden(os.path.join(os_dir, name)))
305-
]
306-
)
299+
model["item_count"] = len(dir_contents)
307300
if content:
308301
model["content"] = contents = []
309302
for name in os.listdir(os_dir):
@@ -777,14 +770,7 @@ async def _dir_model(self, path, content=True):
777770
model["size"] = None
778771
os_dir = self._get_os_path(path)
779772
dir_contents = await run_sync(os.listdir, os_dir)
780-
model["item_count"] = len(
781-
[
782-
name
783-
for name in dir_contents
784-
if self.should_list(name)
785-
and (self.allow_hidden or not is_file_hidden(os.path.join(os_dir, name)))
786-
]
787-
)
773+
model["item_count"] = len(dir_contents)
788774
if content:
789775
model["content"] = contents = []
790776
for name in dir_contents:

tests/services/contents/test_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ async def test_get(jp_contents_manager):
644644
assert "item_count" in dirmodel
645645
assert isinstance(dirmodel["content"], list)
646646
assert len(dirmodel["content"]) == 3
647-
assert dirmodel["item_count"] == 3
647+
assert dirmodel["item_count"] == 4
648648
assert dirmodel["path"] == "foo"
649649
assert dirmodel["name"] == "foo"
650650

0 commit comments

Comments
 (0)