From 74fbec420912cb286e26f8b9ded79431696bba34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius?= Date: Mon, 17 Jan 2022 09:30:07 -0300 Subject: [PATCH] settings: avoid circular import --- lib/logitech_receiver/settings_templates.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/logitech_receiver/settings_templates.py b/lib/logitech_receiver/settings_templates.py index 0ae5bbb5..7a342eca 100644 --- a/lib/logitech_receiver/settings_templates.py +++ b/lib/logitech_receiver/settings_templates.py @@ -21,8 +21,6 @@ from logging import INFO as _INFO from logging import getLogger from time import time as _time -from solaar.ui import notify as _notify - from . import hidpp10 as _hidpp10 from . import hidpp20 as _hidpp20 from . import special_keys as _special_keys @@ -570,6 +568,10 @@ class DpiSliding(_Setting): _status_changed(self.device, refresh=True) # update main window def displayNewDpi(self, newDpiIdx): + from solaar.ui import notify as _notify + # import here to avoid circular import when running `solaar show`, + # which does not require this method + if _notify.available: reason = 'DPI %d [min %d, max %d]' % (self.dpiChoices[newDpiIdx], self.dpiChoices[0], self.dpiChoices[-1]) # if there is a progress percentage then the reason isn't shown