Multireadline
=============
A wrapper around Python's readline module which makes it easy to have
an arbitrary number of "inputs", each with its own history
Basic Usage
-----------
```
import multireadline as mrl
m = mrl.Multireadline()
m.add_readline(name="band")
m.add_readline(name="album")
m.add_readline(name="year")
while True:
m.get("band")
m.get("album")
m.get("year")
```
Each of the three calls to `get()` will have their own history,
tab-completion lists, and prompts, which will be shown by letting the
loop run for several iterations.
Calls to `add_readline()` may raise exceptions (see below).
See the Tutorial for more information on usage.
### _Nota Bene_
Since `multireadline` is built atop the standard Python bindings for
readline, it does not handle spaces in inputs well. As a workaround,
the internal input list substitutes another character (by default, a
caret) anywhere that a space occurs. So if I enter
`band> Three Dog Night`
then, while my program would get `Three Dog Night` as my input, the
readline history would store`Three^Dog^Night`. This workaround lets
tab-completion work "the right way".
This is an unbeautiful, ungraceful hack, but I'd rather have that (and
working code) than spend several weeks digging into the innards of
readline (without working code).
Exceptions
----------
* `AttributeMissingError` - raised when `name` (or other required
attribute) is not included in a call.
* `IdMissError` - Raised when a name lookup fails
* `IdCollisionError` - Raised when a specified name conflicts with an existing (unique) name
* `ArgConflictError` - Raised when incompatible/impossible argument combinations are given
=============
A wrapper around Python's readline module which makes it easy to have
an arbitrary number of "inputs", each with its own history
Basic Usage
-----------
```
import multireadline as mrl
m = mrl.Multireadline()
m.add_readline(name="band")
m.add_readline(name="album")
m.add_readline(name="year")
while True:
m.get("band")
m.get("album")
m.get("year")
```
Each of the three calls to `get()` will have their own history,
tab-completion lists, and prompts, which will be shown by letting the
loop run for several iterations.
Calls to `add_readline()` may raise exceptions (see below).
See the Tutorial for more information on usage.
### _Nota Bene_
Since `multireadline` is built atop the standard Python bindings for
readline, it does not handle spaces in inputs well. As a workaround,
the internal input list substitutes another character (by default, a
caret) anywhere that a space occurs. So if I enter
`band> Three Dog Night`
then, while my program would get `Three Dog Night` as my input, the
readline history would store`Three^Dog^Night`. This workaround lets
tab-completion work "the right way".
This is an unbeautiful, ungraceful hack, but I'd rather have that (and
working code) than spend several weeks digging into the innards of
readline (without working code).
Exceptions
----------
* `AttributeMissingError` - raised when `name` (or other required
attribute) is not included in a call.
* `IdMissError` - Raised when a name lookup fails
* `IdCollisionError` - Raised when a specified name conflicts with an existing (unique) name
* `ArgConflictError` - Raised when incompatible/impossible argument combinations are given
Metadata
Release files for multireadline 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| multireadline-0.2.0.tar.gz | 6.2 kB | Details |
Release files / multireadline-0.2.0.tar.gz
| Download URL | multireadline-0.2.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
20535188af3e3a2968c30f8226f06fd40d6d5b997df9caac78d38d88105ecb11
|
|
BLAKE2b-256 checksum How to use checksums |
3ca2a95cb647610c2caf21dcf9911e31942eea343f1d2c9ac377739c56e5a32e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |