mirror of
https://github.com/86Box/bios-tools.git
synced 2026-02-21 17:15:33 -07:00
BonusAnalyzer: Shift non-PCI VGA formatting to formatter code
This commit is contained in:
@@ -466,8 +466,9 @@ def analyze_files(formatter, scan_base, file_analyzers, scan_dir_path, scan_file
|
||||
# Add names to option ROMs.
|
||||
previous_vendor = previous_device = None
|
||||
for x in range(len(oroms)):
|
||||
if type(oroms[x]) == str: # generic ROM
|
||||
continue
|
||||
if type(oroms[x][0]) == str: # generic ROM
|
||||
# Format string.
|
||||
oroms[x] = '[{0}] {1}'.format(*oroms[x]).replace('\n', '\n' + (' ' * (len(oroms[x][0]) + 3)))
|
||||
elif len(oroms[x]) == 2: # PCI ROM
|
||||
# Get vendor and device IDs and names.
|
||||
vendor_id, device_id = oroms[x]
|
||||
|
||||
@@ -1286,7 +1286,7 @@ class BonusAnalyzer(Analyzer):
|
||||
# Strip lines that are too short or have a single repeated character.
|
||||
stripped = (x.strip() for x in vga_marker.replace('\r', '').split('\n'))
|
||||
vga_marker = '\n'.join(x for x in stripped if len(x) > 3 and x != (x[0] * len(x))).strip('\n')
|
||||
self.oroms.append('[VGA] ' + vga_marker.replace('\n', '\n '))
|
||||
self.oroms.append(('VGA', vga_marker))
|
||||
|
||||
# This analyzer should never return True.
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user