mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-31 10:02:49 +01:00
Scripts: fix old python version compatibility
This commit is contained in:
@@ -55,17 +55,19 @@ typedef struct FFPciVendor
|
||||
|
||||
for vendor in vendors:
|
||||
if vendor.devices:
|
||||
piece = ',\n '.join('{{ 0x{:04X}, "{}" }}'.format(device.id, device.name.replace('"', '\\"')) for device in vendor.devices)
|
||||
code += f"""
|
||||
// {vendor.name}
|
||||
static const FFPciDevice pciDevices_{vendor.id:04X}[] = {{
|
||||
{',\n '.join(f'{{ 0x{device.id:04X}, "{device.name.replace('"', '\\"')}" }}' for device in vendor.devices)},
|
||||
{piece},
|
||||
{{}},
|
||||
}};
|
||||
"""
|
||||
|
||||
piece = ',\n '.join('{{ 0x{:04X}, "{}", {}, {} }}'.format(vendor.id, vendor.name.replace('"', '\\"'), vendor.devices and f"pciDevices_{vendor.id:04X}" or "NULL", len(vendor.devices)) for vendor in vendors)
|
||||
code += f"""
|
||||
const FFPciVendor ffPciVendors[] = {{
|
||||
{',\n '.join(f'{{ 0x{vendor.id:04X}, "{vendor.name.replace('"', '\\"')}", {vendor.devices and f"pciDevices_{vendor.id:04X}" or "NULL"}, {len(vendor.devices)} }}' for vendor in vendors)},
|
||||
{piece},
|
||||
{{}},
|
||||
}};"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user