mirror of
https://github.com/AsahiLinux/m1n1
synced 2025-02-16 21:58:27 +00:00
m1n1.constructutils: Do not print Ver-disabled fields
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
b95860ee10
commit
a87d85a7a2
1 changed files with 8 additions and 0 deletions
|
@ -173,6 +173,9 @@ class ReloadableConstructMeta(ReloadableMeta, Construct):
|
|||
except:
|
||||
sizeof = None
|
||||
if isinstance(subcon, Ver):
|
||||
if not subcon._active():
|
||||
cls._off[subcon.name] = -1, 0
|
||||
continue
|
||||
subcon = subcon.subcon
|
||||
if isinstance(subcon, Renamed):
|
||||
name = subcon.name
|
||||
|
@ -417,6 +420,11 @@ class ConstructClass(ConstructClassBase, Container):
|
|||
keys.sort(key = lambda x: self._off.get(x, (-1, 0))[0])
|
||||
|
||||
for key in keys:
|
||||
if key in self._off:
|
||||
offv, sizeof = self._off[key]
|
||||
if offv == -1:
|
||||
print(key, offv, sizeof)
|
||||
continue
|
||||
if key in ignore or key.startswith('_'):
|
||||
continue
|
||||
value = getattr(self, key)
|
||||
|
|
Loading…
Add table
Reference in a new issue