forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[infra] Port serve.py from Python2 to 3
These scripts are useful when testing WebAssembly locally because the mimetype impacts how the binaries are loaded. The porting was achieved by doing the following: python -m lib2to3 -w -n serve.py Change-Id: I09673fa881339a9b157c5fc993e190766efcd85e Reviewed-on: https://skia-review.googlesource.com/c/skia/+/443884 Reviewed-by: Erik Rose <[email protected]>
- Loading branch information
Showing
12 changed files
with
48 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
# Copyright 2020 Google LLC | ||
|
||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8001 | ||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
|
||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
|
||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
|
||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,6 @@ ${BUILD_DIR}/libpathkit.a | |
|
||
if [[ $@ == *serve* ]]; then | ||
pushd $BUILD_DIR | ||
python serve.py | ||
python3 serve.py | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
|
||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
#!/usr/bin/env python3 | ||
# Copyright 2018 Google LLC | ||
|
||
# | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import SimpleHTTPServer | ||
import SocketServer | ||
import http.server | ||
import socketserver | ||
|
||
PORT = 8005 | ||
PORT = 8000 | ||
|
||
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler): | ||
class Handler(http.server.SimpleHTTPRequestHandler): | ||
pass | ||
|
||
Handler.extensions_map['.js'] = 'application/javascript' | ||
# Without the correct MIME type, async compilation doesn't work | ||
Handler.extensions_map['.wasm'] = 'application/wasm' | ||
|
||
httpd = SocketServer.TCPServer(("", PORT), Handler) | ||
httpd = socketserver.TCPServer(("", PORT), Handler) | ||
|
||
httpd.serve_forever() |