(directory)
| 283 | |
| 284 | |
| 285 | def parse_html(directory): |
| 286 | print("Parsing instructions...") |
| 287 | instructions = [] |
| 288 | for root, dirs, files in os.walk(directory): |
| 289 | for file in files: |
| 290 | if file.endswith(".html") and file != 'index.html': |
| 291 | with open(os.path.join(root, file), encoding='utf-8') as f2: |
| 292 | name = os.path.splitext(file)[0] |
| 293 | if name in IGNORED_DUPLICATES or name in IGNORED_FILE_NAMES: |
| 294 | continue |
| 295 | try: |
| 296 | instruction = parse(name, f2) |
| 297 | if not instruction: |
| 298 | continue |
| 299 | patch_instruction(instruction) |
| 300 | instructions.append(instruction) |
| 301 | except Exception as e: |
| 302 | print(f"Error parsing {name}:\n{e}") |
| 303 | return instructions |
| 304 | |
| 305 | |
| 306 | def self_test(instructions, directory): |
no test coverage detected