MCPcopy
hub / github.com/RUB-NDS/PRET / ps_err

Method ps_err

postscript.py:56–68  ·  view source on GitHub ↗
(self, str_recv)

Source from the content-addressed store, hash-verified

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):

Callers 1

cmdMethod · 0.95

Calls 4

itemFunction · 0.90
outputClass · 0.90
errmsgMethod · 0.80
chitchatMethod · 0.45

Tested by

no test coverage detected