From: notmasteryet Date: Tue, 6 Sep 2011 03:19:20 +0000 (-0500) Subject: Allow test.py serve files with spaces in the name X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=3abe9095564ef0ba4996455a62e537d5f18c67fc;p=pdf.js.git Allow test.py serve files with spaces in the name --- diff --git a/test/test.py b/test/test.py index d1e798d..0d40efb 100644 --- a/test/test.py +++ b/test/test.py @@ -126,14 +126,15 @@ class PDFTestHandler(BaseHTTPRequestHandler): self.wfile.write("

PDFs of " + path + "

\n") for filename in os.listdir(location): if filename.lower().endswith('.pdf'): - self.wfile.write("" + + self.wfile.write("" + filename + "
\n") self.wfile.write("") def do_GET(self): url = urlparse(self.path) # Ignore query string - path, _ = url.path, url.query + path, _ = urllib.unquote_plus(url.path), url.query path = os.path.abspath(os.path.realpath(DOC_ROOT + os.sep + path)) prefix = os.path.commonprefix(( path, DOC_ROOT )) _, ext = os.path.splitext(path.lower())