Class to abstract access a formal build as a bundle
| 70 | |
| 71 | |
| 72 | class ReleaseFirmwareBundle(FirmwareBundle): |
| 73 | """Class to abstract access a formal build as a bundle""" |
| 74 | |
| 75 | def __init__(self, directory): |
| 76 | bundle_contents = os.listdir(directory) |
| 77 | firmware_list = [] |
| 78 | for name in bundle_contents: |
| 79 | path = directory + os.sep + name |
| 80 | if os.path.isdir(path): |
| 81 | daplink_firmware = DAPLinkFirmware(name, self, path) |
| 82 | if daplink_firmware.valid: |
| 83 | firmware_list.append(daplink_firmware) |
| 84 | elif os.path.isfile(path): |
| 85 | if ('.hex' in name): |
| 86 | daplink_firmware = ReleaseFirmware(name, self, path) |
| 87 | if daplink_firmware.valid: |
| 88 | firmware_list.append(daplink_firmware) |
| 89 | else: |
| 90 | assert False |
| 91 | self._firmware_list = firmware_list |
| 92 | |
| 93 | def get_firmware_list(self): |
| 94 | return self._firmware_list |
| 95 | |
| 96 | @property |
| 97 | def build_sha(self): |
| 98 | raise NotImplementedError() |
| 99 | |
| 100 | @property |
| 101 | def build_local_mods(self): |
| 102 | raise NotImplementedError() |
| 103 | |
| 104 | |
| 105 | class ProjectFirmwareBundle(FirmwareBundle): |
no outgoing calls
no test coverage detected