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 in Windows Terminal only. Other terminals/operating systems may not be using the Paste event.
Install
pip install textual-filedrop
Usage
You can find more examples here.
# add FileDrop widget to your app
yield FileDrop(id="filedrop")
# focus the widget
self.query_one("#filedrop").focus()
# when the files are selected/dropped
def on_file_drop_selected(self, message: FileDrop.Selected) -> None:
path = message.path
filepaths = message.filepaths
filenames = message.filenames
print(path, filepaths, filenames)
# output: path, [filepaths], [filenames]
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.1.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for textual_filedrop-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2251bd857438cec340838b105909e04aaab72e7fdfc6245e9d2e7e56b3922d16 |
|
MD5 | 685d219158eb4d0d0bf37ea4efff1122 |
|
BLAKE2b-256 | bea76607bed5845376506a293afe7839940c300b0556dccbe1a424807bcea6b7 |