-
-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a0c5d40
commit 2f53a6b
Showing
5 changed files
with
443 additions
and
0 deletions.
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.