Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PluginInfo.py « XmlMaterialProfile « plugins - github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b78a47a5efb6180ea24f13d4dc0f233418d0436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from UM.PluginObject import PluginObject


class PluginInfo(PluginObject):
    __instance = None # type: PluginInfo

    def __init__(self, *args, **kwags):
        super().__init__(*args, **kwags)
        if PluginInfo.__instance is not None:
            raise RuntimeError("Try to create singleton '%s' more than once" % self.__class__.__name__)
        PluginInfo.__instance = self

    @classmethod
    def getInstance(cls, *args, **kwargs) -> "PluginInfo":
        return cls.__instance