# HG changeset patch # User morphbr # Date 1183534399 -3600 # Node ID 361cb0686ff701db4665c9fa68a1af60d8704f3e # Parent 47de5c5976bffc5fc38adecab1befd623abf59f5 [svn r779] - Added serve_file_info method diff -r 47de5c5976bf -r 361cb0686ff7 gmyth-stream/server/0.3/lib/request_handler.py --- a/gmyth-stream/server/0.3/lib/request_handler.py Tue Jul 03 22:45:24 2007 +0100 +++ b/gmyth-stream/server/0.3/lib/request_handler.py Wed Jul 04 08:33:19 2007 +0100 @@ -65,6 +65,7 @@ "/get_all_log.do": self.serve_get_all_log, "/stream.do": self.serve_stream, "/list.do": self.serve_list, + "/get_file_info.do": self.serve_file_info, } try: @@ -326,6 +327,28 @@ self.wfile.write("

") # serve_get_all_log() + + def serve_file_info(self, body): + if body: + + file_dat = self.query.get("file", None) + + if file_dat: + self.send_response(200) + self.send_header("Content-Type", "text/html") + self.send_header('Connection', 'close') + self.end_headers() + + try: + filename = file_dat.split(".dat")[0] + opts = files.TranscodedFile(filename, self.query).opts + for key in opts.keys(): + self.wfile.write("%s=%s
" % (key, opts.get(key, "None"))) + except: + self.send_error(500, str(e)) + return + # serve_file_info() + def serve_stream(self, body): transcoder = self._get_transcoder() try: