Skip to main content

An advanced kivy file browser.

Project description

See http://kivy-garden.github.io/garden.filebrowser/index.html

Coverage Status Github Build Status

FileBrowser

The FileBrowser widget is an advanced file browser. You use it similarly to FileChooser usage.

It provides a shortcut bar with links to special and system directories. When touching next to a shortcut in the links bar, it'll expand and show all the directories within that directory. It also facilitates specifying custom paths to be added to the shortcuts list.

It provides a icon and list view to choose files from. And it also accepts filter and filename inputs.

To create a FileBrowser which prints the currently selected file as well as the current text in the filename field when 'Select' is pressed, with a shortcut to the Documents directory added to the favorites bar:

.. code-block:: python

from kivy.app import App
from os.path import sep, expanduser, isdir, dirname
import sys

class TestApp(App):

    def build(self):
        if sys.platform == 'win':
            user_path = dirname(expanduser('~')) + sep + 'Documents'
        else:
            user_path = expanduser('~') + sep + 'Documents'
        browser = FileBrowser(select_string='Select',
                              favorites=[(user_path, 'Documents')])
        browser.bind(
                    on_success=self._fbrowser_success,
                    on_canceled=self._fbrowser_canceled)
        return browser

    def _fbrowser_canceled(self, instance):
        print 'cancelled, Close self.'

    def _fbrowser_success(self, instance):
        print instance.selection

TestApp().run()

Events

  • on_canceled Fired when the Cancel buttons on_release event is called.
  • on_success Fired when the Select buttons on_release event is called.

Install

pip install kivy_garden.filebrowser

CI

Every push or pull request run the GitHub Action CI. It tests the code on various OS and also generates wheels that can be released on PyPI upon a tag. Docs are also generated and uploaded to the repo as well as artifacts of the CI.

TODO

  • add your code

Contributing

Check out our contribution guide and feel free to improve the flower.

License

This software is released under the terms of the MIT License. Please see the LICENSE.txt file.

How to release

  • update __version__ in kivy-garden/filebrowser/__init__.py to the latest version.
  • update CHANGELOG.md and commit the changes
  • call git tag -a x.y.z -m "Tagging version x.y.z"
  • call python setup.py bdist_wheel --universal and python setup.py sdist, which generates the wheel and sdist in the dist/* directory
  • Make sure the dist directory contains the files to be uploaded to pypi and call twine check dist/*
  • then call twine upload dist/* to upload to pypi.
  • call git push origin master --tags to push the latest changes and the tags to github.

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

kivy_garden.filebrowser-1.1.1.dev0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

kivy_garden.filebrowser-1.1.1.dev0-py2.py3-none-any.whl (9.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file kivy_garden.filebrowser-1.1.1.dev0.tar.gz.

File metadata

  • Download URL: kivy_garden.filebrowser-1.1.1.dev0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for kivy_garden.filebrowser-1.1.1.dev0.tar.gz
Algorithm Hash digest
SHA256 4bf246fe19bddf81e8078ad3ffbdd45c1b1702ad7f8ef891d4fdc8588f5ffe4a
MD5 482f2f6301124d92b09af1fc9456da6a
BLAKE2b-256 5d29d6f7ae54952fad00a5a33c728849e9499466ce66144e9b05437d58a4d3c8

See more details on using hashes here.

File details

Details for the file kivy_garden.filebrowser-1.1.1.dev0-py2.py3-none-any.whl.

File metadata

  • Download URL: kivy_garden.filebrowser-1.1.1.dev0-py2.py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for kivy_garden.filebrowser-1.1.1.dev0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 502b9c8eb9ce1e6bc28ccb5ff0129522e4ae44690e5538ff75ff623ddf8460ed
MD5 341ccf4f91f2a4a4157c4ea748001458
BLAKE2b-256 ea9bcd2b37a2fff6108f3402f03835a18e411da589fe92854622953e96e33b09

See more details on using hashes here.

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