# HG changeset patch # User morphbr # Date 1183536588 -3600 # Node ID 7cd98c74da225234cc433e3ff5480b4f2e2653dc # Parent 366b0fd1eead9d92f0ce6f09468904b19e7cab89 [svn r781] - More bug fixes to file_info diff -r 366b0fd1eead -r 7cd98c74da22 gmyth-stream/server/0.3/lib/file_handler.py --- a/gmyth-stream/server/0.3/lib/file_handler.py Wed Jul 04 08:38:36 2007 +0100 +++ b/gmyth-stream/server/0.3/lib/file_handler.py Wed Jul 04 09:09:48 2007 +0100 @@ -8,6 +8,7 @@ import os import sys import pickle +import logging import lib.utils as utils from stat import * @@ -18,6 +19,7 @@ class TranscodedFile(object): """This class creates and reads information about transcoded files.""" opts = {} + log = logging.getLogger("gms.file_handler") def __init__(self, filename, args): if filename == "" or not os.path.exists(filename): @@ -28,7 +30,7 @@ self.opts["uri"][0]) name = os.path.basename(self.opts["uri"][0]) - self.opts["original"] = name + self.opts["original"] = ["%s"] % name output_file = os.path.basename(self.opts["outfile"][0]) output = open(".transcoded/%s.dat" % \ os.path.splitext(output_file)[0], "wb") @@ -36,7 +38,7 @@ pickle.dump(self.opts, output, -1) output.close() else: - name = os.path.basename(filename) + name = os.path.splitext(os.path.basename(filename))[0] pkl_file = open(".transcoded/%s.dat" % name, "rb") self.opts = pickle.load(pkl_file) # __init__() diff -r 366b0fd1eead -r 7cd98c74da22 gmyth-stream/server/0.3/lib/request_handler.py --- a/gmyth-stream/server/0.3/lib/request_handler.py Wed Jul 04 08:38:36 2007 +0100 +++ b/gmyth-stream/server/0.3/lib/request_handler.py Wed Jul 04 09:09:48 2007 +0100 @@ -340,9 +340,10 @@ self.end_headers() try: - opts = files.TranscodedFile(filename, self.query).opts + opts = files.TranscodedFile(file_dat[0], self.query).opts for key in opts.keys(): - self.wfile.write("%s=%s
" % (key, opts.get(key, "None"))) + self.wfile.write("%s=%s
" % (key, opts.get(key, "None")[0])) + except Exception, e: self.send_error(500, str(e)) return diff -r 366b0fd1eead -r 7cd98c74da22 gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py --- a/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Wed Jul 04 08:38:36 2007 +0100 +++ b/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py Wed Jul 04 09:09:48 2007 +0100 @@ -60,7 +60,7 @@ self._insert_param("-o", "file://%s" % path) else: self._insert_param ("-o", "fd://%d" % outfd.fileno()) - self.opts.append ("-c") + self.opts.append ("-c") cmd = " ".join(self.opts) self.log.info(self.tid, "GMencoder: %s" % cmd)