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
WindowsandmacOS.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textual_filedrop-0.2.3.tar.gz.
File metadata
- Download URL: textual_filedrop-0.2.3.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
050365402d454900e9cbd7d59919ea093f6d0474d1a124370feb434f656638d9
|
|
| MD5 |
8bed13f4e40c359d23fe72298d6e00d0
|
|
| BLAKE2b-256 |
1fd18c35d83d06eac2263948fcbca034b0a2d73a564dadf0fb02fa0549c2fa7e
|
File details
Details for the file textual_filedrop-0.2.3-py3-none-any.whl.
File metadata
- Download URL: textual_filedrop-0.2.3-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.11.1 Windows/10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b928cbedd21ad28263e9cae00a0c209fbc4dc149da388951e300a1acd9345c5b
|
|
| MD5 |
487a6b1e9cb140fb0b5bd57aece3e069
|
|
| BLAKE2b-256 |
b18e6aa224cac2d4d4967596c2a709f800c7ce2762d656b856be10ff81841142
|