| 244 | |
| 245 | # ------------------------[ put <local file> ]------------------------ |
| 246 | def put(self, path, data, mode='w+'): |
| 247 | if self.iohack: # brother devices without any writeable volumes |
| 248 | output().warning("Writing will probably fail on this device") |
| 249 | # convert to PostScript-compatibe octal notation |
| 250 | data = ''.join(['\\{:03o}'.format(ord(char)) for char in data]) |
| 251 | self.cmd('/outfile (' + path + ') (' + mode + ') file def\n' |
| 252 | + 'outfile (' + data + ') writestring\n' |
| 253 | + 'outfile closefile\n', False) |
| 254 | |
| 255 | # ------------------------[ append <file> <string> ]------------------ |
| 256 | def append(self, path, data): |