Index: albatross/httpdapp.py
===================================================================
--- albatross/httpdapp.py	(revision 109)
+++ albatross/httpdapp.py	(working copy)
@@ -8,8 +8,11 @@
 
 import BaseHTTPServer
 import cgi
+import mimetypes
 from cStringIO import StringIO
 from urlparse import urlsplit
+import os.path
+import shutil
 
 
 class Request:
@@ -116,12 +119,19 @@
     """
 
     def do_GET(self):
+        # Try the static resources first
+        for uri_path, fs_path in self.server.static_resources.items():
+            if self.path.startswith(uri_path):
+                path = self.path.split(uri_path)[1]
+                self.send_file('%s%s' % (fs_path, path))
+                return
         self.process_request()
 
     def do_POST(self):
         self.process_request()
 
     def process_request(self):
+        '''Process a request to the Albatross app'''
         self.log_request()
         req = Request(self)
         self.server.app.run(req)
@@ -132,11 +142,48 @@
         if req.status() == 200:
             self.wfile.write(req.data.getvalue())
 
+    def send_file(self, path):
+        '''Send a file directly from the filesystem'''
+        
+        self.log_request()
+        
+        f = None
 
+        try:
+            try:
+                f = file(path, 'rb')
+                self.send_response(200)
+                self.send_header('Content-Type', mimetypes.guess_type(path)[0])
+                self.send_header('Content-Length', os.path.getsize(path))
+                self.end_headers()
+                shutil.copyfileobj(f, self.wfile)
+            except IOError, e:
+                self.send_response(404, self.responses[404])
+                self.end_headers()
+        finally:
+            if f:
+                f.close()
+
+
 class HTTPServer(BaseHTTPServer.HTTPServer):
 
-    """Simple, standalone HTTP server for Albatross applications."""
+    """
+    Simple, standalone HTTP server for Albatross applications.
+    
+    HTTPServer is a simple web server dedicated to processing requests and
+    mapping that request through to Albatross. It can also serve static
+    resources such as images, stylesheets etc directly from the filesystem.
+    """
 
-    def __init__(self, app, port):
-        BaseHTTPServer.HTTPServer.__init__(self, ('', port), RequestHandler)
+    def __init__(self, app, port, static_resources={}):
+        '''
+        Create an HTTP server for the Albatross application, app,
+        and listen for requests on the specified port.
+
+        static_resources is an optional dictionary that maps uri paths to
+        a corresponding filesystem path. Static resources are served directly
+        from the filesystem without involving the Albatross application.
+        '''
+        BaseHTTPServer.HTTPServer.__init__( self, ('', port), RequestHandler)
         self.app = app
+        self.static_resources = static_resources
