From 8f39e3a079ba2cc8e560bbf26d6e7cd3640d7b5a Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sun, 7 Aug 2022 15:03:17 -0300 Subject: [PATCH] BonusAnalyzer: Shift non-PCI VGA formatting to formatter code --- biostools/__main__.py | 5 +++-- biostools/analyzers.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/biostools/__main__.py b/biostools/__main__.py index 27778e9..581a887 100644 --- a/biostools/__main__.py +++ b/biostools/__main__.py @@ -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] diff --git a/biostools/analyzers.py b/biostools/analyzers.py index efb693f..16172f3 100644 --- a/biostools/analyzers.py +++ b/biostools/analyzers.py @@ -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