diff options
author | Philipp Hahn <hahn@univention.de> | 2020-04-20 08:55:34 +0200 |
---|---|---|
committer | Philipp Hahn <hahn@univention.de> | 2020-08-06 08:50:37 +0200 |
commit | 809b9631343eebfd7578ea50e5167f2d9fed65d9 (patch) | |
tree | 8939357494009d0794c5957741f41820a7cd525d | |
parent | 94c24929e4877be291cbb5c5f0c9f1b1ab8e9524 (diff) | |
download | libvirt-python-809b9631343eebfd7578ea50e5167f2d9fed65d9.tar.gz |
sanitytest: Use 3-tuple for basicklassmap
Signed-off-by: Philipp Hahn <hahn@univention.de>
-rw-r--r-- | sanitytest.py | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sanitytest.py b/sanitytest.py index 6e9dc16..4d362fb 100644 --- a/sanitytest.py +++ b/sanitytest.py @@ -185,7 +185,7 @@ for cname in wantfunctions: if name[0:8] == "virEvent": if name[-4:] == "Func": continue - basicklassmap[name] = ["libvirt", name, cname] + basicklassmap[name] = ("libvirt", name, cname) else: found = False # To start with map APIs to classes based on the @@ -196,24 +196,20 @@ for cname in wantfunctions: if name[0:klen] == klassname: found = True if name not in basicklassmap: - basicklassmap[name] = [klassname, name[klen:], cname] + basicklassmap[name] = (klassname, name[klen:], cname) elif len(basicklassmap[name]) < klen: - basicklassmap[name] = [klassname, name[klen:], cname] + basicklassmap[name] = (klassname, name[klen:], cname) # Anything which can't map to a class goes into the # global namespaces if not found: - basicklassmap[name] = ["libvirt", name[3:], cname] + basicklassmap[name] = ("libvirt", name[3:], cname) # Phase 4: Deal with oh so many special cases in C -> python mapping finalklassmap = {} # type: Dict[str, Tuple[str, str, str]] -for name in sorted(basicklassmap): - klass = basicklassmap[name][0] - func = basicklassmap[name][1] - cname = basicklassmap[name][2] - +for name, (klass, func, cname) in sorted(basicklassmap.items()): # The object lifecycle APIs are irrelevant since they're # used inside the object constructors/destructors. if func in ["Ref", "Free", "New", "GetConnect", "GetDomain", "GetNetwork"]: |