mirror of
https://github.com/robmcmullen/atrcopy.git
synced 2025-02-09 06:30:56 +00:00
Classes no longer unnecessarily subclass from object, as in py3 it's the default
This commit is contained in:
parent
6b9cf6d4d2
commit
1a7381b865
@ -256,7 +256,7 @@ class XexSegment(ObjSegment):
|
||||
savers = [SegmentSaver, XexSegmentSaver]
|
||||
|
||||
|
||||
class AtariDosFile(object):
|
||||
class AtariDosFile:
|
||||
"""Parse a binary chunk into segments according to the Atari DOS object
|
||||
file format.
|
||||
|
||||
|
@ -111,7 +111,7 @@ def get_cart(cart_type):
|
||||
raise errors.InvalidDiskImage("Unsupported cart type %d" % cart_type)
|
||||
|
||||
|
||||
class A8CartHeader(object):
|
||||
class A8CartHeader:
|
||||
# Atari Cart format described by https://sourceforge.net/p/atari800/source/ci/master/tree/DOC/cart.txt NOTE: Big endian!
|
||||
format = np.dtype([
|
||||
('magic', '|S4'),
|
||||
|
@ -12,7 +12,7 @@ except NameError:
|
||||
_xd = False
|
||||
|
||||
|
||||
class BaseHeader(object):
|
||||
class BaseHeader:
|
||||
file_format = "generic" # text descriptor of file format
|
||||
sector_class = WriteableSector
|
||||
|
||||
@ -91,7 +91,7 @@ class BaseHeader(object):
|
||||
return self.sector_class(self.sector_size, data)
|
||||
|
||||
|
||||
class DiskImageBase(object):
|
||||
class DiskImageBase:
|
||||
def __init__(self, rawdata, filename="", create=False):
|
||||
self.rawdata = rawdata
|
||||
self.bytes = self.rawdata.get_data()
|
||||
|
@ -629,7 +629,7 @@ class Dos33DiskImage(DiskImageBase):
|
||||
return image, 'B'
|
||||
|
||||
|
||||
class Dos33BinFile(object):
|
||||
class Dos33BinFile:
|
||||
"""Parse a binary chunk into segments according to the DOS 3.3 binary
|
||||
dump format
|
||||
"""
|
||||
|
@ -15,7 +15,7 @@ import logging
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class SegmentParser(object):
|
||||
class SegmentParser:
|
||||
menu_name = ""
|
||||
image_type = None
|
||||
container_segment = DefaultSegment
|
||||
|
@ -57,7 +57,7 @@ def get_style_mask(**kwargs):
|
||||
return 0xff ^ bits
|
||||
|
||||
|
||||
class SegmentSaver(object):
|
||||
class SegmentSaver:
|
||||
export_data_name = "Raw Data"
|
||||
export_extensions = [".dat"]
|
||||
|
||||
@ -66,7 +66,7 @@ class SegmentSaver(object):
|
||||
return segment.tobytes()
|
||||
|
||||
|
||||
class BSAVESaver(object):
|
||||
class BSAVESaver:
|
||||
export_data_name = "Apple ][ Binary"
|
||||
export_extensions = [".bsave"]
|
||||
|
||||
@ -80,7 +80,7 @@ class BSAVESaver(object):
|
||||
return header.tobytes() + segment.tobytes()
|
||||
|
||||
|
||||
class OrderWrapper(object):
|
||||
class OrderWrapper:
|
||||
"""Wrapper for numpy data so that manipulations can use normal numpy syntax
|
||||
and still affect the data according to the byte ordering.
|
||||
|
||||
@ -132,7 +132,7 @@ class OrderWrapper(object):
|
||||
return self.np_data[self.order].tobytes()
|
||||
|
||||
|
||||
class UserExtraData(object):
|
||||
class UserExtraData:
|
||||
def __init__(self):
|
||||
self.comments = dict()
|
||||
self.user_data = dict()
|
||||
@ -140,7 +140,7 @@ class UserExtraData(object):
|
||||
self.user_data[i] = dict()
|
||||
|
||||
|
||||
class SegmentData(object):
|
||||
class SegmentData:
|
||||
def __init__(self, data, style=None, extra=None, debug=False, order=None):
|
||||
"""Storage for raw data
|
||||
|
||||
@ -388,7 +388,7 @@ class SegmentData(object):
|
||||
return r
|
||||
|
||||
|
||||
class DefaultSegment(object):
|
||||
class DefaultSegment:
|
||||
savers = [SegmentSaver, BSAVESaver]
|
||||
can_resize_default = False
|
||||
|
||||
|
@ -60,7 +60,7 @@ def text_to_int(text, default_base="hex"):
|
||||
return value
|
||||
|
||||
|
||||
class WriteableSector(object):
|
||||
class WriteableSector:
|
||||
def __init__(self, sector_size, data=None, num=-1):
|
||||
self._sector_num = num
|
||||
self._next_sector = 0
|
||||
@ -109,7 +109,7 @@ class WriteableSector(object):
|
||||
return data[count:]
|
||||
|
||||
|
||||
class BaseSectorList(object):
|
||||
class BaseSectorList:
|
||||
def __init__(self, header):
|
||||
self.header = header
|
||||
self.sector_size = header.sector_size
|
||||
@ -150,7 +150,7 @@ class BaseSectorList(object):
|
||||
self.sectors.extend(sectors)
|
||||
|
||||
|
||||
class Dirent(object):
|
||||
class Dirent:
|
||||
"""Abstract base class for a directory entry
|
||||
|
||||
"""
|
||||
|
@ -8,7 +8,7 @@ from atrcopy import SegmentData, AtariDosDiskImage, Dos33DiskImage
|
||||
from atrcopy import errors
|
||||
|
||||
|
||||
class BaseFilesystemModifyTest(object):
|
||||
class BaseFilesystemModifyTest:
|
||||
diskimage_type = None
|
||||
sample_data = None
|
||||
num_files_in_sample = 0
|
||||
|
@ -6,7 +6,7 @@ from atrcopy import SegmentData, AtariDosFile, DefaultSegment, XexContainerSegme
|
||||
|
||||
|
||||
|
||||
class TestAtariDosFile(object):
|
||||
class TestAtariDosFile:
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
|
@ -7,7 +7,7 @@ from atrcopy import AtariCartImage, SegmentData
|
||||
from atrcopy import errors
|
||||
|
||||
|
||||
class TestAtariCart(object):
|
||||
class TestAtariCart:
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
|
@ -15,7 +15,7 @@ def get_image(file_name, diskimage_type):
|
||||
return image
|
||||
|
||||
|
||||
class BaseCreateTest(object):
|
||||
class BaseCreateTest:
|
||||
diskimage_type = None
|
||||
|
||||
def get_exe_segments(self):
|
||||
|
@ -12,7 +12,7 @@ import numpy as np
|
||||
from atrcopy import DefaultSegment, SegmentData
|
||||
|
||||
|
||||
class TestJsonPickle(object):
|
||||
class TestJsonPickle:
|
||||
def setup(self):
|
||||
data = np.arange(2048, dtype=np.uint8)
|
||||
self.segment = DefaultSegment(SegmentData(data))
|
||||
|
@ -10,7 +10,7 @@ from mock import *
|
||||
from atrcopy import SegmentData, KBootImage, add_xexboot_header, add_atr_header
|
||||
|
||||
|
||||
class TestKbootHeader(object):
|
||||
class TestKbootHeader:
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
|
@ -18,7 +18,7 @@ def get_indexed(segment, num, scale):
|
||||
s = DefaultSegment(raw, segment.origin + indexes[0])
|
||||
return s, indexes
|
||||
|
||||
class TestSegment1(object):
|
||||
class TestSegment1:
|
||||
def setup(self):
|
||||
self.segments = []
|
||||
for i in range(8):
|
||||
@ -68,7 +68,7 @@ class TestSegment1(object):
|
||||
assert not np.all((c.data[:] - s.data[:]) == 0)
|
||||
|
||||
|
||||
class TestIndexed(object):
|
||||
class TestIndexed:
|
||||
def setup(self):
|
||||
data = np.arange(4096, dtype=np.uint8)
|
||||
data[1::2] = np.repeat(np.arange(16, dtype=np.uint8), 128)
|
||||
@ -242,7 +242,7 @@ class TestIndexed(object):
|
||||
assert not np.all((c.data[:] - s.data[:]) == 0)
|
||||
|
||||
|
||||
class TestComments(object):
|
||||
class TestComments:
|
||||
def setup(self):
|
||||
data = np.ones([4000], dtype=np.uint8)
|
||||
r = SegmentData(data)
|
||||
@ -392,7 +392,7 @@ class TestComments(object):
|
||||
assert set(item1[3].values()) == set(item2[3].values())
|
||||
|
||||
|
||||
class TestResize(object):
|
||||
class TestResize:
|
||||
def setup(self):
|
||||
data = np.arange(4096, dtype=np.uint8)
|
||||
data[1::2] = np.repeat(np.arange(16, dtype=np.uint8), 128)
|
||||
|
@ -10,7 +10,7 @@ import pytest
|
||||
from atrcopy import DefaultSegment, SegmentData, get_xex, interleave_segments
|
||||
|
||||
|
||||
class TestSegment(object):
|
||||
class TestSegment:
|
||||
def setup(self):
|
||||
data = np.ones([4000], dtype=np.uint8)
|
||||
r = SegmentData(data)
|
||||
|
@ -3,7 +3,7 @@ from mock import *
|
||||
from atrcopy import utils
|
||||
|
||||
|
||||
class TestTextToInt(object):
|
||||
class TestTextToInt:
|
||||
def setup(self):
|
||||
pass
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user