mirror of
https://github.com/systemd/systemd.git
synced 2025-01-09 01:18:19 +03:00
9a86f08412
Adjust the parsing as it's no longer HTML files. Some IDs end with whitespace, without being quoted, which seems like a mistake as they weren't before, so strip the ID columns before applying them.
33 lines
893 B
Python
Executable File
33 lines
893 B
Python
Executable File
#!/usr/bin/env python3
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
from csv import reader
|
|
from enum import Enum
|
|
|
|
def read_table(a):
|
|
|
|
table = []
|
|
|
|
with open(a, newline='') as csvfile:
|
|
for row in reader(csvfile):
|
|
if row[0] == "Company":
|
|
# Skip header
|
|
continue
|
|
table.append(row)
|
|
|
|
table.sort(key=lambda x: x[1])
|
|
|
|
for row in table:
|
|
# Some IDs end with whitespace, while they didn't in the old HTML table, so it's probably
|
|
# a mistake, strip it.
|
|
print("\nacpi:{0}*:\n ID_VENDOR_FROM_DATABASE={1}".format(row[1].strip(), row[0].strip()))
|
|
|
|
print('# This file is part of systemd.\n'
|
|
'#\n'
|
|
'# Data imported from:\n'
|
|
'# https://uefi.org/uefi-pnp-export\n'
|
|
'# https://uefi.org/uefi-acpi-export')
|
|
|
|
read_table("acpi_id_registry.html")
|
|
read_table("pnp_id_registry.html")
|