Skip to content

Commit 3c3fe61

Browse files
committed
ruff: other fixes
1 parent 5bac6fe commit 3c3fe61

File tree

13 files changed

+10
-24
lines changed

13 files changed

+10
-24
lines changed

safeeyes/core.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import time
2525

2626
from safeeyes import utility
27-
from safeeyes.model import Break
2827
from safeeyes.model import BreakType
2928
from safeeyes.model import BreakQueue
3029
from safeeyes.model import EventHook

safeeyes/model.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ def is_empty(self, break_type=None):
192192
return self.__short_queue is None and self.__long_queue is None
193193

194194
def __next_short(self):
195-
longs = self.__long_queue
196195
shorts = self.__short_queue
197196
break_obj = shorts[self.__current_short]
198197
self.context["break_type"] = "short"

safeeyes/plugins/donotdisturb/plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import os
2222
import logging
23-
import re
2423
import subprocess
2524

2625
import gi

safeeyes/plugins/healthstats/dependency_checker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
# You should have received a copy of the GNU General Public License
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818

19-
import datetime
2019
from safeeyes import utility
2120

2221

safeeyes/plugins/healthstats/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ def _get_next_reset_time():
168168
next_reset_time = cron.get_next(datetime.datetime)
169169
session["next_reset_time"] = next_reset_time.strftime("%Y-%m-%d %H:%M:%S")
170170
logging.debug("Health stats will be reset at " + session["next_reset_time"])
171-
except:
171+
except: # noqa E722
172+
# TODO: consider catching Exception here instead of bare except
172173
logging.error("Error in statistics reset expression: " + statistics_reset_cron)
173174
next_reset_time = None
174175

safeeyes/plugins/screensaver/plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
after long breaks.
2121
"""
2222

23-
import gi
2423
import logging
2524
import os
2625

safeeyes/plugins/smartpause/ext_idle_notify.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,12 @@
1818

1919
# This file is heavily inspired by https://github.com/juienpro/easyland/blob/efc26a0b22d7bdbb0f8436183428f7036da4662a/src/easyland/idle.py
2020

21-
import logging
2221
import threading
2322
import datetime
2423

2524
from pywayland.client import Display
2625
from pywayland.protocol.wayland.wl_seat import WlSeat
27-
from pywayland.protocol.ext_idle_notify_v1 import (
28-
ExtIdleNotificationV1,
29-
ExtIdleNotifierV1
30-
)
26+
from pywayland.protocol.ext_idle_notify_v1 import ExtIdleNotifierV1
3127

3228

3329
class ExtIdleNotify:

safeeyes/plugins/smartpause/plugin.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import subprocess
2222
import threading
2323
import re
24-
import os
2524

2625
from safeeyes import utility
2726
from safeeyes.model import State

safeeyes/plugins/trayicon/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def set_items(self, items):
210210
@staticmethod
211211
def getItemsFlat(items, idToItems):
212212
for item in items:
213-
if item.get("hidden", False) == True:
213+
if item.get("hidden", False):
214214
continue
215215

216216
idToItems[item["id"]] = item
@@ -244,7 +244,7 @@ def itemPropsToDbus(item):
244244

245245
@staticmethod
246246
def itemToDbus(item, recursion_depth):
247-
if item.get("hidden", False) == True:
247+
if item.get("hidden", False):
248248
return None
249249

250250
props = DBusMenuService.itemPropsToDbus(item)
@@ -262,7 +262,7 @@ def itemToDbus(item, recursion_depth):
262262

263263
def findItemsWithParent(self, parent_id, items):
264264
for item in items:
265-
if item.get("hidden", False) == True:
265+
if item.get("hidden", False):
266266
continue
267267
if "children" in item:
268268
if item["id"] == parent_id:

safeeyes/safeeyes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import atexit
2424
import logging
25-
import os
2625
from threading import Timer
2726
from importlib import metadata
2827

@@ -201,6 +200,8 @@ def show_required_plugin_dialog(self, error: RequiredPluginException):
201200
self.required_plugin_dialog_active = True
202201

203202
logging.info("Show RequiredPlugin dialog")
203+
plugin_id = error.get_plugin_id()
204+
204205
dialog = RequiredPluginDialog(
205206
error.get_plugin_id(),
206207
error.get_plugin_name(),

0 commit comments

Comments
 (0)