(f)
| 80 | |
| 81 | |
| 82 | def parse(f): |
| 83 | doc = BeautifulSoup(f, 'html.parser') |
| 84 | table = doc.find('section', {'id': 'python-bytecode-instructions'}) |
| 85 | |
| 86 | opcodes = table.findAll('dl', {'class': 'std opcode'}) |
| 87 | instructions = [] |
| 88 | for opcode in opcodes: |
| 89 | opcode_name = opcode.find('dt').find('span').text |
| 90 | opcode_tooltip = get_first_description_paragraph(opcode) |
| 91 | opcode_desc = get_description(opcode) |
| 92 | instructions.append(Instruction( |
| 93 | opcode_name, |
| 94 | [opcode_name], |
| 95 | opcode_tooltip, |
| 96 | opcode_desc, |
| 97 | )) |
| 98 | return instructions |
| 99 | |
| 100 | |
| 101 | def parse_html(directory): |
no test coverage detected