ATLAS Offline Software
ShellJobRunner.py
Go to the documentation of this file.
1 #!/usr/bin/env python
2 
3 # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4 """
5 ShellJobRunner is a JobRunner for running one job at a time in current shell.
6 
7 Written by Juerg Beringer (LBNL) in 2008.
8 """
9 __author__ = 'Juerg Beringer'
10 __version__ = '$Id: ShellJobRunner.py 216126 2009-09-29 16:12:59Z atlidbs $'
11 
12 
13 from JobRunner import JobRunner
14 import os
15 
16 
18  """ShellJobRunner - runs jobs one at a time in current shell"""
19 
20  def __init__(self,**params):
21  """Constructor (takes any number of parameters as an argument)."""
22  JobRunner.__init__(self,**params)
23 
24  def submitJob(self,jobConfig):
25  """Run a JobRunner job in the current shell."""
26  scriptfile = jobConfig['scriptfile']
27  logfile = jobConfig['logfile']
28  status = os.system(scriptfile+' > '+logfile+' 2>&1') >> 8 # Convert to standard Unix exit code
29  return status
python.ShellJobRunner.ShellJobRunner
Definition: ShellJobRunner.py:17
python.ShellJobRunner.ShellJobRunner.__init__
def __init__(self, **params)
Definition: ShellJobRunner.py:20
python.JobRunner.JobRunner
Definition: JobRunner.py:99
python.ShellJobRunner.ShellJobRunner.submitJob
def submitJob(self, jobConfig)
Definition: ShellJobRunner.py:24