- Timestamp:
- 03/29/08 10:08:33 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/accounters/software.py
r3288 r3357 78 78 def withExternalScript(self) : 79 79 """Does software accounting through an external script.""" 80 self.filter. printInfo(_("Launching SOFTWARE(%s)...") % self.arguments)80 self.filter.logdebug(_("Launching SOFTWARE(%s)...") % self.arguments) 81 81 pagecounter = None 82 82 child = os.popen(self.arguments, "r") … … 85 85 except (IOError, OSError), msg : 86 86 msg = "%s : %s" % (self.arguments, msg) 87 self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg )87 self.filter.printInfo(_("Unable to compute job size with accounter %s") % msg, "warn") 88 88 else : 89 89 lines = [l.strip() for l in answer.split("\n")] … … 92 92 pagecounter = int(lines[i]) 93 93 except (AttributeError, ValueError) : 94 self.filter. printInfo(_("Line [%s] skipped in accounter's output. Trying again...") % lines[i])94 self.filter.logdebug(_("Line [%s] skipped in accounter's output. Trying again...") % lines[i]) 95 95 else : 96 96 break … … 102 102 except TypeError : 103 103 pass # None means no error occured. 104 self.filter. printInfo(_("Software accounter %s exit code is %s") % (self.arguments, str(status)))104 self.filter.logdebug(_("Software accounter %s exit code is %s") % (self.arguments, str(status))) 105 105 106 106 if pagecounter is None : … … 113 113 114 114 pagecounter = pagecounter or 0 115 if self.filter.Ticket.FileName is not None : 116 # when a filename is passed as an argument, the backend 117 # must generate the correct number of copies. 118 pagecounter *= self.filter.Ticket.Copies 115 try : 116 if self.filter.Ticket.FileName is not None : 117 # when a filename is passed as an argument, the backend 118 # must generate the correct number of copies. 119 pagecounter *= self.filter.Ticket.Copies 120 except AttributeError : 121 pass # when called from pykotme. TODO : clean this mess some day. 119 122 120 123 return pagecounter