Skip to main content

Panel of buttons to launch files into a running IDE.

Project description

filebuttons

Panel of buttons to launch files into a running IDE

Example showing buttons for 202 files.

license pypi python

docs | repository

Employs the Kivy framework. Kivy

The appearance and buttons are set by the config file in user's home folder named '.filebuttons.ini'. A default config file is created automatically if it doesn't exist. Example of the Default config file. Alternatively, set it with a command line option.

An instance of the target IDE should be running and the subprocess that launches the IDE must complete right away otherwise it will block the entire filebuttons app.

By default files launch into Visual Studio Code. The application is set by the config file.

The screen position of the main window is set by the config file so you can have it start off on a side monitor.

Set the current working directory of the shell to the root of the filesystem before running.

Installation

python -m pip install filebuttons

Usage

filebuttons -- -h

The -- unlocks the filebuttons help. Without it you get the Kivy framework help.

usage: filebuttons.exe [KIVY OPTION...] [-- PROGRAM OPTIONS]:: [-h] [--title TEXT] [--config FILE]

Button panel. Each button runs a program with the file. Use to launch a file into a source code editor, IDE, or
arbitrary program.

options:
  -h, --help     show this help message and exit
  --title TEXT   Text to display in the main window title bar. Default is 'filebuttons'.
  --config FILE  Configuration file containing settings.

Alternate installation

Copy kv.py to a local file.

Alternate usage

Set working directory to the root of the repository.

python <path-to-kv.py>

The default config file is located in the same folder as the kv.py and is called filebuttons.ini.

Settings

Hand edit the config file or use the main window Add Folder, Screen Coordinates, and Settings buttons. See top of main window. The Python standard library configparser describes the config file format. Sample ini file

Restart filebuttons to see configuration changes.

Folders

Files become buttons directed by the [filebuttons.folders] section in the config file.

  • empty files are skipped
  • directories starting with "__" are skipped

There is one key for each folder. The folder must be a subfolder of the current working directory. A folder name can have / to indicate subdirectories. For example docs/fix/code =

The key's value is a multiline string. On each line is a glob defined by pathlib.Path.glob see pathlib. The glob selects files from the folder to be buttons.

If the folder key has no value all files in all subdirectories get selected. It is wise to avoid this with the root folder of a repository.

The default config file has one folder called . (dot) which is typically the root of the repository. It is the current working directory.

Add one folder with the Add Folder button.

Add globs to folders by pressing Settings button and then Folders sidebar tab. Example Click one of the folders in the center to bring up a multiline editing dialog. The dialog is scrolled to the bottom. Put one glob per line.

Program

This is the application name. The IDE. The application name can be an absolute path or just the name like code shown in the example. It should be a name that would work when keyed in as a shell command.

example

Appearance

example

Config file

example Shows the location of the config file.

Set the main window screen position

Position the main window as desired and press the Screen Coordinates button. Screen Position.

Hints

  • Both the current working directory and the config file should be from trusted sources.

  • Filenames that contain either ";", "&&", "||", "\n" will not generate buttons.

  • Launch files from one repository into an IDE opened in another.

  • To avoid configparser.ParsingError:, every key in [filebuttons.folders] must be followed by an =

  • If the recursive wildcard ** is present in a glob, there will be no Folder Buttons rendered for the matching folders.

  • The Folder Buttons perform no action when pressed. They act like labels.

Issues

Exceptions are reported in Kivy's console at App close time after going to settings.

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

filebuttons-0.2.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

filebuttons-0.2.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file filebuttons-0.2.0.tar.gz.

File metadata

  • Download URL: filebuttons-0.2.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for filebuttons-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9f846c53c4c562817bf0933201887ba11a27a5bae854bed4095625e89017450f
MD5 61fe854d658b370c48514bb165e50110
BLAKE2b-256 969f5faff891d43712f7d4d9c02d4c9e151e9c4c5148ab17267d95d0a1ed6619

See more details on using hashes here.

Provenance

The following attestation bundles were made for filebuttons-0.2.0.tar.gz:

Publisher: release.yml on tmarktaylor/filebuttons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file filebuttons-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: filebuttons-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for filebuttons-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eee6907caa318082e013dd1b9f2454f87dcb20e4fbcd8471f95598e55fbd0964
MD5 295df2c4b0f3b9a202ab02e5cd59a179
BLAKE2b-256 b369a56a44a3b9cd60815a82ee270c0658b6d8642f91b789136e24cccfb2788e

See more details on using hashes here.

Provenance

The following attestation bundles were made for filebuttons-0.2.0-py3-none-any.whl:

Publisher: release.yml on tmarktaylor/filebuttons

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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