gmyth-stream/server/0.2/lib/server.py
branchtrunk
changeset 641 d917eb0698bd
parent 628 c6af9d7a88b5
child 653 3433df0d6ae3
     1.1 --- a/gmyth-stream/server/0.2/lib/server.py	Fri May 04 20:45:38 2007 +0100
     1.2 +++ b/gmyth-stream/server/0.2/lib/server.py	Thu May 10 02:08:13 2007 +0100
     1.3 @@ -80,8 +80,9 @@
     1.4      transcoders = utils.PluginSet(Transcoder)
     1.5  
     1.6      menu = {
     1.7 +        "Stop": "/stop-transcoder.do",
     1.8          "Status": "/status.do",
     1.9 -        "Stop": "/stop-transcoder.do",
    1.10 +        "Version": "/version.do",
    1.11          "Shutdown": "/shutdown.do"
    1.12          }
    1.13  
    1.14 @@ -109,8 +110,8 @@
    1.15              self.serve_stop_transcoder(body)
    1.16          elif self.path == "/status.do":
    1.17              self.serve_status(body)
    1.18 -        elif self.path == "/play.do":
    1.19 -            self.serve_play(body)
    1.20 +        elif self.path == "/version.do":
    1.21 +            self.serve_version(body)
    1.22          elif self.path == "/stream.do":
    1.23              self.serve_stream(body)
    1.24          else:
    1.25 @@ -153,6 +154,14 @@
    1.26              self.wfile.write(utils.getHTML("index", {"menu": self._nav_items()}))
    1.27      # serve_main()
    1.28  
    1.29 +    def serve_version(self, body):
    1.30 +        self.send_response(200)
    1.31 +        self.send_header("Content-Type", "text/html")
    1.32 +        self.send_header('Connection', 'close')
    1.33 +        self.end_headers()
    1.34 +        if body:
    1.35 +            self.wfile.write("Version: %s" %  __version__)
    1.36 +
    1.37  
    1.38      def serve_shutdown(self, body):
    1.39          self.send_response(200)