ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/EdgLoggingInfo.py
(Generate patch)

Comparing COMP/CRAB/python/EdgLoggingInfo.py (file contents):
Revision 1.2 by corvo, Mon Dec 4 11:15:51 2006 UTC vs.
Revision 1.4.2.1 by fanzago, Tue Oct 9 10:46:55 2007 UTC

# Line 1 | Line 1
1   #!/usr/bin/env python
2  
3 < import sys, os, string
3 > import sys , re #DS
4 > EXIT_CODE_RE = re.compile('^\s*-\s*[Ee]xit.[Cc]ode\s*=\s*(.*?)\s*$')
5  
6   class EdgLoggingInfo:
7      def __init__(self) :
# Line 36 | Line 37 | class EdgLoggingInfo:
37          try:
38              file = open(filename)
39          except IOError:
40 <            print ''
40 <            print 'Could not open file: ',filename
40 >            common.logger.message('Could not open file: '+filename)
41              return ''
42  
43          return self.decodeReason(file.readlines())
# Line 48 | Line 48 | class EdgLoggingInfo:
48          """
49  
50          # init final variables
51        final_event = ''
52        final_reason = ''
53        final_exit_code = ''
54        final_time = ''
51          final_done_code = 0
52          final_abort_msg = ''
53          final_done_msg  = ''
# Line 64 | Line 60 | class EdgLoggingInfo:
60          event     = ''
61          reason    = ''
62          exit_code = ''
67        time      = ''
63  
64          lines = input.split('\n')
65  
# Line 79 | Line 74 | class EdgLoggingInfo:
74                  final_done = 1
75              if line.count('reason') >= 1 :
76                  reason = self.parse_reason(line.split('=')[1].strip())
77 <            if line.count('exit_code') >= 1 :
78 <                exit_code = line.split('=')[1].strip()
79 <            if line.count('time') >= 1 :
80 <                time = line.split('=')[1].strip()
77 >            match = EXIT_CODE_RE.match(line) #DS
78 >            if match:                       #DS                        
79 >                exit_code = match.groups()[0] #DS
80 >            #if line.count('exit_code') >= 1 :
81 >            #    exit_code = line.split('=')[1].strip()
82 >            # if line.count('time') >= 1 :
83 >            #     time = line.split('=')[1].strip()
84              
85              if ( line.count('---') >= 1 or line.count('***') >= 1 ) and event != '' :
86                  if event in self._events :
# Line 94 | Line 92 | class EdgLoggingInfo:
92                              final_done_msg += '. '+reason
93                      elif event == 'Abort' :
94                          final_abort_msg = reason
97                    final_exit_code = exit_code
98                    final_time = time
95  
96  
97          if final_abort_msg.count('no compatible resources') >= 1 :

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines