Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
srcs
larbatch
python
jobsuberror.py
Go to the documentation of this file.
1
#! /usr/bin/env python
2
######################################################################
3
#
4
# Name: jobsuberror.py
5
#
6
# Purpose: Python class JobsubError (exception class). This class captures
7
# the error status related to jobsub commands that return nonzero
8
# exit statuses. This exception would normally be raised after
9
# any failed jobsub command.
10
#
11
# This class contains four data members.
12
#
13
# command - Jobsub command (string).
14
# status - Jobsub exit status.
15
# out - Jobsub standard output.
16
# err - Jobsub diagnostic output.
17
#
18
# Created: 20-May-2015 Herbert Greenlee
19
#
20
######################################################################
21
22
from
__future__
import
absolute_import
23
from
__future__
import
print_function
24
25
# Jobsub exception class.
26
27
class
JobsubError
(Exception):
28
29
def
__init__
(self, command, status, out, err):
30
31
# Store command as a single string.
32
# For compatibility with subprocess module, the command may be passed
33
# as a list of words.
34
35
self.
command
=
''
36
if
type
(command) ==
type
([]):
37
for
word
in
command:
38
self.
command
= self.
command
+
' '
+ str(word)
39
else
:
40
self.
command
= str(command)
41
self.
status
= int(status)
42
self.
out
= str(out)
43
self.
err
= str(err)
44
return
45
46
def
__str__
(self):
47
s =
'\nCommand: %s\nStatus: %d\nOutput: %s\nError: %s\n'
% (
48
self.
command
, self.
status
, self.
out
, self.
err
)
49
return
s
50
51
python.jobsuberror.JobsubError.__str__
def __str__
Definition:
jobsuberror.py:46
python.jobsuberror.JobsubError.status
status
Definition:
jobsuberror.py:41
python.jobsuberror.JobsubError.__init__
def __init__
Definition:
jobsuberror.py:29
type
Definition:
ShowerProducedPtrsHolder.hh:50
python.jobsuberror.JobsubError.err
err
Definition:
jobsuberror.py:43
python.jobsuberror.JobsubError.command
command
Definition:
jobsuberror.py:35
python.jobsuberror.JobsubError.out
out
Definition:
jobsuberror.py:42
python.jobsuberror.JobsubError
Definition:
jobsuberror.py:27
Generated by
1.8.5