-
Notifications
You must be signed in to change notification settings - Fork 114
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 shutting down calls to the visualization server #241
Changes from 1 commit
f7474d9
a628c1c
1c09a99
a49c584
52a0bca
8b48732
d2d4940
e47906a
4dd240a
f77b84a
5d99580
63756c3
d2e91cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import sys | ||
import signal | ||
import socket | ||
import webbrowser | ||
|
@@ -103,7 +104,8 @@ def _stop_server(self, signal, frame): | |
|
||
""" | ||
res = raw_input("Shutdown this visualization server ([y]/n)? ") | ||
if res.lower()[0:1] is (None or 'y'): | ||
res = res.lower()[0:1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. res.lower()[0] can be used instead. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup! changing. |
||
if res == '' or res == 'y': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works even for strings like "Yes" |
||
print("Shutdown confirmed") | ||
print("Shutting down server...") | ||
self.httpd.stop() | ||
|
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 will fail in Python 3. Oliver had the fix for this in this file before this PR.
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.
What are the options then, should I use
input()
?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.
See this line: https://github.com/pydy/pydy/blob/master/pydy/viz/scene.py#L26
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.
Got it!