diff --git a/software/glasgow/database/jedec.py b/software/glasgow/database/jedec.py index 29a0c3ea5..9a16f8e55 100644 --- a/software/glasgow/database/jedec.py +++ b/software/glasgow/database/jedec.py @@ -1830,7 +1830,7 @@ def jedec_mfg_name_from_bank_num(bank, mfg_num): ] def _jedec_update_mfg_from_pdf(): - import fitz + import fitz import re import argparse @@ -1843,14 +1843,14 @@ def _jedec_update_mfg_from_pdf(): with fitz.open(args.pdf_filepath) as doc: for page in doc: pdf_text += page.get_text() - jep106_matches = re.findall('^(\d+) (.+(?:\n.+){0,1})(?:(?:\n\d ){8})(?:\n)([0-9A-F]{2})',pdf_text, re.MULTILINE) + jep106_matches = re.findall(r'^(\d+) (.+(?:\n.+){0,1})(?:(?:\n\d ){8})(?:\n)([0-9A-F]{2})', pdf_text, re.MULTILINE) output_text = "" with open(__file__, 'r') as source_file: output_text += source_file.read() # Update version string - output_text = re.sub("^# Version.*", f"# Version: JEDEC {args.pdf_filepath}", output_text) + output_text = re.sub(r"^# Version.*", f"# Version: JEDEC {args.pdf_filepath}", output_text) manufacturers_array = "_manufacturers = [\n" bank_no = 0 @@ -1863,9 +1863,9 @@ def _jedec_update_mfg_from_pdf(): manufacturers_array += f" [ # Bank {bank_no}\n" manufacturers_array += f" ({int(entry[0])}, \"{entry[1]}\", 0x{int(entry[2], 16):02X}),\n" manufacturers_array += " ]\n]" - + # Update Manufacturers array - output_text = re.sub("_manufacturers = \[(.|\n)*^\]", manufacturers_array, output_text, flags=re.MULTILINE) + output_text = re.sub(r"_manufacturers = \[(.|\n)*^\]", manufacturers_array, output_text, flags=re.MULTILINE) with open(args.output_filepath, 'w') as f: print(output_text, file=f, end='')