File: kwsysDateStamp.py

package info (click to toggle)
gccxml 0.9.0%2Bcvs20100501-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 79,132 kB
  • ctags: 73,371
  • sloc: ansic: 751,436; cpp: 34,175; asm: 26,833; sh: 5,077; makefile: 4,696; lex: 589; awk: 566; perl: 334; yacc: 271; pascal: 86; python: 29
file content (54 lines) | stat: -rwxr-xr-x 1,950 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/python
#=============================================================================
# KWSys - Kitware System Library
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================

import sys,os
import time

# Get the path to the directory containing this script.
if __name__ == '__main__':
    selfdir = os.path.abspath(sys.path[0] or os.curdir)
else:
    selfdir = os.path.abspath(os.path.dirname(__file__))

# Open the CMake code file.
fname = os.path.join(selfdir, 'kwsysDateStamp.cmake')
fout = open(fname, 'w');

# Get the current time.
ct = time.localtime()

# Write the CMake code describing the date.
fout.write("""# Do not edit!  Generated by kwsysDateStamp.py
#=============================================================================
# KWSys - Kitware System Library
# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================

# KWSys version date year component.  Format is CCYY.
SET(KWSYS_DATE_STAMP_YEAR  %04u)

# KWSys version date month component.  Format is MM.
SET(KWSYS_DATE_STAMP_MONTH %02u)

# KWSys version date day component.  Format is DD.
SET(KWSYS_DATE_STAMP_DAY   %02u)
""" % (ct.tm_year, ct.tm_mon, ct.tm_mday))

fout.close()