MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / __init__

Method __init__

src/astroprint/printer/plugin/__init__.py:23–37  ·  view source on GitHub ↗
(self, pluginId)

Source from the content-addressed store, hash-verified

21 driverName = 'plugin'
22
23 def __init__(self, pluginId):
24 self._comm = True # This isn't really used by this plugin but the parent class needs it
25
26 #Register to plugin remove events
27 pm = pluginManager()
28
29 self._plugin = pm.getPlugin(pluginId)
30 if self._plugin is None:
31 raise NoPluginException
32
33 self._plugin.initPrinterCommsService(self)
34
35 pm.addEventListener('ON_PLUGIN_REMOVED', self.onPluginRemoved)
36
37 super(PrinterWithPlugin, self).__init__()
38
39 def rampdown(self):
40 pluginManager().removeEventListener('ON_PLUGIN_REMOVED', self.onPluginRemoved)

Callers

nothing calls this directly

Calls 4

pluginManagerFunction · 0.90
getPluginMethod · 0.80
addEventListenerMethod · 0.80

Tested by

no test coverage detected