mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
Discover all non-abstract subclasses of ConfigurableParameter in ConfigurableParameter.get_all_implementations(). To be able to automatically discover all practically useful ConfigurableParameter subclasses, introduce the is_abstract flag. ConfigurableParameter itself sets is_abstract = True, by default "hiding" subclasses. As soon as a subclass sets is_abstract = False, it becomes "public". It depends on the calling code to actually implement that decision -- this flag enables calling code to do so sanely. For example, the BinaryParam superclass keeps is_abstract = True, because per se it isn't capable of doing anything. The fully useful K and Opc subclasses set is_abstract = False. Implementation choice: I first tried to query an implicit abstract status via abc / @abstractmethod ways, but it did not match well. A subclass has no good implicit indicator, we need a flag instead. For example, a superclass may provide an apply_val() implementation and hence appear as non-abstract, but it is still not usable because a specific 'key' member is still None, which various subclasses set. Related: SYS#6768 Change-Id: I4970657294130b6b65d50ff19ffbb9ebab3be609