MCPcopy Index your code
hub / github.com/RustPython/RustPython / process_word

Method process_word

Lib/test/test_io.py:2761–2775  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2759 return output
2760
2761 def process_word(self):
2762 output = ''
2763 if self.buffer[0] == ord('i'):
2764 self.i = min(99, int(self.buffer[1:] or 0)) # set input length
2765 elif self.buffer[0] == ord('o'):
2766 self.o = min(99, int(self.buffer[1:] or 0)) # set output length
2767 else:
2768 output = self.buffer.decode('ascii')
2769 if len(output) < self.o:
2770 output += '-'*self.o # pad out with hyphens
2771 if self.o:
2772 output = output[:self.o] # truncate to output length
2773 output += '.'
2774 self.buffer = bytearray()
2775 return output
2776
2777 codecEnabled = False
2778

Callers 1

decodeMethod · 0.95

Calls 4

ordFunction · 0.85
minFunction · 0.85
lenFunction · 0.85
decodeMethod · 0.45

Tested by

no test coverage detected