|
| 1 | +#!/usr/bin/env python |
| 2 | +############################################################################## |
| 3 | +# |
| 4 | +# diffpy.srreal by DANSE Diffraction group |
| 5 | +# Simon J. L. Billinge |
| 6 | +# (c) 2008 The Trustees of Columbia University |
| 7 | +# in the City of New York. All rights reserved. |
| 8 | +# |
| 9 | +# File coded by: Pavol Juhas |
| 10 | +# |
| 11 | +# See AUTHORS.txt for a list of people who contributed. |
| 12 | +# See LICENSE_DANSE.txt for license information. |
| 13 | +# |
| 14 | +############################################################################## |
| 15 | + |
| 16 | + |
| 17 | +"""Extraction of version data for diffpy.srreal package |
| 18 | +
|
| 19 | +Does not import any extension module unlike the standard version. |
| 20 | +""" |
| 21 | + |
| 22 | +from pkg_resources import resource_filename |
| 23 | +from ConfigParser import RawConfigParser |
| 24 | + |
| 25 | +# obtain version information from the version.cfg file |
| 26 | +cp = RawConfigParser(dict(version='', date='', commit='', timestamp=0)) |
| 27 | +if not cp.read(resource_filename(__name__, 'version.cfg')): |
| 28 | + from warnings import warn |
| 29 | + warn('Package metadata not found, execute "./setup.py egg_info".') |
| 30 | + |
| 31 | +__version__ = cp.get('DEFAULT', 'version') |
| 32 | +__date__ = cp.get('DEFAULT', 'date') |
| 33 | +__gitsha__ = cp.get('DEFAULT', 'commit') |
| 34 | +__timestamp__ = cp.getint('DEFAULT', 'timestamp') |
| 35 | + |
| 36 | +del cp |
| 37 | + |
| 38 | +# End of file |
0 commit comments