Changeset 1678
- Timestamp:
- 08/22/04 16:04:47 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1676 r1678 24 24 - 1.20alpha2 : 25 25 26 - Now software accounting method reads accounter's 27 answer until a line with a single integer is 28 obtained or until all of its output has been read. 29 This should fix the problem some people have 30 when strange locale related messages are sent 31 when running subprocesses (Solaris only ?). 32 26 33 - First version of ESC/P2 analyzer. Seems to work 27 34 ok at least with 'epson', 'epsonc', 'eps9mid' -
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