Changed numpy convenience method tostring to tobytes

This commit is contained in:
Rob McMullen 2018-05-26 20:07:43 -07:00
parent 68debef437
commit ebdcb01c40
3 changed files with 10 additions and 10 deletions

View File

@ -292,7 +292,7 @@ class DiskImageBase(object):
def get_file(self, dirent):
segment = self.get_file_segment(dirent)
return segment.tostring()
return segment.tobytes()
def get_file_segment(self, dirent):
pass

View File

@ -245,7 +245,7 @@ class Dos33Dirent(Dirent):
self.sector = values[1]
self._file_type = values[2] & 0x7f
self.locked = values[2] & 0x80
self.filename = (bytes[3:0x20] - 0x80).tostring().rstrip()
self.filename = (bytes[3:0x20] - 0x80).tobytes().rstrip()
self.num_sectors = int(values[4])
self.is_sane = self.sanity_check(image)
@ -699,12 +699,12 @@ class ProdosDiskImage(DiskImageBase):
swap_order = False
if (magic == [1, 56, 176, 3]).all():
data, style = self.get_sectors(1)
prodos = data[3:9].tostring()
prodos = data[3:9].tobytes()
if prodos == "PRODOS":
pass
else:
data, style = self.get_sectors(14)
prodos = data[3:9].tostring()
prodos = data[3:9].tobytes()
if prodos == "PRODOS":
swap_order = True
else:

View File

@ -71,7 +71,7 @@ class SegmentSaver(object):
@classmethod
def encode_data(cls, segment, ui_control):
return segment.tostring()
return segment.tobytes()
class OrderWrapper(object):
@ -119,8 +119,8 @@ class OrderWrapper(object):
def unindexed(self):
return self.np_data[self.order]
def tostring(self):
return self.np_data[self.order].tostring()
def tobytes(self):
return self.np_data[self.order].tobytes()
class UserExtraData(object):
@ -637,8 +637,8 @@ class DefaultSegment(object):
raise IndexError("index %d not in this segment" % base_index)
return int(index)
def tostring(self):
return self.data.tostring()
def tobytes(self):
return self.data.tobytes()
def get_style_bits(self, **kwargs):
return get_style_bits(**kwargs)
@ -1053,7 +1053,7 @@ class DefaultSegment(object):
@property
def search_copy(self):
if self._search_copy is None:
self._search_copy = self.data.tostring()
self._search_copy = self.data.tobytes()
return self._search_copy
def compare_segment(self, other_segment):