File: PluginInfo.py

package info (click to toggle)
cura 5.0.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 122,888 kB
  • sloc: python: 44,572; sh: 81; xml: 32; makefile: 16
file content (15 lines) | stat: -rw-r--r-- 491 bytes parent folder | download
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):
        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