]> sigrok.org Git - libsigrok.git/commitdiff
python: Add ConfigKey.info and ConfigKey.<id> shortcuts.
authorMartin Ling <redacted>
Tue, 17 Dec 2013 13:01:35 +0000 (13:01 +0000)
committerMartin Ling <redacted>
Tue, 17 Dec 2013 13:01:35 +0000 (13:01 +0000)
bindings/python/sigrok/core/classes.py

index 5f38028ffae5be6e392dd8fa83cb46fad5764b18..6b5325baa58a98fd8fc6d35a45a2fb28fc008a04 100644 (file)
@@ -608,4 +608,9 @@ for symbol_name in dir(lowlevel):
         if symbol_name.startswith(prefix):
             name = symbol_name[len(prefix):]
             value = getattr(lowlevel, symbol_name)
-            setattr(cls, name, cls(value))
+            obj = cls(value)
+            setattr(cls, name, obj)
+            if cls is ConfigKey:
+                obj.info = ConfigInfo(obj)
+                if obj.info:
+                    setattr(cls, obj.info.id, obj)