diff -r 27e83a8f68d7 -r 12a61040588d gmyth-stream/server/lib.py --- a/gmyth-stream/server/lib.py Tue Apr 03 16:42:04 2007 +0100 +++ b/gmyth-stream/server/lib.py Mon Apr 09 15:20:37 2007 +0100 @@ -1,9 +1,25 @@ import time +import logging +import os +import stat 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) - print new_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.exits(path): + st = os.stat(path) + if st[stat.ST_MODE] & 0111: + return path + return "" + +