quantopian / qdb

Quantopian Remote Debugger for Python
Apache License 2.0
315 stars 115 forks source link

Terminal command manager #29

Closed llllllllll closed 9 years ago

llllllllll commented 9 years ago

This branch is cut off of the py3 branch (#27)

ssanderson commented 9 years ago

README.md references sending pickled messages which is no longer true.

llllllllll commented 9 years ago

cleaned up the readme

ssanderson commented 9 years ago

@llllllllll this looks reasonable to me. Some high-level comments that could be addressed in the future, but don't necessarily block this PR.

  1. The model of having the tracer tell the command manager to drive the tracer feels strange to me. It means that when I call next_command in the tracer, I have no way to determine how many messages were received or what happened in the elapsed time. I think a more straightforward design would be to have the command manager just receive messages from the frontend and translate them into the tracer's API.
  2. w/r/t the terminal manager specifically, it'd be awesome to use pygments and/or some fancier terminal controls to make this feel more like an application rather than a program that prints a lot of stuff (I just watched thomas ballinger's PyCon talk about this).
  3. Using this for a bit in sticky mode, I was confused by the fact that the watch list and any displayed stdout gets printed before re-painting the current line. On multiple occasions, I stepped over a print and thought it hadn't printed, only to scroll up and see that the print was drowned out by the rest of the file. Simply swapping the order of printing probably isn't the right answer here either, because if you print a big expression it will drown out the sticky print. Some sort of columnar layout and/or designated std{out,err} location is probably the optimal solution here.
llllllllll commented 9 years ago

I totally agree that there is room to update the terminal command manager to use curses and do more fun stuff. I think that I will treat these as feature requests and add them in the future when I have time. While it might not be the best interface, it works now so that is a plus. Regarding the order, I am just not suppressing the prints so it is printing when the execution happens.