Changeset 1680 for pykota/trunk/pykota/accounters/software.py
- Timestamp:
- 08/26/04 00:34:39 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/software.py
r1678 r1680 22 22 # 23 23 # $Log$ 24 # Revision 1.9 2004/08/25 22:34:39 jalet 25 # Now both software and hardware accounting raise an exception when no valid 26 # result can be extracted from the subprocess' output. 27 # Hardware accounting now reads subprocess' output until an integer is read 28 # or data is exhausted : it now behaves just like software accounting in this 29 # aspect. 30 # 24 31 # Revision 1.8 2004/08/22 14:04:47 jalet 25 32 # Tries to fix problem with subprocesses outputting more datas than needed … … 74 81 self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg) 75 82 76 pagecount = 083 pagecounter = None 77 84 try : 78 85 answer = child.fromchild.read() … … 84 91 for i in range(len(lines)) : 85 92 try : 86 pagecount = int(lines[i])93 pagecounter = int(lines[i]) 87 94 except (AttributeError, ValueError) : 88 self.filter.printInfo(_("Unable to compute job size with accounter %s") % self.arguments) 89 self.filter.printInfo(_("Line skipped in accounter's output. Trying again...")) 95 self.filter.printInfo(_("Line [%s] skipped in accounter's output. Trying again...") % lines[i]) 90 96 else : 91 97 break … … 102 108 status = retcode 103 109 self.filter.printInfo(_("Software accounter %s exit code is %s") % (self.arguments, str(status))) 104 self.filter.logdebug("Software accounter %s said job is %s pages long." % (self.arguments, pagecount))105 return pagecount106 110 111 if pagecounter is None : 112 raise PyKotaAccounterError, _("Unable to compute job size with accounter %s") % self.arguments 113 114 self.filter.logdebug("Software accounter %s said job is %s pages long." % (self.arguments, pagecounter)) 115 return pagecounter 116