def tell(self):
"""
Allows reference to our object from within a Codec()
"""
if not self.filepath:
# If there is no filepath, then we're probably dealing with a
# stream in memory like a StringIO or BytesIO stream.
if self.stream:
# Advance to the end of the file
return self.stream.tell()
else:
if self.stream and self._dirty is True:
self.stream.flush()
self._dirty = False
if not self.stream:
if not self.open(mode=NNTPFileMode.BINARY_RO):
return None
return self.stream.tell()
评论列表
文章目录