ids_parser: allow specifying which parts to run

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-10-02 13:19:22 +02:00
parent 3a58a43085
commit 53d22844f0

View file

@ -290,20 +290,25 @@ def oui(p1, p2, p3):
print(f'Wrote {out.name}') print(f'Wrote {out.name}')
if __name__ == '__main__': if __name__ == '__main__':
p = usb_ids_grammar().parseFile(open('usb.ids')) args = sys.argv[1:]
usb_vendor_model(p)
usb_classes(p)
p = pci_ids_grammar().parseFile(open('pci.ids')) if not args or 'usb' in args:
pci_vendor_model(p) p = usb_ids_grammar().parseFile(open('usb.ids'))
pci_classes(p) usb_vendor_model(p)
usb_classes(p)
p = pci_ids_grammar().parseFile(open('sdio.ids')) if not args or 'pci' in args:
sdio_vendor_model(p) p = pci_ids_grammar().parseFile(open('pci.ids'))
sdio_classes(p) pci_vendor_model(p)
pci_classes(p)
p = oui_grammar('small').parseFile(open('ma-small.txt')) if not args or 'sdio' in args:
p2 = oui_grammar('medium').parseFile(open('ma-medium.txt')) p = pci_ids_grammar().parseFile(open('sdio.ids'))
p3 = oui_grammar('large').parseFile(open('ma-large.txt')) sdio_vendor_model(p)
sdio_classes(p)
oui(p, p2, p3) if not args or 'oui' in args:
p = oui_grammar('small').parseFile(open('ma-small.txt'))
p2 = oui_grammar('medium').parseFile(open('ma-medium.txt'))
p3 = oui_grammar('large').parseFile(open('ma-large.txt'))
oui(p, p2, p3)