Changeset 4140 for branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS
- Timestamp:
- 2013-10-25T18:19:03+02:00 (11 years ago)
- Location:
- branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/ooo.py
r4138 r4140 25 25 parser.add_argument("--dry-run", action="store_true", 26 26 help="Flag to test namelist building without submitting.") 27 parser.add_argument("--cmd", dest="command", default="./opa", 28 help="Submit task to run.") 27 29 parser.add_argument("-v", "--verbose", action="store_true", 28 30 help="Prints difference between before and after namelists.") … … 114 116 # Run job 115 117 if not args.dry_run: 116 run.submit( )118 run.submit(command=args.command) 117 119 118 120 -
branches/2013/dev_r3987_UKMO4_OBS/NEMOGCM/TOOLS/OBSTOOLS/OOO/ooo/run.py
r4127 r4140 6 6 """ 7 7 import subprocess 8 import shlex 8 9 import os 9 10 … … 11 12 pass 12 13 13 def submit( ):14 def submit(command="./opa"): 14 15 """Simple function that runs the code. 15 16 … … 22 23 :returns: retcode 23 24 """ 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)) 29 26 return retcode 30 27
Note: See TracChangeset
for help on using the changeset viewer.