New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 4140 for branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/run.py – NEMO

Ignore:
Timestamp:
2013-10-25T18:19:03+02:00 (11 years ago)
Author:
andrewryan
Message:

added a command option to allow custom submit commands to be run by the quick start script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/run.py

    r4127 r4140  
    66""" 
    77import subprocess 
     8import shlex 
    89import os 
    910 
     
    1112    pass 
    1213 
    13 def submit(): 
     14def submit(command="./opa"): 
    1415    """Simple function that runs the code. 
    1516 
     
    2223    :returns: retcode 
    2324    """ 
    24     exe = "./opa" 
    25     if os.path.exists(exe): 
    26         retcode = subprocess.call([exe]) 
    27     else: 
    28         raise SubmitError("can not find {}".format(exe)) 
     25    retcode = subprocess.call(shlex.split(command)) 
    2926    return retcode 
    3027 
Note: See TracChangeset for help on using the changeset viewer.