-
Notifications
You must be signed in to change notification settings - Fork 44
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
Added IPython debugger #26
base: master
Are you sure you want to change the base?
Conversation
Thank you for your pull request, it's much appreciated. Here are a few comments:
|
Thank you for the response and valuable comments. I fixed all the point raised in the first PR submission. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't have time to test that now, but here are some comments.
README.rst
Outdated
@@ -6,6 +6,10 @@ handler. By default it opens the debugger on port 4444:: | |||
|
|||
import rpdb; rpdb.set_trace() | |||
|
|||
For using IPython debugger | |||
|
|||
import rpdb; rpdb.set_trace(IPython=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be lower-cased too.
rpdb/__init__.py
Outdated
from IPython.core.debugger import Pdb | ||
IPYTHON_ENABLE = True | ||
except ImportError: | ||
IPYTHON_ENABLE = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not ENABLE
as much as it is AVAILABLE
, also I don't think this should be all upper-cased since this is more variable than it is constant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I would probably import it as IPdb to avoid confusion lower in the file.
rpdb/__init__.py
Outdated
"""Initialize the socket and initialize pdb.""" | ||
|
||
# Backup stdin and stdout before replacing them by the socket handle | ||
self.old_stdout = sys.stdout | ||
self.old_stdin = sys.stdin | ||
self.port = port | ||
|
||
self.debugger = Pdb if ipython and IPYTHON_ENABLE else pdb.Pdb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone has ipython == True
but the check variable is False, this is silently going to revert to Pdb, I'm okay with that, but I think it should be in the README.
@tamentis is README the only blocker for this PR? I can help with that , it is very useful option |
I tried both Python 3.7 and 2.7 and couldn't get this to work. Am I doing anything wrong? Test script (test.py):
Terminal 1:
Terminal 2:
|
It works for me with python 3.6.10
However, auto-completion does not work ;) |
I use this library nearly daily and I just wanted to add this debugger for having debugger command history when I debug.