]>
Commit | Line | Data |
---|---|---|
e853a9d4 | 1 | #!/usr/bin/env python |
2 | ||
3 | import os, sys, re, getopt, string, glob, xml.dom.minidom, pprint, md5, socket, getpass, time, random | |
4 | ||
5 | def inWorkspace(rel_path=""): | |
6 | """Treat the given path as relative to the workspace.""" | |
7 | ||
8 | # Make sure the user has set the workspace variable: | |
9 | try: | |
10 | return os.path.join(os.environ["WORKSPACE"], rel_path ) | |
11 | except: | |
12 | print "Oops! You must set the WORKSPACE environment variable to run this script." | |
13 | sys.exit() | |
14 | ||
15 | def genguid(): | |
16 | g = md5.md5( | |
17 | str(random.random()) + | |
18 | getpass.getuser() + | |
19 | str(time.time()) + | |
20 | socket.gethostbyname(socket.gethostname())).hexdigest() | |
21 | return "%s-%s-%s-%s-%s" % (g[0:8], g[8:12], g[12:16], g[16:20], g[20:]) |