Skip to main content

FileDrop widget for Textual, easily drag and drop files into your terminal apps.

Project description

screenshot

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


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)

Uploaded Source

Built Distribution

textual_filedrop-0.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page