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

Method _reset

recipes/Python/436477_filetailpy/recipe-436477.py:137–143  ·  view source on GitHub ↗

Internal method; reopen the internal file handle (probably because the log file got rotated/truncated).

(self)

Source from the content-addressed store, hash-verified

135 return None
136
137 def _reset(self):
138 """Internal method; reopen the internal file handle (probably
139 because the log file got rotated/truncated)."""
140 self.f.close()
141 self.f = open(self.path, "r")
142 self.pos = self.f.tell()
143 self.last_read = time()
144
145 def nextline(self):
146 """Return the next line from the file. Blocks if there are no lines

Callers 1

nextlineMethod · 0.95

Calls 4

timeFunction · 0.85
openFunction · 0.50
closeMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected