Commit a36d8838 authored by Vladislav Yarmak's avatar Vladislav Yarmak

win: ap: add cache to driver identification routine

parent c38b4723
...@@ -8,6 +8,7 @@ import os.path ...@@ -8,6 +8,7 @@ import os.path
from binascii import unhexlify from binascii import unhexlify
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import itertools import itertools
import functools
CRLF = b"\x0d\x0a" CRLF = b"\x0d\x0a"
...@@ -170,6 +171,7 @@ def make_patch(archive, *, ...@@ -170,6 +171,7 @@ def make_patch(archive, *,
return res return res
@functools.lru_cache(maxsize=None)
def identify_driver(archive, *, sevenzip="7z"): def identify_driver(archive, *, sevenzip="7z"):
manifest = extract_single_file(archive, "setup.cfg", sevenzip=sevenzip) manifest = extract_single_file(archive, "setup.cfg", sevenzip=sevenzip)
root = ET.fromstring(manifest) root = ET.fromstring(manifest)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment