MCPcopy Create free account
hub / github.com/ActiveState/code / read

Method read

recipes/Python/492214_dal6py/recipe-492214.py:203–215  ·  view source on GitHub ↗
(self, size=None)

Source from the content-addressed store, hash-verified

201
202 # Read From File
203 def read(self, size=None):
204 assert not self.__closed
205 assert self.__mode == self.READ
206 if size is None:
207 size = (2 ** 31) - 1
208 else:
209 assert type(size) is int and size > 0
210 data = self.__stream[self.__pointer:self.__pointer+size]
211 pointer = self.__pointer + size
212 if pointer > len(self.__stream):
213 pointer = len(self.__stream)
214 self.__pointer = pointer
215 return data
216
217 # Change Pointer Value
218 def seek(self, offset, from_start=False):

Callers 15

find_replaceFunction · 0.45
do_POSTMethod · 0.45
parseFileFunction · 0.45
__init__Method · 0.45
confirm_paypalFunction · 0.45
selfFunction · 0.45
mainFunction · 0.45
recipe-473810.pyFile · 0.45
mainFunction · 0.45
recipe-456195.pyFile · 0.45
fetchPhotoMethod · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected