Skip to content

urwid: Use correct repl #362

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

Merged
merged 1 commit into from
Aug 27, 2014
Merged

urwid: Use correct repl #362

merged 1 commit into from
Aug 27, 2014

Conversation

lu-zero
Copy link
Contributor

@lu-zero lu-zero commented Aug 25, 2014

repl is imported from bpython, myrepl is the actual object.

repl is imported from bpython, myrepl is the actual object.
thomasballinger added a commit that referenced this pull request Aug 27, 2014
@thomasballinger thomasballinger merged commit efb3174 into bpython:master Aug 27, 2014
@thomasballinger
Copy link
Member

Nice - now using a banner doesn't crash bpython-urwid! Thanks!

@lu-zero
Copy link
Contributor Author

lu-zero commented Aug 27, 2014

Next is making possible to use urwid in embed. (locally patched this way to
have flask-script using it since works much better on some terminals.

On Wed, Aug 27, 2014 at 4:22 AM, Thomas Ballinger notifications@github.com
wrote:

Nice - now using a banner doesn't crash bpython-urwid! Thanks!


Reply to this email directly or view it on GitHub
#362 (comment).

@lu-zero
Copy link
Contributor Author

lu-zero commented Aug 27, 2014

def embed(locals_=None, args=['-i', '-q'], banner=None, impl='cli'):
    package="bypthon.{0}".format(impl)
    bpython = __import__(package, globals(), locals(), [main], -1)
    return bpython.main(args, locals_, banner)

Something along those lines would be ok for you?

@thomasballinger
Copy link
Member

This seems pretty reasonable, although I'm not sure I understand all of what you're proposing - I assume you want a function you can call to run a bpython session with the current scope, and you want to package it with bpython. I'm all for both of those ideas, and the approach above seems good.

You're welcome to continue with this (and I think you should!) but know that soon we're soon going to be changing the way frontends work in bpython and packaging them separately - @ikanobori is undertaking this so knows more about it. I just mean to say that the interface for using a different interpreter is going to change soon and will be different new releases.

@lu-zero
Copy link
Contributor Author

lu-zero commented Aug 27, 2014

Actually the start of the whole deal is wanting flask-script working fine with iterm2 and terminology since they are the terminals I use most, then I found out that the urwid backend seems working well enough and forced embed() to use it directly, discovering that small bug =)

(curtsies support seems requiring an update to support the new version of it)

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

Successfully merging this pull request may close these issues.

2 participants