From b22c4508e63dbaba49a68f7a30eeea12ffffb37d Mon Sep 17 00:00:00 2001 From: "Nicholas H.Tollervey" Date: Sat, 13 Mar 2021 15:41:20 +0000 Subject: [PATCH] Beta 2 --- mu/__init__.py | 2 +- mu/interface/dialogs.py | 9 ++++++--- mu/virtual_environment.py | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mu/__init__.py b/mu/__init__.py index aa77b7b8a..d7789a648 100644 --- a/mu/__init__.py +++ b/mu/__init__.py @@ -6,7 +6,7 @@ __title__ = "mu-editor" __description__ = "A simple Python editor for beginner programmers." -__version__ = "1.1.0.beta.1" +__version__ = "1.1.0.beta.2" __license__ = "GPL3" __url__ = "https://github.com/mu-editor/mu" diff --git a/mu/interface/dialogs.py b/mu/interface/dialogs.py index 402339298..03ff21036 100644 --- a/mu/interface/dialogs.py +++ b/mu/interface/dialogs.py @@ -573,7 +573,9 @@ def replace_flag(self): class PackageDialog(QDialog): - """Display the output of the pip commands needed to remove or install packages + """ + Display the output of the pip commands needed to remove or install + packages. Because the QProcess mechanism we're using is asynchronous, we have to manage the pip requests via `pip_queue`. When one request is signalled @@ -616,7 +618,9 @@ def setup(self, to_remove, to_add): QTimer.singleShot(2, self.next_pip_command) def next_pip_command(self): - """Run the next pip command, finishing if there is none""" + """ + Run the next pip command, finishing if there is none. + """ if self.pip_queue: command, packages = self.pip_queue.pop() self.run_pip(command, packages) @@ -643,7 +647,6 @@ def run_pip(self, command, packages): raise RuntimeError( "Invalid pip command: %s %s" % (command, packages) ) - pip_fn( packages, slots=venv.Slots( diff --git a/mu/virtual_environment.py b/mu/virtual_environment.py index 3d583e173..304a072e2 100644 --- a/mu/virtual_environment.py +++ b/mu/virtual_environment.py @@ -173,7 +173,8 @@ def __init__(self, pip_executable): def run( self, command, *args, wait_for_s=30.0, slots=Process.Slots(), **kwargs ): - """Run a command with args, treating kwargs as Posix switches + """ + Run a command with args, treating kwargs as Posix switches. eg run("python", version=True) run("python", "-c", "import sys; print(sys.executable)") @@ -217,7 +218,7 @@ def run( def install(self, packages, slots=Process.Slots(), **kwargs): """ - Use pip to install a package or packages + Use pip to install a package or packages. If the first parameter is a string one package is installed; otherwise it is assumed to be an iterable of package names.