copy to clipboard for ascii text
Non ascii does not work yet. Code does not handle multi-byte characters.
This commit is contained in:
@@ -12,6 +12,13 @@ class LogFileModel:
|
||||
def __init__(self, file):
|
||||
self._file = file
|
||||
|
||||
def read_range(self, start_byte: int, end_byte: int):
|
||||
with self._lock:
|
||||
with open(self._file, 'rb') as f:
|
||||
f.seek(start_byte)
|
||||
bytes = f.read(end_byte - start_byte)
|
||||
return bytes.decode("utf8", errors="ignore")
|
||||
|
||||
def data(self, byte_offset, scroll_lines, lines) -> List[Line]:
|
||||
#print("data(%s, %s, %s)" % (byte_offset, scroll_lines, lines))
|
||||
lines_before_offset: List[Line] = []
|
||||
|
||||
Reference in New Issue
Block a user