PluginInfo.py 491 B

123456789101112131415
  1. from UM.PluginObject import PluginObject
  2. class PluginInfo(PluginObject):
  3. __instance = None # type: PluginInfo
  4. def __init__(self, *args, **kwags):
  5. if PluginInfo.__instance is not None:
  6. raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
  7. super().__init__(*args, **kwags)
  8. PluginInfo.__instance = self
  9. @classmethod
  10. def getInstance(cls, *args, **kwargs) -> "PluginInfo":
  11. return cls.__instance