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. super().__init__(*args, **kwags)
  6. if PluginInfo.__instance is not None:
  7. raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
  8. PluginInfo.__instance = self
  9. @classmethod
  10. def getInstance(cls, *args, **kwargs) -> "PluginInfo":
  11. return cls.__instance