Skip to content

Commit

Permalink
Move backend plugin logic to Cura from Uranium
Browse files Browse the repository at this point in the history
I was running into abstraction issues when it was defined in Uranium.
Instead of trying to fight those, it's just easier to move it to Cura

CURA-10717
  • Loading branch information
nallath committed Jul 11, 2023
1 parent bfebc9a commit c22f729
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 97 deletions.
8 changes: 0 additions & 8 deletions UM/Application.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
from UM.Backend.Backend import Backend
from UM.Settings.ContainerStack import ContainerStack
from UM.Extension import Extension
from UM.BackendPlugin import BackendPlugin


@signalemitter
Expand Down Expand Up @@ -199,7 +198,6 @@ def initialize(self) -> None:
i18nCatalog.setApplication(self)

PluginRegistry.addType("backend", self.setBackend)
PluginRegistry.addType("backend_plugin", self.addBackendPlugin)
PluginRegistry.addType("logger", Logger.addLogger)
PluginRegistry.addType("extension", self.addExtension)
PluginRegistry.addType("file_provider", self.addFileProvider)
Expand Down Expand Up @@ -481,12 +479,6 @@ def addExtension(self, extension: "Extension") -> None:
def getExtensions(self) -> List["Extension"]:
return self._extensions

def addBackendPlugin(self, backend_plugin: "BackendPlugin") -> None:
self._backend_plugins.append(backend_plugin)

def getBackendPlugins(self) -> List["BackendPlugin"]:
return self._backend_plugins

def addFileProvider(self, file_provider: "FileProvider") -> None:
self._file_providers.append(file_provider)

Expand Down
15 changes: 0 additions & 15 deletions UM/Backend/Backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def __init__(self) -> None:

self._socket = None
self._port = 49674
self._last_backend_plugin_port = self._port + 1000
self._process: Optional[subprocess.Popen] = None
self._backend_log: List[bytes] = []
self._backend_log_max_lines = None
Expand All @@ -77,20 +76,6 @@ def setState(self, new_state: BackendState) -> None:
if self._backend_state == BackendState.Done:
self.backendDone.emit()

def startPlugins(self) -> None:
"""
Ensure that all backend plugins are started
:return:
"""
backend_plugins = UM.Application.Application.getInstance().getBackendPlugins()
for backend_plugin in backend_plugins:
if backend_plugin.isRunning():
continue
# Set the port to prevent plugins from using the same one.
backend_plugin.setPort(self._last_backend_plugin_port)
self.__last_backend_plugin_port += 1
backend_plugin.start()

def startEngine(self) -> None:
"""
Start the backend / engine.
Expand Down
74 changes: 0 additions & 74 deletions UM/BackendPlugin.py

This file was deleted.

0 comments on commit c22f729

Please sign in to comment.