Skip to content

Commit

Permalink
kwargs widget should be initialized with parameter (#1360)
Browse files Browse the repository at this point in the history
  • Loading branch information
okz authored Sep 13, 2023
1 parent 765809a commit d0b6f70
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fsspec/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ def _setup(self):
name="protocol",
align="center",
)
self.kwargs = pn.widgets.TextInput(name="kwargs", value="{}", align="center")
self.kwargs = pn.widgets.TextInput(
name="kwargs", value=self.init_kwargs, align="center"
)
self.go = pn.widgets.Button(name="⇨", align="end", width=45)
self.main = SingleSelect(size=10)
self.home = pn.widgets.Button(name="🏠", width=40, height=30, align="end")
Expand Down
9 changes: 9 additions & 0 deletions fsspec/tests/test_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ def test_basic():

gui = fsspec.gui.FileSelector()
assert "url" in str(gui.panel)


def test_kwargs(tmpdir):
"""confirm kwargs are passed to the filesystem instance"""
import fsspec.gui

gui = fsspec.gui.FileSelector(f"file://{tmpdir}", kwargs="{'auto_mkdir': True}")

assert gui.fs.auto_mkdir

0 comments on commit d0b6f70

Please sign in to comment.