mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
python3: wire up more code to polyglot.http_server
This commit is contained in:
parent
8594f52fe8
commit
ea6a210e70
@ -8,9 +8,10 @@ __copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os, shutil, tempfile
|
||||
import SimpleHTTPServer
|
||||
import SocketServer
|
||||
|
||||
from polyglot.http_server import SimpleHTTPRequestHandler
|
||||
|
||||
|
||||
def run_devel_server():
|
||||
base = os.path.dirname(os.path.abspath(__file__))
|
||||
@ -27,7 +28,7 @@ def run_devel_server():
|
||||
with lopen('cfi-test.pyj', 'rb') as f, lopen('cfi-test.js', 'wb') as js:
|
||||
js.write(compile_pyj(f.read()).encode('utf-8'))
|
||||
PORT = 8000
|
||||
Handler = SimpleHTTPServer.SimpleHTTPRequestHandler
|
||||
Handler = SimpleHTTPRequestHandler
|
||||
httpd = SocketServer.TCPServer(("", PORT), Handler)
|
||||
print('Serving CFI test at http://localhost:%d' % PORT)
|
||||
try:
|
||||
@ -37,4 +38,3 @@ def run_devel_server():
|
||||
|
||||
if __name__ == '__main__':
|
||||
run_devel_server()
|
||||
|
||||
|
@ -18,9 +18,9 @@ if sys.version_info.major > 2:
|
||||
file=sys.stderr)
|
||||
raise SystemExit(1)
|
||||
|
||||
import time, BaseHTTPServer, os, sys, re, SocketServer
|
||||
import time, os, sys, re, SocketServer
|
||||
from threading import Lock, local
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
from polyglot.http_server import BaseHTTPServer, SimpleHTTPRequestHandler
|
||||
|
||||
# Compiler {{{
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user