Back to index

radiance  4R0+20100331
vstamp.py
Go to the documentation of this file.
00001 
00002 import getpass
00003 import socket
00004 import string
00005 import time
00006 
00007 # create a version stamp
00008 def build_version_c(target, source, env):
00009        s = open (str(source[0]), 'r')
00010        radver = string.strip (s.readline ())
00011        s.close()
00012        date = time.ctime (time.time())
00013        user = getpass.getuser()
00014        sysname = socket.gethostname()
00015        t = open (str(target[0]), 'w')
00016        t.write (
00017               'char VersionID[]="%s lastmod %s by %s on %s";\n' %
00018               (radver, date, user, sysname))
00019        t.close()
00020