diff -r 0a4e6b811acc -r 0e159c5e2d32 gmyth-stream/server/0.1/lib.py --- a/gmyth-stream/server/0.1/lib.py Tue Aug 28 15:41:35 2007 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -import time -import logging -import os -import stat - -ext = ['mpg', 'avi', 'mp4', 'nuv', 'mpeg', 'mov'] - -def now(): - return time.strftime("%Y-%m-%d %H:%M:%S"); - -def log(msg): - logging.log(logging.DEBUG, msg) - new_msg = "[%s] %s" % (now(), msg) - return new_msg - - -bin_path_list = os.environ["PATH"].split(os.pathsep) -def which(prg): - for d in bin_path_list: - path = os.path.join(d, prg) - if os.path.exists(path): - st = os.stat(path) - if st[stat.ST_MODE] & 0111: - return path - return "" - -def list_media_files(directory, file_list): - for root, dirs, files in os.walk(directory): - for name in files: - if os.path.splitext(name)[1].strip(".") in ext: - media = os.path.join(root,name) - if media not in file_list: - file_list.append(os.path.join(root,name)) - - return True -