gmyth-stream/server/0.3/lib/request_handler.py
branchtrunk
changeset 743 f92cd43fea7d
parent 742 fe8ddffd7f5c
child 744 ef4fb30176dd
     1.1 --- a/gmyth-stream/server/0.3/lib/request_handler.py	Mon Jun 04 12:30:07 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.3/lib/request_handler.py	Mon Jun 04 19:05:36 2007 +0100
     1.3 @@ -73,6 +73,9 @@
     1.4              action = self.query.get("action", None)
     1.5              if action and "stream.do" in action:
     1.6                  self.serve_stream(body)
     1.7 +            elif os.path.exists("html/%s" % self.path):
     1.8 +                data = open("html/%s" % self.path)
     1.9 +                self.wfile.write(data.read())
    1.10              else:
    1.11                  self.send_error(404, "File not found")
    1.12  
    1.13 @@ -215,6 +218,7 @@
    1.14                  for tid in tids:
    1.15                      stat = self.transcoders_log.get_status(int(tid))
    1.16                      self.wfile.write("%s<br>" % stat)
    1.17 +                return True
    1.18  
    1.19              elif self.query.get("running", None):
    1.20                  for transcoder, request in tl:
    1.21 @@ -329,7 +333,7 @@
    1.22  
    1.23          self.send_response(200)
    1.24          self.send_header("Content-Type", obj.get_mimetype())
    1.25 -        self.send_header('Connection', 'close')
    1.26 +        self.send_header("Connection", "close")
    1.27          self.end_headers()
    1.28  
    1.29          if body:
    1.30 @@ -353,7 +357,7 @@
    1.31                  try:
    1.32                      media = open(self.query.get("uri", None)[0])
    1.33                      self.wfile.write(media.read())
    1.34 -                except Exception:
    1.35 +                except Exception, e:
    1.36                      self.log.error("Stream error: %s" %e)
    1.37      # serve_stream()
    1.38