18 lines
441 B
Python
18 lines
441 B
Python
# Bryan Schumaker (5 / 15 / 2011)
|
|
|
|
from BaseHTTPServer import BaseHTTPRequestHandler
|
|
import files
|
|
|
|
class Handler(BaseHTTPRequestHandler):
|
|
def do_GET(self):
|
|
path = files.format_path(self.path)
|
|
if not files.find_file(path):
|
|
self.send_error(404, "File Not Found: %s" % path)
|
|
return
|
|
text, type = files.open_file(path)
|
|
|
|
self.send_response(200)
|
|
self.send_header('Content-type', type)
|
|
self.end_headers()
|
|
self.wfile.write(text)
|