# HG changeset patch # User morphbr # Date 1180627971 -3600 # Node ID 72f9152d4e2a193c0986840131846f393ba934ac # Parent 6431b16e18fb799e9496cbf5fce7e294c38a237f [svn r733] * GMyth-Streamer - Bug fix for listing transcoded files diff -r 6431b16e18fb -r 72f9152d4e2a gmyth-stream/server/0.3/lib/file_handler.py --- a/gmyth-stream/server/0.3/lib/file_handler.py Thu May 31 16:09:47 2007 +0100 +++ b/gmyth-stream/server/0.3/lib/file_handler.py Thu May 31 17:12:51 2007 +0100 @@ -6,6 +6,7 @@ __version__ = "0.1" import os +import sys import pickle import lib.utils as utils @@ -23,13 +24,14 @@ self.opts = args.copy() if self.opts["type"][0] != "myth": - self.opts["original_mtime"] = os.stat( - self.opts["uri"][0])[ST_MTIME] + self.opts["original_mtime"] = os.path.getmtime( + self.opts["uri"][0]) name = os.path.basename(self.opts["uri"][0]) self.opts["original"] = name + output_file = os.path.basename(self.opts["outfile"][0]) output = open(".transcoded/%s.dat" % \ - os.path.basename(self.opts["outfile"][0]), "wb") + os.path.splitext(output_file)[0], "wb") # dumps data using the highest protocol pickle.dump(self.opts, output, -1) output.close() @@ -65,8 +67,11 @@ for root, dirs, files in os.walk(directory): for name in files: if os.path.splitext(name)[1].strip(".") in ext: - dat_file = os.path.join(root,name.split(".")[0]+".dat") - if name not in file_list and os.path.exists(dat_file): + dat_file = os.path.join(sys.path[0],root, + os.path.splitext(name)[0]+".dat") + + if name not in file_list and \ + os.path.exists(dat_file): file_list.append(name) return True