stefanholek / rl Goto Github PK
View Code? Open in Web Editor NEWAlternative Python bindings for GNU Readline
Home Page: https://pypi.org/project/rl/
License: GNU General Public License v3.0
Alternative Python bindings for GNU Readline
Home Page: https://pypi.org/project/rl/
License: GNU General Public License v3.0
c1: fatal error C1083: Cannot open source file: 'build/readline/bind.c': No such file or directory
And i can't setup it.
Is there any way to execute user code each time menu-complete
displays the next completion?
E.g. in the script below, if I hit tab
repeatedly, it cycles through displaying "a" and "b". I would like some of my python code to execute when it displays "a", and when it displays "b".
import rl
def complete(text):
return ['a', 'b']
rl.completer.parse_and_bind('tab: menu-complete')
rl.completer.completer = rl.generator(complete)
raw_input()
In the readline C code I see, e.g. a call to display_matches
(which itself calls rl_completion_display_matches_hook
) in rl_menu_complete
, but I am not entirely sure whether what I want is possible and wanted to check.
Thanks!
When a directory_completion_hook is set, readline always tilde-expands filenames. This means we lose the ability to "set expand-tilde off".
In readline before 5.2 the filename_dequoting_function is protected by a condition we are unable to satisfy, effectively disabling the hook.
I'm trying to import the rl packet using pip install in anaconda prompt(same problem in cmd) but the system can't seem to build a wheel for this package. I am using Python 3.9.12 for this system. I've found out that this problem may occur when the packet is not able to handle my python version. The documentation mentions about the usability of the packet over Python version 2.7 but it does not mention anything about the newest version it can be used in. Is there such a limitation for this package?
If it should work fine with 3.9.12, what may be the problem causing the wheel building error?
Below you can find the full error message:
`error: subprocess-exited-with-error
× Building wheel for rl (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [35 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-cpython-39
creating build\lib.win-amd64-cpython-39\rl
copying rl\testing.py -> build\lib.win-amd64-cpython-39\rl
copying rl\utils.py -> build\lib.win-amd64-cpython-39\rl
copying rl_completion.py -> build\lib.win-amd64-cpython-39\rl
copying rl_history.py -> build\lib.win-amd64-cpython-39\rl
copying rl_init.py -> build\lib.win-amd64-cpython-39\rl
copying rl_init_.py -> build\lib.win-amd64-cpython-39\rl
creating build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\display_matches_hook.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\email.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\factory.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\filename.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\pre_input_hook.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\raw_input.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples\static.py -> build\lib.win-amd64-cpython-39\rl\examples
copying rl\examples_init_.py -> build\lib.win-amd64-cpython-39\rl\examples
running build_ext
WARNING: Failed to detect a termcap library; falling back to ncurses
A subdirectory or file build already exists.
Error occurred while processing: build.
building 'rl.readline' extension
creating build\temp.win-amd64-cpython-39
creating build\temp.win-amd64-cpython-39\Release
creating build\temp.win-amd64-cpython-39\Release\build
creating build\temp.win-amd64-cpython-39\Release\build\readline
creating build\temp.win-amd64-cpython-39\Release\rl
"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DHAVE_CONFIG_H -DRL_LIBRARY_VERSION="8.2" -Ibuild -Ibuild/readline -IC:\Users\egeca\anaconda3\include -IC:\Users\egeca\anaconda3\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcbuild/readline/bind.c /Fobuild\temp.win-amd64-cpython-39\Release\build/readline/bind.obj
bind.c
c1: fatal error C1083: kaynak dosyas\x8d a‡\x8dlam\x8dyor: 'build/readline/bind.c': No such file or directory
error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe' failed with exit code 2
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for rl
Failed to build rl
ERROR: Could not build wheels for rl, which is required to install pyproject.toml-based projects`
The #define has not been updated in readline 6.1. We are therefore currently blocked from implementing the new filename_rewrite_hook.
See snare/voltron#93
What it says. Works in 2.6.
rl 1.5.1 experiences segfaults on Linux under Python 3.1, likely related to Unicode decoding. We are investigating.
I'm trying to write a custom display matches hook, but I'm having a hard time. Basically, I can't get the redisplay(force=True) to work.
I looked at the default implementation, default_display_matches_hook
, and it looks like it is doing some other stuff like clearing control-C, which I would have never even thought of. It would be nice if this function were exposed to the Python API.
Basically, all I want to do with my custom hook is to change what matches are displayed (or, more precisely, to remove a common prefix from each match, so that they aren't so long). In theory, this is as simple as creating a hook that modifies the matches list, subtracts an amount from the longest match length, calls display_match_list
, and then calls redisplay(force=True)
, but as I noted, it doesn't work.
What exactly is the license of this code? The only reference I could find was the trove classifiers in setup.py, which list both GPL and PSF. Is it either or, or are some parts GPL and some parts PSF? Whatever it is, it would help if there were a LICENSE file that explained it.
Readline currently lacks a hook that applications could use to reliably reset their own completion variables. The logical place for such a hook would be in set_completion_defaults.
Decomposed UTF-8 causes problems with accented characters and umlauts, i.e. an "Ä" typed on the console does not have the same representation as an "Ä" occurring in a filename.
http://jace.zaiki.in/2009/10/14/unicode-precomposition-and-decomposition
http://developer.apple.com/mac/library/technotes/tn/tn1150.html#UnicodeSubtleties
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.