178 | | child = popen2.Popen4(command) |
179 | | try : |
180 | | data = self.infile.read(pdlparser.MEGABYTE) |
181 | | while data : |
182 | | child.tochild.write(data) |
183 | | data = self.infile.read(pdlparser.MEGABYTE) |
184 | | child.tochild.flush() |
185 | | child.tochild.close() |
186 | | except (IOError, OSError), msg : |
187 | | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
188 | | |
189 | | child.fromchild.close() |
190 | | try : |
191 | | child.wait() |
192 | | except OSError, msg : |
193 | | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
194 | | |
195 | | result = inkcoverage.getPercents(filename) |
196 | | try : |
197 | | os.remove(filename) |
198 | | except : |
199 | | pass |
| 178 | try : |
| 179 | child = popen2.Popen4(command) |
| 180 | try : |
| 181 | data = self.infile.read(pdlparser.MEGABYTE) |
| 182 | while data : |
| 183 | child.tochild.write(data) |
| 184 | data = self.infile.read(pdlparser.MEGABYTE) |
| 185 | child.tochild.flush() |
| 186 | child.tochild.close() |
| 187 | except (IOError, OSError), msg : |
| 188 | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
| 189 | |
| 190 | child.fromchild.close() |
| 191 | try : |
| 192 | child.wait() |
| 193 | except OSError, msg : |
| 194 | raise pdlparser.PDLParserError, "Problem during conversion to TIFF : %s" % msg |
| 195 | |
| 196 | result = inkcoverage.getPercents(filename) |
| 197 | finally : |
| 198 | try : |
| 199 | os.remove(filename) |
| 200 | except : |
| 201 | pass |
| 202 | result = None |