Skip to main content

Curses Tree Style Path Picker

Project description

CURSES TREE STYLE PATH PICKER

A Curses based, tree style, path picker. For use as a terminal based file dialog.

img

  • Pre-order file system traversal from a given point, or $PWD if not specified.
  • Support both Vi & Emacs bindings and jumping to next or previous parent.
  • Expand or collapse child nodes one at a time or all at once.
  • Recursively get disk usage of a single node or all expanded nodes.
  • Toggle display of dotfiles.
  • Toggle marking of files that can then be piped into another program or simply echoed back to the screen upon exit.
  • Reset marking and expansion.

INSTALLATION

pip install treepick

CLI USAGE

USAGE: treepick [-h] [-a] [path]

Select paths from a directory tree.

POSITIONAL ARGUMENTS:
path          A valid path.

OPTIONAL ARGUMENTS:
-h, --help    Show this help message and exit.
-a, --hidden  Show all hidden paths too.

PYTHON USAGE

from treepick import pick

hidden = True

parent_path = '/path/to/directory'

my_list_of_paths = pick(parent_path, hidden)

my_amazing_function(my_list_of_paths)

KEYBINDINGS

KEY ACTION
UP, k, p Step up one line.
DOWN, j, n Step down one line.
K, P Jump to previous parent directory.
J, N Jump to next parent directory.
PGDN, d, v Jump down a page of lines.
PGUP, u, V Jump up a page of lines.
g, < Jump to first line.
G, > Jump to last line.
RIGHT, l, f Expand and step into directory.
TAB, RET Toggle expansion/collapse of directory.
LEFT, h, b Collapse directory.
SHIFT RIGHT, L, F Expand directory and child directories.
SHIFT LEFT, H, B Jump to parent directory and collapse all.
m, SPC Toggle marking of paths.
M Toggle marking of all currently expanded paths.
F2, i View all currently picked paths.
. Toggle display of dotfiles.
s Display total size of path, recursively
S Display totol size of all currently expanded paths.
r Reset marking and expansion.
F1, ? View all keybindings.
q, ESC Quit and display all marked paths.

TODO

  • <input type="checkbox" checked="" disabled="" /> Support window resizing.
  • <input type="checkbox" checked="" disabled="" /> Page for viewing all current picks
  • <input type="checkbox" checked="" disabled="" /> Fix permission exception handling in my du package.
  • <input type="checkbox" checked="" disabled="" /> Retain traversal position when toggling hidden directories.
  • <input type="checkbox" disabled="" /> Different colors for sizes and marks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for treepick, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size treepick-0.1.3-py3-none-any.whl (10.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size treepick-0.1.3.tar.gz (8.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page