Code Monkey home page Code Monkey logo

rl's People

Contributors

stefanholek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

tony

rl's Issues

Please help

c1: fatal error C1083: Cannot open source file: 'build/readline/bind.c': No such file or directory

And i can't setup it.

User hook called when menu-complete displays a completion?

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!

Can't import using pip with Python 3.9.12: ERROR: Could not build wheels for rl

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`

Expose default_display_matches_hook

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.

License

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.

We need a set_completion_defaults_hook

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.