/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/version.py
ViewVC logotype

Annotation of /branches/WIP-pyshapelib-bramz/Thuban/version.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1288 - (hide annotations)
Mon Jun 23 10:47:44 2003 UTC (21 years, 8 months ago) by jonathan
Original Path: trunk/thuban/Thuban/version.py
File MIME type: text/x-python
File size: 1775 byte(s)
Temporarily update longversion for
        the 0.8 release so that it doesn't have the cvs revision.

1 frank 922 #!/usr/bin/env python
2     #
3     # Copyright (C) 2002, 2003 by Intevation GmbH
4     # Authors:
5     # Thomas Koester <[email protected]>
6     # Frank Koormann <[email protected]>
7     #
8     # This program is free software under the GPL (>=v2)
9     # Read the file COPYING coming with the software for details.
10    
11     """
12     Thuban version information
13     """
14    
15     __version__ = "$Revision$"
16     # $Source$
17     # $Id$
18    
19    
20     version = 'cvs'
21     append_date = 1
22    
23    
24     import os, os.path
25     import time
26    
27     if __name__ == "__main__":
28     import sys
29     __file__ = sys.argv[0]
30    
31     def is_relevant_file(file):
32     """check if a file is relevant for determining the current version"""
33     extensions = ['.py', '.xpm', '.c', '.h']
34     return os.path.isfile(file) and os.path.splitext(file)[1] in extensions
35    
36     def visit(args, dirname, names):
37     """helper for os.path.walk; save mtime of newest file for this directory"""
38     files = filter(is_relevant_file,
39     [os.path.join(dirname, file) for file in names])
40     args['max'] = max([args['max']] + map(os.path.getmtime, files))
41    
42     def get_date(format):
43     """strftime formatted mtime of the newest relevant file"""
44     dir = os.path.dirname(os.path.abspath(__file__))
45     args = {'max': 0}
46     os.path.walk(dir, visit, args)
47     return time.strftime(format, time.localtime(args['max']))
48    
49     def get_changelog_date():
50     changelog = os.path.join(os.path.dirname(__file__), os.pardir, "ChangeLog")
51 frank 925 try:
52     file = open(changelog, "r")
53     line = file.readline()
54     file.close()
55     except:
56     return ""
57     return '\n ChangeLog %s' % line.split(" ")[0]
58 frank 922
59     if append_date:
60     version = '%s-%s' % (version, get_date('%Y%m%d'))
61 jonathan 1288 #longversion = '%s%s' % (version, get_changelog_date())
62     longversion = 'Release Version 0.8'
63 frank 922
64     if __name__ == "__main__":
65     print longversion

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26