{ "info": { "author": "Justin Bronder", "author_email": "jsbronder@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: Console :: Curses", "Intended Audience :: Developers", "Intended Audience :: End Users/Desktop", "Intended Audience :: System Administrators", "License :: OSI Approved :: BSD License", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Topic :: System :: Shells", "Topic :: System :: Systems Administration", "Topic :: System :: System Shells", "Topic :: Terminals", "Topic :: Terminals :: Serial", "Topic :: Terminals :: Telnet", "Topic :: Terminals :: Terminal Emulators/X Terminals", "Topic :: Text Processing :: Filters", "Topic :: Utilities" ], "description": "===========\nFuZzy SheLl\n===========\n\n.. image:: https://travis-ci.org/jsbronder/fzsl.svg?branch=master\n :target: https://travis-ci.org/jsbronder/fzsl\n\nIntroduction\n------------\n\nFuzzy file or path searcher in the shell which provides path completion similar\nto the ctrlp_ plugin for vim. Start a command and then hit Ctrl+p to see a list\nof possible paths. Enter search terms to narrow down the list and then select\nthe appropriate completion using your arrow keys or Ctrl+j/k.\n\nfzsl uses a single matching algorithm but provides the user with a wide variety\nof ways to influence how file scanning is performed as it is by far the most\nintensive part of this process. Scanners are selected by first checking if\nthey are valid for the current working directory and then ranked by a\nuser-selected priority.\n\nConfiguration\n-------------\nAll configuration of fzsl is done in an ini style which is interpreted by the\npython ConfigParser module. Each section defines a new scanner with the\nsection title used as the scanner name. Configuration is read from\n*~/.config/fzslrc* if it exists, if not fzsl will fall back to\n*/usr/share/fzsl/fzsl.conf*. The default configuration that ships with fzsl contains\nfull documentation for all scanner types and should be referenced. It\ncurrently handles standard directories, git checkouts and scanning for only\ndirectories. It also has a number of examples for how to define additional\nscanners. Scanners with a priority less than 0 can only be used by passing the\nscanner name to fzsl with the **--rule** argument.\n\nSimple Scanners\n---------------\nSimple scanners use shell commands and or functions to check if they are suitable\nand to scan for files. They are very easy to configure and should support the\nvast majority of use cases. Simple scanners are defined by setting two shell\ncommands that should be executed. The first detects if the scanner is suitable\nfor the current working directory and the second performs the scanning. Simple\nscanners should also set a priority for ranking if more than one scanner is\nvalid. If the priority is not specified, it defaults to 0. Finally, a cache\nand root path for the scanning command can be set. For example::\n\n # Standard git rule\n [git]\n type = simple\n detect_cmd = git rev-parse\n cmd = git ls-files\n priority = 10\n\n # If the directory has a large number of files such that scanning\n # takes too long, a cache can be used. The cache can be regenerated\n # by an external script or by pressing F5 or ctrl+r in the UI.\n [linux]\n type = simple\n root_path = /usr/src/linux\n cmd = find .\n cache = ~/.fzsl-cache/linux\n\nThe only requirement for the **cmd** and **detect_cmd** is that they are\navailable in your standard login shell. For instance, if using bash, they\nshould be defined in *~/.bash_profile*::\n\n [shell-function-scanner]\n type = simple\n detect_cmd = my_detect_function\n cmd = my_scanning_function\n priority = 100\n\n**Options**:\n\n**type**\n This must be set to **simple**.\n\n**cmd**\n The command to execute in the root directory that will output all possible\n matches. By default, the current working directory of the command will be\n the same as that of the caller. However, if the root_path is specified, it\n will be used instead.\n\n**detect_cmd**\n This command will be executed to determine if the scanner is a possible\n match for the current working directory. The command should return 0 for a\n valid directory.\n\n**root_path**\n The root path has two possible uses. First, if the current working\n directory is a subdirectory of the root path, the scanner will be\n considered suitable for use when scanning. Second, if the root_path is\n specified along with detect_cmd, then the root_path will be used as the\n current working directory when executing the detect_cmd.\n\n To use the stdout of a command rather than a fixed string as the root_path,\n preface the root_command with a **!**. For example,::\n\n root_path = !echo \"my/root/path\"\n\n**priority**\n The priority is used to determine which scanner to use when multiple\n scanners are considered suitable. The higher the priority, the more likely\n it will be selected. Scanners with a priority less than 0 are never\n considered unless manually selected via the **--rule** argument.\n\n**cache**\n Path to a file that will be used to cache results for for this scanner. By\n default, scanners will use the cache rather than rescanning the entire file\n list. Note that the cache is tied to the scanner, so if the same **cmd**\n needs to be used with two different caches, it will have to be two\n different scanners. If no cache is supplied, results will just be\n regenerated on each run. This is probably fine unless you have a really\n large number of files (tens of thousands) to scan or a really slow disk.\n\nPython Scanners\n---------------\nPython scanners offer a deeper level of customization for scanners. They must\nderive from the **fzsl.Scanner** class. See ``pydoc fzsl.Scanner``. The\npriority attribute should be set and the methods ``is_suitable(self, path)``\nand ``scan(self, path=None, rescan=False)`` need to be defined. Any caching is\nleft up to the implementor. Any extra options set in the scanner configuration\nare passed to the scanners ``__init__`` method as keyword arguments. Perhaps\nthe best example is to show how one could create a Simple Scanner using fzsl\nitself::\n\n # Example plugin file that loads the default simple scanner.\n [default-via-plugin]\n type = python\n path = /usr/lib/python2.7/site-packages/fzsl/scanner.py\n object = SimpleScanner\n # The following are passed as keyword arguments to the\n # RuleScanner constructor\n cmd = find .\n priority = 0\n\n**Options**:\n\n**type**\n This must be set to **python**.\n\n**path**\n Path to the python file containing the scanner implementation.\n\n**object**\n Name of the ``fzsl.Scanner`` derived class.\n\n**\\***\n Any further options are passed as keyword arguments to the Scanners\n constructor. Note that as they are parsed by **ConfigParser** they\n will be strings.\n\nInstallation\n------------\nfzsl can be installed via pip or by simply running the included ``setup.py``\nscript::\n\n pip install fzsl\n # OR\n python setup.py install --root --record installed_files.txt\n\nShell Functions\n---------------\nfzsl will not modify your shell by default. It is up to you to source the\nincluded */usr/share/fzsl/fzsl.bash*. It defines two functions that will add\nfzsl functionality directly to your shell. See the script for further\ndocumentation.\n\n- ``__fzsl_bind_default_matching [BINDING]``: Binds ctrl-p to launch fuzzy\n scanning. If ctrl-p is not desired, another readline style keybinding can be\n specified. When launched, fzsl will scan the current directory and provide a\n UI for updating the current query for fuzzy matching. On completion the\n current command line will be preserved and the matched path will be appended.\n\n- ``__fzsl_create_fzcd [SCANNER]\"``: Creates the ``fzcd`` function which will\n change the current directory to the fuzzily matched path on completion. By\n default the shipped **dirs-only** scanner will be used. Another scanner can\n be specified by passing it as the first argument.\n\nFuzzy Matching User Interface\n-----------------------------\nfzsl will launch a ncurses interface when prompted to start matching in the\ncurrent directory. Once the file list has been populated by the scanner, the\nuser can begin to input characters to be fuzzily matched against the scanned\npaths. As the query is updated, the list of available paths will be trimmed.\nA portion of each path will be highlighted to represent which part of it was\nbest matched against the query. The user can also move the cursor around to\nsupport editing of the query. The following keybindings are defined.\n\n- **Enter**: Finish completion and echo the currently selected path, if any.\n- **Down Arrow**/**ctrl+j**: Select the next path in the list.\n- **Up Arrow**/**ctrl+k**: Select the previous path in the list.\n- **Left Arrow**: Move the cursor left.\n- **Right Arrow**: Move the cursor right.\n- **ctrl+v**: Enter verbose move which shows the scores for each path.\n- **Escape**/**ctrl+c**: Exit the UI without echoing the currently selected path.\n- **Backspace**: Delete the character behind the cursor.\n- **F5**/**ctrl+r**: If the scanner has a cache, refresh it.\n\nErrata\n------\n:Author:\n Justin Bronder \n\n:Contributers:\n Joshua Downer \n\n:License:\n BSD\n\n:Source/Homepage:\n http://github.com/jsbronder/fzsl\n\n.. _ctrlp: https://github.com/kien/ctrlp.vim", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/jsbronder/fzsl", "keywords": "fuzzy shell search console match ncurses", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "fzsl", "package_url": "https://pypi.org/project/fzsl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/fzsl/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/jsbronder/fzsl" }, "release_url": "https://pypi.org/project/fzsl/0.4/", "requires_dist": null, "requires_python": null, "summary": "Fuzzy path searching for shells", "version": "0.4" }, "last_serial": 1942775, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2b630d05522b65dcf6950a8e99e64caa", "sha256": "bcd506e8b6cd6625c36d406c0e3d7c38f3808fe6fd656c983889f29df0670a8d" }, "downloads": -1, "filename": "fzsl-0.1.tar.gz", "has_sig": false, "md5_digest": "2b630d05522b65dcf6950a8e99e64caa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17977, "upload_time": "2014-10-10T22:01:26", "url": "https://files.pythonhosted.org/packages/a7/54/be9c836ef9f574e8a5af44ad1aca6efe3759bc3edc3217947f75232f7f0a/fzsl-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "b4a1d417b50f9c58d3c13ab06b95f8e0", "sha256": "995fc6bae39b927b75722e5bb6d6be46616b55533d04ac843bc4bae4d702eda0" }, "downloads": -1, "filename": "fzsl-0.2.tar.gz", "has_sig": false, "md5_digest": "b4a1d417b50f9c58d3c13ab06b95f8e0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20147, "upload_time": "2015-02-27T06:08:38", "url": "https://files.pythonhosted.org/packages/39/92/b4b02ec6ed90944274b82b83f7856e9447b816dd34f20ccb6d2595394278/fzsl-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "b9a0fa00080d97740a8f13980959705c", "sha256": "40c8abbdf36d7c422f7ad738437b956726cc6c40107b2b892d97c4535c0b7eb7" }, "downloads": -1, "filename": "fzsl-0.3.tar.gz", "has_sig": false, "md5_digest": "b9a0fa00080d97740a8f13980959705c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20269, "upload_time": "2015-04-06T19:01:58", "url": "https://files.pythonhosted.org/packages/fa/4c/e4fa4f95eb2365e209e63817513081383f041fa33cfc2d760cc272103aad/fzsl-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "f113fabb43f066bdb8a61f1bddafb16c", "sha256": "07d55397c5a1df6402c97b366767c4e238454ab34e002cadf70494dcade32093" }, "downloads": -1, "filename": "fzsl-0.4.tar.gz", "has_sig": false, "md5_digest": "f113fabb43f066bdb8a61f1bddafb16c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20329, "upload_time": "2016-02-06T05:58:24", "url": "https://files.pythonhosted.org/packages/95/1c/6d758c264c1925ad3ab91b9d7f95cd827711dc76fb909007efa14a13bdbc/fzsl-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f113fabb43f066bdb8a61f1bddafb16c", "sha256": "07d55397c5a1df6402c97b366767c4e238454ab34e002cadf70494dcade32093" }, "downloads": -1, "filename": "fzsl-0.4.tar.gz", "has_sig": false, "md5_digest": "f113fabb43f066bdb8a61f1bddafb16c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20329, "upload_time": "2016-02-06T05:58:24", "url": "https://files.pythonhosted.org/packages/95/1c/6d758c264c1925ad3ab91b9d7f95cd827711dc76fb909007efa14a13bdbc/fzsl-0.4.tar.gz" } ] }