| 54 | |
| 55 | # handle error messages from PostScript interpreter |
| 56 | def ps_err(self, str_recv): |
| 57 | self.error = None |
| 58 | msg = item(re.findall(c.PS_ERROR, str_recv)) |
| 59 | if msg: # real postscript command errors |
| 60 | output().errmsg("PostScript Error", msg) |
| 61 | self.error = msg |
| 62 | str_recv = "" |
| 63 | else: # printer errors or status messages |
| 64 | msg = item(re.findall(c.PS_CATCH, str_recv)) |
| 65 | if msg: |
| 66 | self.chitchat("Status Message: '" + msg.strip() + "'") |
| 67 | str_recv = re.sub(r'' + c.PS_CATCH + '\r?\n', '', str_recv) |
| 68 | return str_recv |
| 69 | |
| 70 | # disable printing hard copies of error messages |
| 71 | def on_connect(self, mode): |