This software is a Python readline interface that prioritizes completion. It allows users to improve their productivity and reduce errors by suggesting completions as they type.
The generator component is a factory responsible for turning any callable into a completion entry function that you can provide to readline. Furthermore, the print_exc component is a decorator capable of printing exceptions to stderr, which is incredibly useful when writing Python completions and hooks since exceptions occurring there are usually swallowed by in-between C code. For more details on the API, refer to the API Documentation.
Suppose you need to implement a system command completion similar to bash. In that case, the example code provided below can come in handy. It imports os and utilizes the completer and generator components to configure completion functions and handle TAB completion. Moreover, the package's examples subdirectory houses more examples to explore.
The rl module is available for public access on GitHub for development ease. Before attempting to build rl, you must first install libreadline5-dev (or equivalent) on Linux. Mac OS X users require a Python built with MacPorts or Fink, as the system Python is linked to the BSD editline library and not GNU readline. In addition, rl requires distribute >= 0.6.6, and if you have not upgraded setuptools yet, type "/path/to/easy_install distribute." Finally, type "/path/to/easy_install rl" and observe the console. When it reads "Finished processing dependencies for rl," you are done, and rl is ready to use.
Version 1.0: N/A