Skip to content

Commit cb7052e

Browse files
author
Axel Hörteborn
committed
Fixed black issues
1 parent 4e650d6 commit cb7052e

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

a00_qpip/plugin.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, iface, plugin_path=None):
2626
self._defered_packages = []
2727
self.settings = QgsSettings()
2828
self.settings.beginGroup("QPIP")
29-
29+
3030
if plugin_path is None:
3131
self.plugins_path = os.path.join(
3232
QgsApplication.qgisSettingsDirPath(), "python", "plugins"
@@ -74,9 +74,7 @@ def initGui(self):
7474
def initComplete(self):
7575
if self._defered_packages:
7676
log(f"Initialization complete. Loading deferred packages")
77-
dialog, run_gui = self.check_deps(
78-
additional_plugins=self._defered_packages
79-
)
77+
dialog, run_gui = self.check_deps(additional_plugins=self._defered_packages)
8078
if run_gui:
8179
self.promt_install(dialog)
8280
self.save_settings(dialog)
@@ -98,7 +96,9 @@ def unload(self):
9896
os.environ["PYTHONPATH"] = os.environ["PYTHONPATH"].replace(
9997
self.bin_path + os.pathsep, ""
10098
)
101-
os.environ["PATH"] = os.environ["PATH"].replace(self.bin_path + os.pathsep, "")
99+
os.environ["PATH"] = os.environ["PATH"].replace(
100+
self.bin_path + os.pathsep, ""
101+
)
102102

103103
def patched_load_plugin(self, packageName):
104104
"""
@@ -183,7 +183,7 @@ def check_deps(self, additional_plugins=[]) -> MainDialog | bool:
183183
libs.values(), self._check_on_startup(), self._check_on_install()
184184
)
185185
return dialog, needs_gui
186-
186+
187187
def promt_install(self, dialog: MainDialog):
188188
"""Promts the install dialog and ask the user what to install"""
189189
if dialog.exec_():
@@ -196,7 +196,7 @@ def promt_install(self, dialog: MainDialog):
196196
if reqs_to_install:
197197
log(f"Will install selected dependencies : {reqs_to_install}")
198198
self.pip_install_reqs(reqs_to_install)
199-
199+
200200
def save_settings(self, dialog):
201201
"""Stores the settings values"""
202202
sys.path_importer_cache.clear()

tests/test_finding_req.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,40 @@
77

88
from a00_qpip.plugin import Plugin
99

10+
1011
class initializationCompleted:
1112
def connect(self):
1213
pass
1314

15+
1416
def popWidget():
1517
return True
1618

19+
1720
THIS_DIR = os.path.dirname(__file__)
1821

22+
1923
@pytest.fixture()
2024
def plugin(qgis_iface):
2125
qgis_iface.initializationCompleted = initializationCompleted
2226
qgis_iface.messageBar().popWidget = popWidget
23-
plugin = Plugin(qgis_iface, '.')
27+
plugin = Plugin(qgis_iface, ".")
2428
yield plugin
2529

2630

2731
def test_plugin_a(plugin: Plugin):
28-
plugin_a = os.path.join(THIS_DIR, '..', 'test_plugins', 'plugin_a')
32+
plugin_a = os.path.join(THIS_DIR, "..", "test_plugins", "plugin_a")
2933
dialog, needs_gui = plugin.check_deps([plugin_a])
3034
libs = dialog.reqs_to_install
3135
assert len(libs) == 2
32-
assert libs[0] == 'cowsay==4.0'
36+
assert libs[0] == "cowsay==4.0"
3337
assert needs_gui
3438

3539

3640
def test_plugin_b(plugin: Plugin):
37-
plugin_b = os.path.join(THIS_DIR, '..', 'test_plugins', 'plugin_b')
41+
plugin_b = os.path.join(THIS_DIR, "..", "test_plugins", "plugin_b")
3842
dialog, needs_gui = plugin.check_deps([plugin_b])
3943
libs = dialog.reqs_to_install
4044
assert len(libs) == 2
41-
assert libs[0] == 'cowsay==5.0'
45+
assert libs[0] == "cowsay==5.0"
4246
assert needs_gui

0 commit comments

Comments
 (0)