pydy/pydy-viz

Server needs a graceful shutdown on the command line.

Closed this issue · 3 comments

When the server is runing and I press CTRL-C to shut it down it get this:

request:/js/canvas/animate.js
file path : /home/moorepants/src/pydy-viz/pydy_viz/static/js/canvas/animate.js
sent data
^CTraceback (most recent call last):
  File "illustrative_example.py", line 34, in <module>
    scene.display()
  File "/home/moorepants/src/pydy-viz/pydy_viz/scene.py", line 375, in display
    self._display_from_interpreter()
  File "/home/moorepants/src/pydy-viz/pydy_viz/scene.py", line 346, in _display_from_interpreter
    server.run()
  File "/home/moorepants/src/pydy-viz/pydy_viz/server.py", line 93, in run
    conn, addr = self.socket.accept()
  File "/usr/lib/python2.7/socket.py", line 202, in accept
    sock, addr = self._sock.accept()
KeyboardInterrupt

It should do something more akin to the ipython notebook:

Do you really want to shutdown[y/n]?
pydy-viz shutting down ...

PR #72

Unless the PR is short and sweet you should reference the actual commit that fixes the bug, e.g:

Commit bb22e64 fixes this issue.

PR 72 had irrelevant repeated commits.
This one is short and sweet ..
PR #75