Ignore:
Timestamp:
Jun 25, 2009, 3:15:28 PM (15 years ago)
Author:
rwilson
Message:

Fixed bug and tried to make processes run with same python that started main file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/automated_validation_tests/patong_beach_validation/validate.py

    r7196 r7267  
    1313import time
    1414import shutil
     15import platform
    1516
    1617from anuga.utilities.system_tools import get_web_file, untar_file, file_length
     
    6566OUTPUT_SWW = 'patong.sww'
    6667
     68# default name of python to run
     69PythonName = 'python'
     70
    6771
    6872def setup():
     
    281285    # modify project.py template
    282286    log.debug("Creating '%s' version of project.py" % vtype)
    283     fd = open('project.py.template', 'r')
     287    fd = open('project_template.py', 'r')
    284288    project = fd.readlines()
    285289    fd.close()
     
    298302    # run the simulation, produce SWW file
    299303    log.info('Running the simulation ...')
    300     cmd = 'python run_model.py > %s' % RUNMODEL_STDOUT
     304    cmd = '%s run_model.py > %s' % (PythonName, RUNMODEL_STDOUT)
    301305    log.debug("run_simulation: doing '%s'" % cmd)
    302306    res = os.system(cmd)
     
    345349    # compare SWW files here and there
    346350    new_output_sww = os.path.join(output_directory, expected_sww)
    347     cmd = 'python cmpsww.py %s %s > cmpsww.stdout' % (local_sww, new_output_sww)
     351    cmd = '%s cmpsww.py %s %s > cmpsww.stdout' % (PythonName, local_sww, new_output_sww)
    348352    log.debug("check_that_output_is_as_expected: doing '%s'" % cmd)
    349353    res = os.system(cmd)
     
    376380# Mainline - run the simulation, check output.
    377381################################################################################
     382
     383# determine what python we are, initialize PythonName
     384py_tuple = platform.python_version_tuple()
     385PythonName = 'python%s.%s' % (py_tuple[0], py_tuple[1])
    378386
    379387# set logging levels
Note: See TracChangeset for help on using the changeset viewer.