[z3-checkins] r29773 - z3/deliverance/branches/namespaced

paul at codespeak.net paul at codespeak.net
Fri Jul 7 19:26:15 CEST 2006


Author: paul
Date: Fri Jul  7 19:26:13 2006
New Revision: 29773

Added:
   z3/deliverance/branches/namespaced/favicon.ico   (contents, props changed)
Modified:
   z3/deliverance/branches/namespaced/ThemedHTTPServer.py
Log:
Favicon support

Modified: z3/deliverance/branches/namespaced/ThemedHTTPServer.py
==============================================================================
--- z3/deliverance/branches/namespaced/ThemedHTTPServer.py	(original)
+++ z3/deliverance/branches/namespaced/ThemedHTTPServer.py	Fri Jul  7 19:26:13 2006
@@ -11,6 +11,7 @@
 __all__ = ["ThemedHTTPRequestHandler"]
 
 import os
+import mimetypes
 import BaseHTTPServer
 import SimpleHTTPServer
 from StringIO import StringIO
@@ -70,6 +71,16 @@
         self.send_header("Content-Length", responsesize)
         self.end_headers()
         return f
+
+    extensions_map = mimetypes.types_map.copy()
+    extensions_map.update({
+        '': 'application/octet-stream', # Default
+        '.py': 'text/plain',
+        '.c': 'text/plain',
+        '.h': 'text/plain',
+        '.ico': 'image/x-icon',
+        })
+
     
 
 def test(HandlerClass = ThemedHTTPRequestHandler,

Added: z3/deliverance/branches/namespaced/favicon.ico
==============================================================================
Binary file. No diff available.


More information about the z3-checkins mailing list