Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for IPython 5.0 #13

Closed
idletea opened this issue Jul 13, 2016 · 3 comments
Closed

Update for IPython 5.0 #13

idletea opened this issue Jul 13, 2016 · 3 comments

Comments

@idletea
Copy link

idletea commented Jul 13, 2016

The new prompts system in IPython 5.0 renders this unrunnable. Some other issues have prevented me getting a full PR for this, but the gist of what needs to change is that

    pm = ipshell.prompt_manager
    bold_prmpt = '{color.number}' '{tt}' '{color.prompt}'
    pm.in_template = "'{}' selected >>> ".format(bold_prmpt)
    # don't rjustify with preceding 'in' prompt
    pm.justify = False

Needs to be replaced with the new crap, and the basics for how to replace the input prompt would be to add on to the plugin.py with something like:

from IPython.terminal.prompts import Prompts, Token
...

class PytestPrompt(Prompts):
    def in_prompt_tokens(self, cli=None):
        return [
            (Token.Prompt, '{color.number}'),
            (Token.PromptNum, '{tt}'),
            (Token.Prompt, ' selected >>> '),
        ]


class PytestShellEmbed(InteractiveShellEmbed):
    """Custom ip shell with a slightly altered exit message
    """
    prompts_class = PytestPrompt
    ...
@goodboy
Copy link
Owner

goodboy commented Jul 26, 2016

Thanks @dtkerr!

Yeah looks like this spot in the docs is a good starting point to begin revamping the whole thing.

I've also wanted to take a look at fuzzy matching (#5) so playing with pythonpt directly might be a good way to go as well.

goodboy pushed a commit that referenced this issue Aug 2, 2016
We don't support Ipython 5 (yet) so reflect this in the deps.
This also acts as a stopgap for #13.
@goodboy
Copy link
Owner

goodboy commented Sep 7, 2016

goodboy pushed a commit that referenced this issue Sep 17, 2016
Ports to the new prompts API and cleans up a few aesthetic things.

Resolves #13
goodboy pushed a commit that referenced this issue Sep 17, 2016
Ports to the new prompts API and cleans up a few aesthetic things.

Resolves #13
@goodboy
Copy link
Owner

goodboy commented Sep 17, 2016

@dtkerr Think I nailed it.
Give it a try and let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants