Skip to content
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

Merged
merged 13 commits into from
Jun 18, 2015
Merged
Prev Previous commit
Fixed parameters of Server class
  • Loading branch information
sahilshekhawat committed Jun 18, 2015
commit d2e91cd1ee66fcb16329eb433a5b6020f8c93cdc
14 changes: 3 additions & 11 deletions pydy/viz/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,10 @@ class Server(object):
>>> server.run_server()

"""
def __init__(self, scene_file, directory=None, port=None):
def __init__(self, scene_file, directory="static/", port=8000):
self.scene_file = scene_file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion in the previous commit was to have this call sig:

def __init__(scene_file, directory=None, port=8000)

The scene file should be required and the directory can default to the cwd if None is passed in.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add that in my new pr on static directory creation. Trying to make it atomic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is a whole new server code. It seems atomic to add this.


if directory is None:
self.directory = directory
else:
self.directory = "static/"

if port is None:
self.port = port
else:
self.port = 8000
self.port = port
self.directory = directory

def run_server(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if port 8000 is taken?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It throws an error. This needs to be fixed.

# Change dir to static first.
Expand Down