MCPcopy Index your code
hub / github.com/python/cpython / process_word

Method process_word

Lib/test/test_io/test_textio.py:101–115  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

99 return output
100
101 def process_word(self):
102 output = ''
103 if self.buffer[0] == ord('i'):
104 self.i = min(99, int(self.buffer[1:] or 0)) # set input length
105 elif self.buffer[0] == ord('o'):
106 self.o = min(99, int(self.buffer[1:] or 0)) # set output length
107 else:
108 output = self.buffer.decode('ascii')
109 if len(output) < self.o:
110 output += '-'*self.o # pad out with hyphens
111 if self.o:
112 output = output[:self.o] # truncate to output length
113 output += '.'
114 self.buffer = bytearray()
115 return output
116
117 codecEnabled = False
118

Callers 1

decodeMethod · 0.95

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected