mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-22 21:59:37 +08:00
15 lines
491 B
Python
15 lines
491 B
Python
from UM.PluginObject import PluginObject
|
|
|
|
|
|
class PluginInfo(PluginObject):
|
|
__instance = None # type: PluginInfo
|
|
|
|
def __init__(self, *args, **kwags):
|
|
if PluginInfo.__instance is not None:
|
|
raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
|
|
super().__init__(*args, **kwags)
|
|
PluginInfo.__instance = self
|
|
|
|
@classmethod
|
|
def getInstance(cls, *args, **kwargs) -> "PluginInfo":
|
|
return cls.__instance |