diff --git a/biostools/__main__.py b/biostools/__main__.py index 8864c7b..b6320b5 100644 --- a/biostools/__main__.py +++ b/biostools/__main__.py @@ -579,6 +579,7 @@ def analyze_process(queue, formatter, scan_base, options): analyzers.MRAnalyzer(), analyzers.MylexAnalyzer(), analyzers.OlivettiAnalyzer(), + analyzers.PhilipsAnalyzer(), analyzers.PromagAnalyzer(), analyzers.SchneiderAnalyzer(), analyzers.SystemSoftAnalyzer(), diff --git a/biostools/analyzers.py b/biostools/analyzers.py index 300791c..4d39074 100644 --- a/biostools/analyzers.py +++ b/biostools/analyzers.py @@ -1786,6 +1786,24 @@ class OlivettiAnalyzer(Analyzer): return True +class PhilipsAnalyzer(Analyzer): + def __init__(self, *args, **kwargs): + super().__init__('Philips', *args, **kwargs) + + self._version_pattern = re.compile(b'''\\x0DPhilips ROM BIOS Version ([\\x21-\\x7E]+) ''') + + def can_handle(self, file_path, file_data, header_data): + # Locate version. + match = self._version_pattern.search(file_data) + if not match: + return False + + # Extract version. + self.version = match.group(1).decode('cp437', 'ignore') + + return True + + class PhoenixAnalyzer(Analyzer): def __init__(self, *args, **kwargs): super().__init__('Phoenix', *args, **kwargs) @@ -3467,7 +3485,7 @@ class ZenithAnalyzer(Analyzer): def __init__(self, *args, **kwargs): super().__init__('Zenith', *args, **kwargs) - self._date_pattern = re.compile(b'''([0-9]{2}/[0-9]{2}/[0-9]{2}) \(C\)ZDS CORP''') + self._date_pattern = re.compile(b'''([0-9]{2}/[0-9]{2}/[0-9]{2}) \\(C\\)ZDS CORP''') self._monitor_pattern = re.compile(b'''[\\x20-\\x7E]+ Monitor, Version [\\x20-\\x7E]+''') def can_handle(self, file_path, file_data, header_data): diff --git a/biostools/extractors.py b/biostools/extractors.py index 0d7a780..b13d32c 100644 --- a/biostools/extractors.py +++ b/biostools/extractors.py @@ -1907,6 +1907,7 @@ class InterleaveExtractor(Extractor): b'Copyright COMPAQ Computer Corporation', # Compaq b'Press any key when ready', # Access Methods b'* AMPRO Little Board', # AMPRO + b'Philips ROM BIOS ' # Philips ] # Interleave the strings.