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

Method put

postscript.py:246–253  ·  view source on GitHub ↗
(self, path, data, mode='w+')

Source from the content-addressed store, hash-verified

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

Callers 2

do_mkdirMethod · 0.95
appendMethod · 0.95

Calls 3

cmdMethod · 0.95
outputClass · 0.90
warningMethod · 0.80

Tested by

no test coverage detected