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

Method rotator

Lib/test/test_logging.py:6344–6350  ·  view source on GitHub ↗
(source, dest)

Source from the content-addressed store, hash-verified

6342 return name + ".gz"
6343
6344 def rotator(source, dest):
6345 with open(source, "rb") as sf:
6346 data = sf.read()
6347 compressed = zlib.compress(data, 9)
6348 with open(dest, "wb") as df:
6349 df.write(compressed)
6350 os.remove(source)
6351
6352 rh = logging.handlers.RotatingFileHandler(
6353 self.fn, encoding="utf-8", backupCount=2, maxBytes=1)

Callers 1

rotateMethod · 0.45

Calls 5

openFunction · 0.50
readMethod · 0.45
compressMethod · 0.45
writeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected