-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] New widget : RemoteFileSelector #6301
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8729043
Merge pull request #1 from holoviz/main
pierrotsmnrd 74fe4bd
Merge branch 'main' of https://github.com/pierrotsmnrd/panel into pie…
pierrotsmnrd 7a7bb68
Improved docs on deploying with GCP
pierrotsmnrd 1d29004
Merge branch 'main' into pierrotsmnrd_main
pierrotsmnrd 6fbb458
Merge branch 'panel/main' into pierrotsmnrd/main
pierrotsmnrd a0c5d40
Merge branch 'main' of https://github.com/holoviz/panel into remote_f…
pierrotsmnrd 2f53a6b
Adding widget RemoteFileSelector
pierrotsmnrd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import panel as pn\n", | ||
"pn.extension()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"The ``RemoteFileSelector`` widget allows browsing a distant filesystem and selecting one or more files in a directory.\n", | ||
"\n", | ||
"A ``RemoteFileSelector`` always relies on a ``RemoteFileProvider``, that is responsible for fetching data from the distant filesystem, handling the connection. The ``RemoteFileSelector`` is responsible for showing the distant filesystem and allow for a selection of files. Its behavior is similar to ``FileSelector``\n", | ||
"\n", | ||
"\n", | ||
"#### Parameters:\n", | ||
"\n", | ||
"// TODO\n", | ||
"\n", | ||
"\n", | ||
"___" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"name": "python", | ||
"pygments_lexer": "ipython3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# to fake delays in DummyRemoteFileProvider | ||
import time | ||
|
||
from pathlib import PurePosixPath | ||
|
||
from panel.widgets import RemoteFileProvider | ||
|
||
|
||
class DummyRemoteFileProvider(RemoteFileProvider): | ||
|
||
def __init__(self): | ||
super().__init__() | ||
|
||
async def ls(self, path:PurePosixPath): | ||
time.sleep(1) | ||
if str(path) == '/': | ||
return [f'dir_{l}' for l in 'ABCDEF' ], [f'file_{n}' for n in '123456' ] | ||
else: | ||
last_letter = path.parts[-1].replace("dir_", "") | ||
return [f'dir_{last_letter}{l}' for l in 'ABCDEF' ], [f'file_{last_letter + n}' for n in '123456' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it makes sense with async.