コード例 #1
0
ファイル: t64.py プロジェクト: adamv/c64-utils
 def __init__(self, bytes):
     self.image_type = "T64 Tape Container"
     self.bytes = bytes
     self._validate()
     
     self.directory_size, self.raw_label =\
         struct.unpack(TAPE_HEADER, bytes[0x20:0x40])
         
     self.label = self.raw_label.strip()
     
     self.entries = [
         TapeEntry(x) for x in
         blocks(self.bytes, 0x20, offset=0x40, max=self.directory_size) ]
コード例 #2
0
    def __init__(self, bytes):
        self.image_type = "T64 Tape Container"
        self.bytes = bytes
        self._validate()

        self.directory_size, self.raw_label =\
            struct.unpack(TAPE_HEADER, bytes[0x20:0x40])

        self.label = self.raw_label.strip()

        self.entries = [
            TapeEntry(x) for x in blocks(
                self.bytes, 0x20, offset=0x40, max=self.directory_size)
        ]
コード例 #3
0
ファイル: blocks.py プロジェクト: adamv/c64-utils
 def test_blocks(self):
     b = list(blocks('abcdefgh', 2))
     self.assertEquals(4, len(b))
コード例 #4
0
ファイル: blocks.py プロジェクト: adamv/c64-utils
 def test_max_offset(self):
     b = list(blocks('abcdefgh', 3, max=2, offset=2))
     self.assertEquals(2, len(b))
コード例 #5
0
ファイル: blocks.py プロジェクト: adamv/c64-utils
 def test_offset(self):
     b = list(blocks('abcdefgh', 2, offset=2))
     self.assertEquals(3, len(b))
コード例 #6
0
ファイル: blocks.py プロジェクト: adamv/c64-utils
 def test_max(self):
     b = list(blocks('abcdefgh', 2, max=2))
     self.assertEquals(2, len(b))
コード例 #7
0
ファイル: cbmdos.py プロジェクト: adamv/c64-utils
 def __init__(self, bytes, track, sector):
     """Initialize this DirectorySector from a disk sector."""
     self.bytes = bytes
     self.location = (track, sector)
     self.next_sector = (bytes[0], bytes[1])
     self.entries = [DirectoryEntry(x) for x in blocks(bytes, 32)]
コード例 #8
0
ファイル: cbmdos.py プロジェクト: hermetique/c64-utils
 def __init__(self, bytes, track, sector):
     """Initialize this DirectorySector from a disk sector."""
     self.bytes = bytes
     self.location = (track, sector)
     self.next_sector = (bytes[0], bytes[1])
     self.entries = [DirectoryEntry(x) for x in blocks(bytes, 32)]