FileDrop widget for Textual, easily drag and drop files into your terminal apps.
Project description
textual-filedrop
Add filedrop support to your Textual apps, easily drag and drop files into your terminal apps.
Tested on
Windows
andmacOS
.
Nerd Font is required to display file icons.
Install
pip install textual-filedrop
or
git clone https://github.com/agmmnn/textual-filedrop.git
cd textual-filedrop
poetry install
Usage
You can find more examples here.
from textual_filedrop import FileDrop
# add FileDrop widget to your app
yield FileDrop(id="filedrop")
# focus the widget
self.query_one("#filedrop").focus()
# when the files are dropped
def on_file_drop_dropped(self, message: FileDrop.Dropped) -> None:
path = message.path
filepaths = message.filepaths
filenames = message.filenames
filesobj = message.filesobj
print(path, filepaths, filenames, filesobj)
# output: path, [filepaths], [filenames], [filesobj]
Examples
subdomain_lister
Drag and drop the subdomain list files and see the results as a tree list.
fullscreen
Fullscreen example, will show the results in the textual console.
hidden
As long as focus is on, the FileDrop widget will be active even if it is not visible on the screen.
Dev
poetry install
textual console
poetry run textual run --dev examples/subdomain_lister.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textual_filedrop-0.2.1.tar.gz
(6.8 kB
view hashes)
Built Distribution
Close
Hashes for textual_filedrop-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fec46368817ab2fa5b605c76b6016cfcf72bb70d2acc0fd1bbe6439f3778cb43 |
|
MD5 | 17c904c740f32a143f9eef6ffe004e3a |
|
BLAKE2b-256 | b71b35fe3dc85914106892a417212fb7f51294f8ccd0ff2f1f0056cbcb59bc8b |