MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / ReplayDataFile

Class ReplayDataFile

tests/Framework.py:406–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

404
405
406class ReplayDataFile:
407 @staticmethod
408 def open(filename: str, mode: str, encoding: str) -> ReplayDataFile:
409 file = open(filename, mode, encoding=encoding)
410 return ReplayDataFile(filename, file)
411
412 def __init__(self, filename: str, file):
413 self.__filename = filename
414 self.__file = file
415 self.__line = 0
416
417 def __repr__(self) -> str:
418 return f"{self.__filename}:{self.__line}"
419
420 def write(self, string: str):
421 self.__file.write(string)
422
423 def readline(self) -> str:
424 self.__line += 1
425 line = self.__file.readline()
426 if isinstance(line, bytes):
427 line = line.decode("utf-8")
428 return line.strip()
429
430 @property
431 def line_number(self):
432 return self.__line
433
434 def close(self):
435 self.__file.close()
436
437
438class BasicTestCase(unittest.TestCase):

Callers 1

openMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…