pmacs3/buffer/data.py

18 lines
434 B
Python

from buffer import Buffer
class DataBuffer(Buffer):
btype = 'data'
def __init__(self, name, data):
Buffer.__init__(self)
self._name = name
if type(data) == bytes:
self.lines = data.decode('UTF-8').split('\n')
else:
self.lines = data.split("\n")
def name(self):
return self._name
def close(self):
pass
def readonly(self):
return True