{"action":"created","issue":{"url":"https://api.github.com/repos/pydy/pydy/issues/326","repository_url":"https://api.github.com/repos/pydy/pydy","labels_url":"https://api.github.com/repos/pydy/pydy/issues/326/labels{/name}","comments_url":"https://api.github.com/repos/pydy/pydy/issues/326/comments","events_url":"https://api.github.com/repos/pydy/pydy/issues/326/events","html_url":"https://github.com/pydy/pydy/pull/326","id":131399860,"number":326,"title":"Run visualization server in background thread","user":{"login":"oliverlee","id":2965031,"avatar_url":"https://avatars.githubusercontent.com/u/2965031?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverlee","html_url":"https://github.com/oliverlee","followers_url":"https://api.github.com/users/oliverlee/followers","following_url":"https://api.github.com/users/oliverlee/following{/other_user}","gists_url":"https://api.github.com/users/oliverlee/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverlee/subscriptions","organizations_url":"https://api.github.com/users/oliverlee/orgs","repos_url":"https://api.github.com/users/oliverlee/repos","events_url":"https://api.github.com/users/oliverlee/events{/privacy}","received_events_url":"https://api.github.com/users/oliverlee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-04T16:26:00Z","updated_at":"2016-02-11T18:06:19Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/pydy/pydy/pulls/326","html_url":"https://github.com/pydy/pydy/pull/326","diff_url":"https://github.com/pydy/pydy/pull/326.diff","patch_url":"https://github.com/pydy/pydy/pull/326.patch"},"body":"This PR runs the visualization server in a background thread instead of the main thread. An option to skip launching the web browser has also been added for debugging.\r\n\r\nThis will make testing the server easier as the server be easily stopped."},"comment":{"url":"https://api.github.com/repos/pydy/pydy/issues/comments/182982198","html_url":"https://github.com/pydy/pydy/pull/326#issuecomment-182982198","issue_url":"https://api.github.com/repos/pydy/pydy/issues/326","id":182982198,"user":{"login":"oliverlee","id":2965031,"avatar_url":"https://avatars.githubusercontent.com/u/2965031?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverlee","html_url":"https://github.com/oliverlee","followers_url":"https://api.github.com/users/oliverlee/followers","following_url":"https://api.github.com/users/oliverlee/following{/other_user}","gists_url":"https://api.github.com/users/oliverlee/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverlee/subscriptions","organizations_url":"https://api.github.com/users/oliverlee/orgs","repos_url":"https://api.github.com/users/oliverlee/repos","events_url":"https://api.github.com/users/oliverlee/events{/privacy}","received_events_url":"https://api.github.com/users/oliverlee/received_events","type":"User","site_admin":false},"created_at":"2016-02-11T18:06:19Z","updated_at":"2016-02-11T18:06:19Z","body":"You can test server stop in Windows with something like this:\r\n```python\r\nimport io\r\nimport os\r\nimport sys\r\nimport win32api\r\nimport win32con\r\nfrom pydy.viz.server import Server\r\n\r\ntest_server = Server(directory=<somedir>,\r\n                     scene_file=\"static/js/tests/sample_data/scene_desc.json\")\r\ntest_server.run_server(headless=True)\r\nsys.stdin = io.StringIO('y')\r\nwin32api.GenerateConsoleCtrlEvent(win32con.CTRL_C_EVENT, 0)\r\n```\r\nHowever the signal is not handled correctly when I run it with ```nosetests```."}}