WebSocket: pywebsocket 0.5
authorukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 08:52:06 +0000 (08:52 +0000)
committerukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 08:52:06 +0000 (08:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=38034

Reviewed by David Levin.

Remove pywebsocket from webkitpy/thirdparty.
Make pywebsocket autoinstalled.

* Scripts/new-run-webkit-websocketserver:
  Add --output-dir option.
* Scripts/old-run-webkit-tests:
  Use new-run-webkit-websocketserver, rather than directly run pywebsocket's standalone.py
* Scripts/run-webkit-websocketserver:
  Ditto.
* Scripts/webkitpy/layout_tests/port/websocket_server.py:
  Use autoinstalled pywebsocket.
* Scripts/webkitpy/thirdparty/__init__.py:
  Autoinstall pywebsocket
* Scripts/webkitpy/thirdparty/pywebsocket: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59353 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitTools/ChangeLog
WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py

index 07e3976..0dc8ca6 100644 (file)
@@ -1,13 +1,5 @@
 2010-05-13  Fumitoshi Ukai  <ukai@chromium.org>
 
-        Unreviewed fix.
-
-        On tiger bot, it claims syntax error for with statement.
-
-        * Scripts/webkitpy/layout_tests/port/websocket_server.py: rewrite with statement with try-finally.
-
-2010-05-13  Fumitoshi Ukai  <ukai@chromium.org>
-
         Reviewed by David Levin.
 
         WebSocket: pywebsocket 0.5
index 2a5b3f5..55868fa 100644 (file)
@@ -30,6 +30,8 @@
 """A class to help start/stop the PyWebSocket server used by layout tests."""
 
 
+from __future__ import with_statement
+
 import codecs
 import logging
 import optparse
@@ -236,11 +238,8 @@ class PyWebSocket(http_server.Lighttpd):
             raise PyWebSocketNotStarted(
                 'Failed to start %s server.' % self._server_name)
         if self._pidfile:
-            file = codecs.open(self._pidfile, "w", "ascii")
-            try:
+            with codecs.open(self._pidfile, "w", "ascii") as file:
                 file.write("%d" % self._process.pid)
-            finally:
-                file.close()
 
     def stop(self, force=False):
         if not force and not self.is_running():
@@ -250,11 +249,8 @@ class PyWebSocket(http_server.Lighttpd):
         if self._process:
             pid = self._process.pid
         elif self._pidfile:
-            file = codecs.open(self._pidfile, "r", "ascii")
-            try:
+            with codecs.open(self._pidfile, "r", "ascii") as file:
                 pid = int(file.read().strip())
-            finally:
-                file.close()
 
         if not pid:
             raise PyWebSocketNotFound(