diff --git a/cruiz/commands/conaninvocation.py b/cruiz/commands/conaninvocation.py index ffedab6..89265d6 100755 --- a/cruiz/commands/conaninvocation.py +++ b/cruiz/commands/conaninvocation.py @@ -47,10 +47,9 @@ class ConanInvocation(QtCore.QObject): def __del__(self) -> None: logger.debug("-=%d", id(self)) - def __init__(self, log_details: LogDetails) -> None: + def __init__(self) -> None: logger.debug("+=%d", id(self)) super().__init__() # note that parent is None - self._log_details = log_details self._mp_context = multiprocessing.get_context("spawn") self._process_queue = self._mp_context.Queue() self._thread = QtCore.QThread() @@ -119,7 +118,7 @@ def invoke( self._queue_processor.critical_failure.connect(self._critical_failure) with GeneralSettingsReader() as settings: clear_panes = settings.clear_panes.resolve() - if clear_panes and isinstance(log_details, LogDetails): + if clear_panes: log_details.output.clear() if log_details.error: log_details.error.clear() diff --git a/cruiz/commands/context.py b/cruiz/commands/context.py index 3fff112..a924778 100755 --- a/cruiz/commands/context.py +++ b/cruiz/commands/context.py @@ -145,7 +145,6 @@ def _start_invocation( PackageRevisionsParameters, PackageBinaryParameters, ], - log_details: LogDetails, command_toolbar: typing.Optional[QtWidgets.QWidget], continuation: typing.Optional[typing.Callable[[typing.Any, typing.Any], None]], enable_history: bool = True, @@ -153,12 +152,12 @@ def _start_invocation( added_environment, removed_environment = get_conan_env(self.cache_name) parameters.added_environment.update(added_environment) parameters.removed_environment.extend(removed_environment) - instance = ConanInvocation(self._log_details) + instance = ConanInvocation() instance.completed.connect(self._completed_invocation) instance.finished.connect(self._finished_invocation) if command_toolbar: instance.finished.connect(command_toolbar.command_ended) - instance.invoke(parameters, log_details, continuation) + instance.invoke(parameters, self._log_details, continuation) self._invocations.append(instance) if self.command_history_widget is not None and enable_history: # TODO: prefer adding to a model? @@ -183,7 +182,6 @@ def _finished_invocation(self) -> None: def conancommand( self, params: CommandParameters, - log_details: LogDetails, command_toolbar: typing.Optional[QtWidgets.QWidget], continuation: typing.Optional[ typing.Callable[[typing.Any, typing.Any], None] @@ -193,12 +191,11 @@ def conancommand( Run a conan command, with parameters as provided, and a continuation if further processing is needed """ - self._start_invocation(params, log_details, command_toolbar, continuation) + self._start_invocation(params, command_toolbar, continuation) def cmakebuildcommand( self, params: CommandParameters, - log_details: LogDetails, command_toolbar: typing.Optional[QtWidgets.QWidget], continuation: typing.Optional[ typing.Callable[[typing.Any, typing.Any], None] @@ -208,7 +205,10 @@ def cmakebuildcommand( Invoke the CMake build tool on the build folder of the recipe """ self._start_invocation( - params, log_details, command_toolbar, continuation, enable_history=False + params, + command_toolbar, + continuation, + enable_history=False, ) # pylint: disable=pointless-string-statement @@ -295,7 +295,7 @@ def remove_all_packages( "removeallpackages", cruiz.workers.removeallpackages.invoke ) params.force = True - self._start_invocation(params, self._log_details, None, continuation) + self._start_invocation(params, None, continuation) def remove_local_cache_locks( self, @@ -305,7 +305,7 @@ def remove_local_cache_locks( Run 'conan remove --locks' to remove all lock files from the local cache """ params = CommandParameters("removelocks", cruiz.workers.removelocks.invoke) - self._start_invocation(params, self._log_details, None, continuation) + self._start_invocation(params, None, continuation) def install_config( self, @@ -317,7 +317,7 @@ def install_config( """ Run 'conan config install [--args -b branch] [-s source] [-t target]' """ - self._start_invocation(params, self._log_details, None, continuation) + self._start_invocation(params, None, continuation) def remotes_sync(self, remotes: typing.List[ConanRemote]) -> None: """ @@ -373,13 +373,12 @@ def get_package_details( PackageRevisionsParameters, PackageBinaryParameters, ], - log_details: LogDetails, continuation: typing.Optional[typing.Callable[[typing.Any, typing.Any], None]], ) -> None: """ Perform one of the actions to get package details from a remote. """ - self._start_invocation(params, log_details, None, continuation) + self._start_invocation(params, None, continuation) def get_package_directory(self, pkgdata: PackageNode) -> str: """ @@ -513,7 +512,7 @@ def run_any_command( Run an arbitrary Conan command in the local cache. """ - self._start_invocation(params, self._log_details, None, continuation) + self._start_invocation(params, None, continuation) # TODO: remove editables def get_editables_list(self) -> typing.Dict[str, str]: diff --git a/cruiz/recipe/recipewidget.py b/cruiz/recipe/recipewidget.py index c91655d..b607803 100755 --- a/cruiz/recipe/recipewidget.py +++ b/cruiz/recipe/recipewidget.py @@ -1040,7 +1040,6 @@ def _generate_dependency_graph( params.add_option(params.name, key, value) # type: ignore self._dependency_generate_context.conancommand( params, - self._dependency_generate_log, None, self._on_dependency_graph_generated, ) diff --git a/cruiz/recipe/toolbars/command.py b/cruiz/recipe/toolbars/command.py index 58f90dd..5bba65a 100755 --- a/cruiz/recipe/toolbars/command.py +++ b/cruiz/recipe/toolbars/command.py @@ -569,7 +569,6 @@ def _conan_create_common( self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_create_params(recipe_attributes, args), - recipe_widget.log_details, self, ) @@ -590,7 +589,6 @@ def _conan_install_common( self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_install_params(recipe_attributes, args), - recipe_widget.log_details, self, ) @@ -609,7 +607,6 @@ def _conan_imports(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_imports_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -622,7 +619,6 @@ def _conan_source(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_source_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -635,7 +631,6 @@ def _conan_build(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_build_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -648,7 +643,6 @@ def _conan_package(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_package_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -661,7 +655,6 @@ def _conan_export_package(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_export_package_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -674,7 +667,6 @@ def _conan_test(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_test_package_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -692,7 +684,6 @@ def _conan_remove(self) -> None: self.command_started.emit() recipe_widget.recipe.context.conancommand( self._make_conan_remove_package_params(recipe_attributes), - recipe_widget.log_details, self, ) @@ -702,7 +693,6 @@ def _cmake_build_common( # TODO review recipe_widget = self._recipe_widget recipe = recipe_widget.recipe - log_details = recipe_widget.log_details params = CommandParameters( "cmakebuild", cruiz.workers.cmakebuildtool.invoke ) # TODO: verb is wrong @@ -720,7 +710,7 @@ def _cmake_build_common( if args: params.arguments.extend(args) self.command_started.emit() - recipe.context.cmakebuildcommand(params, log_details, self) + recipe.context.cmakebuildcommand(params, self) def _cmake_build(self) -> None: self._cmake_build_common() @@ -732,7 +722,6 @@ def _cmake_remove_cache(self) -> None: # TODO: review recipe_widget = self._recipe_widget recipe = recipe_widget.recipe - log_details = recipe_widget.log_details params = CommandParameters( "cmakeremovecache", cruiz.workers.deletecmakecache.invoke ) # TODO: verb is wrong @@ -743,7 +732,7 @@ def _cmake_remove_cache(self) -> None: build_folder = settings.local_workflow_build_folder.resolve() params.build_folder = recipe_widget.resolve_expression(build_folder) self.command_started.emit() - recipe.context.cmakebuildcommand(params, log_details, self) + recipe.context.cmakebuildcommand(params, self) def _generate_command_tooltip(self, params: CommandParameters) -> str: tooltip = StringIO() diff --git a/cruiz/remote_browser/pages/packagebinarypage.py b/cruiz/remote_browser/pages/packagebinarypage.py index 31d0948..2189b50 100644 --- a/cruiz/remote_browser/pages/packagebinarypage.py +++ b/cruiz/remote_browser/pages/packagebinarypage.py @@ -322,7 +322,7 @@ def showEvent(self, event: QtGui.QShowEvent) -> None: remote_name=self._ui.remote.currentText(), where=self._artifact_folder, ) - self._context.get_package_details(params, self._log_details, self._complete) + self._context.get_package_details(params, self._complete) def _complete(self, results: typing.Any, exception: typing.Any) -> None: self._enable_progress(False) diff --git a/cruiz/remote_browser/pages/packageidpage.py b/cruiz/remote_browser/pages/packageidpage.py index 8ca1bde..7492d8e 100644 --- a/cruiz/remote_browser/pages/packageidpage.py +++ b/cruiz/remote_browser/pages/packageidpage.py @@ -348,7 +348,7 @@ def _compute(self) -> None: reference=pkgref, remote_name=self._ui.remote.currentText(), ) - self._context.get_package_details(params, self._log_details, self._complete) + self._context.get_package_details(params, self._complete) def _on_restart(self) -> None: self._filtering_model.invalidate() diff --git a/cruiz/remote_browser/pages/packagereferencepage.py b/cruiz/remote_browser/pages/packagereferencepage.py index eedc93d..c247adc 100644 --- a/cruiz/remote_browser/pages/packagereferencepage.py +++ b/cruiz/remote_browser/pages/packagereferencepage.py @@ -164,7 +164,7 @@ def _search(self) -> None: case_sensitive=True, alias_aware=self._ui.alias_aware.isChecked(), ) - self._context.get_package_details(params, self._log_details, self._complete) + self._context.get_package_details(params, self._complete) def _complete(self, results: typing.Any, exception: typing.Any) -> None: self._enable_progress(False) diff --git a/cruiz/remote_browser/pages/packagerevisionpage.py b/cruiz/remote_browser/pages/packagerevisionpage.py index a3cd814..15ed56f 100644 --- a/cruiz/remote_browser/pages/packagerevisionpage.py +++ b/cruiz/remote_browser/pages/packagerevisionpage.py @@ -145,7 +145,7 @@ def _compute(self) -> None: reference=pkgref, remote_name=self._ui.remote.currentText(), ) - self._context.get_package_details(params, self._log_details, self._complete) + self._context.get_package_details(params, self._complete) def _on_restart(self) -> None: self._open_start() diff --git a/cruiz/remote_browser/pages/reciperevisionpage.py b/cruiz/remote_browser/pages/reciperevisionpage.py index 880db40..4521942 100644 --- a/cruiz/remote_browser/pages/reciperevisionpage.py +++ b/cruiz/remote_browser/pages/reciperevisionpage.py @@ -144,7 +144,7 @@ def _compute(self) -> None: reference=pkgref, remote_name=self._ui.remote.currentText(), ) - self._context.get_package_details(params, self._log_details, self._complete) + self._context.get_package_details(params, self._complete) def _on_copy_pkgref_to_clip(self) -> None: QtWidgets.QApplication.clipboard().setText(self._ui.rrev_pkgref.text())