From bb9112fbf028b1a53ac0925a8f7494256cbd4536 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 10 Jan 2012 22:37:18 +0530 Subject: [PATCH] EPUB CFI: Video bookmarking works. Also fix use of coffeescript compiler in threads by deelgating compiling to a worker process, much slower, but doesn't segfault --- src/TestHTTPServer.py | 132 +++++++++++++++++ .../ebooks/oeb/display/test-cfi/birds.mp4 | Bin 1048576 -> 0 bytes .../ebooks/oeb/display/test-cfi/birds.webm | Bin 0 -> 1324945 bytes .../oeb/display/test-cfi/cfi-test.coffee | 2 + .../ebooks/oeb/display/test-cfi/index.html | 7 +- src/calibre/utils/serve_coffee.py | 138 ++++++++++-------- 6 files changed, 214 insertions(+), 65 deletions(-) create mode 100644 src/TestHTTPServer.py delete mode 100644 src/calibre/ebooks/oeb/display/test-cfi/birds.mp4 create mode 100644 src/calibre/ebooks/oeb/display/test-cfi/birds.webm diff --git a/src/TestHTTPServer.py b/src/TestHTTPServer.py new file mode 100644 index 0000000000..35077fe41c --- /dev/null +++ b/src/TestHTTPServer.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai +from __future__ import (unicode_literals, division, absolute_import, + print_function) + +__license__ = 'GPL v3' +__copyright__ = '2011, Kovid Goyal ' +__docformat__ = 'restructuredtext en' + +import os, io +from SimpleHTTPServer import SimpleHTTPRequestHandler + +class HTTPRequestHandler(SimpleHTTPRequestHandler): + ''' + Handle Range headers, as browsers insist on using range for