ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/build_utils/vstamp.py
Revision: 1.2
Committed: Mon Jan 8 13:38:37 2018 UTC (6 years, 4 months ago) by schorsch
Content type: text/x-python
Branch: MAIN
CVS Tags: rad5R4, rad5R2, rad5R3, HEAD
Changes since 1.1: +4 -2 lines
Log Message:
Updating to SCons 3.x, adding support for Python 3

File Contents

# User Rev Content
1 schorsch 1.2 from __future__ import division, print_function, unicode_literals
2 schorsch 1.1
3     import getpass
4     import socket
5     import time
6    
7     # create a version stamp
8     def build_version_c(target, source, env):
9     s = open (str(source[0]), 'r')
10 schorsch 1.2 radver = s.readline().strip()
11 schorsch 1.1 s.close()
12     date = time.ctime (time.time())
13     user = getpass.getuser()
14     sysname = socket.gethostname()
15     t = open (str(target[0]), 'w')
16     t.write (
17     'char VersionID[]="%s lastmod %s by %s on %s";\n' %
18     (radver, date, user, sysname))
19     t.close()
20    
21 schorsch 1.2 # vi: set ts=4 sw=4 :
22