50 @return list containing the variable attributes |
50 @return list containing the variable attributes |
51 @rtype list |
51 @rtype list |
52 """ |
52 """ |
53 d = [] |
53 d = [] |
54 for name in dir(var): |
54 for name in dir(var): |
55 with contextlib.suppress(Exception): |
55 with contextlib.suppress(AttributeError): |
56 attribute = getattr(var, name) |
56 attribute = getattr(var, name) |
57 d.append((name, attribute)) |
57 d.append((name, attribute)) |
58 |
58 |
59 return d |
59 return d |
60 |
60 |
79 containing the variable attributes |
79 containing the variable attributes |
80 @ytype tuple of (int, list) |
80 @ytype tuple of (int, list) |
81 """ |
81 """ |
82 d = [] |
82 d = [] |
83 for name in dir(var): |
83 for name in dir(var): |
84 with contextlib.suppress(Exception): |
84 with contextlib.suppress(AttributeError): |
85 attribute = getattr(var, name) |
85 attribute = getattr(var, name) |
86 d.append((name, attribute)) |
86 d.append((name, attribute)) |
87 |
87 |
88 yield -1, d |
88 yield -1, d |
89 while True: |
89 while True: |
659 containing the variable attributes |
659 containing the variable attributes |
660 @ytype tuple of (int, list) |
660 @ytype tuple of (int, list) |
661 """ |
661 """ |
662 d = [] |
662 d = [] |
663 attributes = () |
663 attributes = () |
664 # Gently handle exception which could occure as special |
664 # Gently handle exception which could occur as special |
665 # cases, e.g. already deleted C++ objects, str conversion.. |
665 # cases, e.g. already deleted C++ objects, str conversion... |
666 with contextlib.suppress(Exception): |
666 with contextlib.suppress(Exception): # secok |
667 qttype = type(var).__name__ |
667 qttype = type(var).__name__ |
668 |
668 |
669 if qttype in ("QLabel", "QPushButton"): |
669 if qttype in ("QLabel", "QPushButton"): |
670 attributes = ("text",) |
670 attributes = ("text",) |
671 elif qttype == "QByteArray": |
671 elif qttype == "QByteArray": |