Changeset 9697
- Timestamp:
- Feb 26, 2015, 2:37:54 PM (9 years ago)
- Location:
- trunk/anuga_core
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/anuga/abstract_2d_finite_volumes/util.py
r9615 r9697 22 22 # FIXME (Ole): remove and update scripts where they are used 23 23 from anuga.utilities.system_tools import get_revision_number 24 from anuga.utilities.system_tools import store_ version_info24 from anuga.utilities.system_tools import store_revision_info 25 25 26 26 import anuga.utilities.log as log -
trunk/anuga_core/anuga/config.py
r9693 r9697 10 10 ################################################################################ 11 11 12 epsilon = 1.0e-12 13 max_float = 1.0e36 # Largest number - used to initialise14 15 default_smoothing_parameter = 0.001 16 17 single_precision = 1.0e-6 18 velocity_protection = 1.0e-6 19 20 12 epsilon = 1.0e-12 # Smallest number - used for safe division 13 max_float = 1.0e36 # Largest number - used to initialise 14 # (max, min) ranges 15 default_smoothing_parameter = 0.001 # Default alpha for penalised 16 # least squares fitting 17 single_precision = 1.0e-6 # Smallest single precision number 18 velocity_protection = 1.0e-6 # Used to compute velocity from momentum 19 # See section 7.4 on Flux limiting 20 # in the user manual 21 21 22 22 … … 26 26 27 27 pmesh_filename = '.\\pmesh' 28 #version_filename = 'stored_version_info.py'28 revision_filename = 'revision.py' 29 29 default_datadir = '.' 30 30 time_format = '%d/%m/%y %H:%M:%S' # Used with timefile2netcdf -
trunk/anuga_core/anuga/utilities/system_tools.py
r9677 r9697 19 19 import md5 as hashlib 20 20 21 import anuga.utilities.log as log22 23 21 24 22 def log_to_file(filename, s, verbose=False, mode='a'): … … 96 94 # so will need a better way to get revision number 97 95 98 from anuga. utilities.stored_version_info import version_info99 return process_ version_info(version_info)96 from anuga.revision import revision_info 97 return process_revision_info(revision_info) 100 98 101 99 line = fd.readlines()[3] … … 196 194 """Get the (svn) revision number of this repository copy. 197 195 """ 198 199 from anuga import __svn_revision__ as revision 200 return revision 201 202 203 def process_version_info(version_info): 196 from anuga.revision import revision_info 197 return process_revision_info(revision_info) 198 199 200 def process_revision_info(revision_info): 204 201 205 202 # split revision number from data 206 for line in version_info.split('\n'):203 for line in revision_info.split('\n'): 207 204 if line.startswith('Revision:'): 208 205 break 209 206 210 207 fields = line.split(':') 211 msg = 'Keyword "Revision" was not found anywhere in text: %s' % version_info208 msg = 'Keyword "Revision" was not found anywhere in text: %s' % revision_info 212 209 assert fields[0].startswith('Revision'), msg 213 210 … … 222 219 return revision_number 223 220 224 def store_ version_info(destination_path='.', verbose=False):225 """Obtain current version from Subversion and store it.221 def store_revision_info(destination_path='.', verbose=False): 222 """Obtain current revision from Subversion and store it. 226 223 227 224 Title: store_version_info() … … 256 253 txt = subprocess.Popen('svn info', shell=True, stdout=subprocess.PIPE).communicate()[0] 257 254 except: 258 msg = 'Command "svn" is not recognised on the system PATH' 259 raise Exception(msg) 255 txt = 'Revision: 0' 260 256 else: 261 257 #txt = fid.read() … … 269 265 destination_path += os.sep 270 266 271 filename = destination_path + config. version_filename267 filename = destination_path + config.revision_filename 272 268 273 269 fid = open(filename, 'w') 274 270 275 docstring = 'Stored version info.\n\n'271 docstring = 'Stored revision info.\n\n' 276 272 docstring += 'This file provides the version for distributions ' 277 273 docstring += 'that are not accessing Subversion directly.\n' … … 280 276 fid.write('"""%s"""\n\n' %docstring) 281 277 282 fid.write(' version_info = """\n%s"""' %txt)278 fid.write('revision_info = """\n%s"""' %txt) 283 279 fid.close() 284 280 285 281 286 282 if verbose is True: 287 log.critical('Version info stored to %s' % filename)283 print 'Revision info stored to %s' % filename 288 284 289 285 -
trunk/anuga_core/setup.py
r9688 r9697 124 124 125 125 def setup_package(): 126 127 from anuga.utilities.system_tools import store_revision_info 128 129 store_revision_info(destination_path='anuga') 130 126 131 metadata = dict(name=DISTNAME, 127 132 maintainer=MAINTAINER, … … 150 155 **extra_setuptools_args) 151 156 152 # if (len(sys.argv) >= 2153 # and ('--help' in sys.argv[1:] or sys.argv[1]154 # in ('--help-commands', 'egg_info', '--version', 'clean'))):155 #156 # # For these actions, NumPy is not required.157 # #158 # # They are required to succeed without Numpy for example when159 # # pip is used to install anuga when Numpy is not yet present in160 # # the system.161 # try:162 # from setuptools import setup163 # except ImportError:164 # from distutils.core import setup165 #166 # metadata['version'] = VERSION167 # else:168 # from numpy.distutils.core import setup169 #170 # metadata['configuration'] = configuration171 172 157 173 158
Note: See TracChangeset
for help on using the changeset viewer.