Don't blow up at plugin start up due to the plugin path not being ready yet

CL-555
This commit is contained in:
Simon Edwards 2017-10-11 11:54:00 +02:00
parent d11b229118
commit 3c69442ceb
2 changed files with 14 additions and 14 deletions

View file

@ -220,7 +220,7 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin):
cluster_size = int(properties.get(b"cluster_size", -1))
if force_cluster or cluster_size >= 0:
printer = NetworkClusterPrinterOutputDevice.NetworkClusterPrinterOutputDevice(
name, address, properties, self._api_prefix, self._plugin_path)
name, address, properties, self._api_prefix)
else:
printer = NetworkPrinterOutputDevice.NetworkPrinterOutputDevice(name, address, properties, self._api_prefix)
self._printers[printer.getKey()] = printer
@ -285,17 +285,6 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin):
Logger.log("d", "Bonjour service removed: %s" % name)
self.removePrinterSignal.emit(str(name))
## For cluster below
def _get_plugin_directory_name(self):
current_file_absolute_path = os.path.realpath(__file__)
directory_path = os.path.dirname(current_file_absolute_path)
_, directory_name = os.path.split(directory_path)
return directory_name
@property
def _plugin_path(self):
return PluginRegistry.getInstance().getPluginPath(self._get_plugin_directory_name())
@pyqtSlot()
def openControlPanel(self):
Logger.log("d", "Opening print jobs web UI...")