from k5test import *
import time
-# Return the location of progname in tht executable path, or None if
-# it is not found.
-def which(progname):
- for dir in os.environ["PATH"].split(os.pathsep):
- path = os.path.join(dir, progname)
- if os.access(path, os.X_OK):
- return path
- return None
-
# Run kdbtest against the BDB module.
realm = K5Realm(create_kdb=False)
realm.run(['./kdbtest'])
added newline) in testlog, and write it to stdout if running
verbosely.
+* which(progname): Return the location of progname in the executable
+ path, or None if it is not found.
+
* password(name): Return a weakly random password based on name. The
password will be consistent across calls with the same name.
sys.stdout.write(msg)
+# Return the location of progname in the executable path, or None if
+# it is not found.
+def which(progname):
+ for dir in os.environ["PATH"].split(os.pathsep):
+ path = os.path.join(dir, progname)
+ if os.access(path, os.X_OK):
+ return path
+ return None
+
+
def password(name):
"""Choose a weakly random password from name, consistent across calls."""
return name + str(os.getpid())