Changeset 1678 for pykota/trunk/pykota/accounters/software.py
- Timestamp:
- 08/22/04 16:04:47 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/software.py
r1665 r1678 22 22 # 23 23 # $Log$ 24 # Revision 1.8 2004/08/22 14:04:47 jalet 25 # Tries to fix problem with subprocesses outputting more datas than needed 26 # 24 27 # Revision 1.7 2004/08/06 13:45:51 jalet 25 28 # Fixed french translation problem. … … 73 76 pagecount = 0 74 77 try : 75 pagecount = int(child.fromchild.readline().strip()) 76 except (AttributeError, ValueError) : 77 self.filter.printInfo(_("Unable to compute job size with accounter %s") % self.arguments) 78 answer = child.fromchild.read() 78 79 except (IOError, OSError), msg : 79 80 msg = "%s : %s" % (self.arguments, msg) 80 81 self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg) 82 else : 83 lines = [l.strip() for l in answer.split("\n")] 84 for i in range(len(lines)) : 85 try : 86 pagecount = int(lines[i]) 87 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...")) 90 else : 91 break 81 92 child.fromchild.close() 82 93