22
33#
44# Copyright © 2023 Pablo Sanchez
5- #
5+ #
66# Permission is hereby granted, free of charge, to any person obtaining
77# a copy of this software and associated documentation files (the
88# "Software"), to deal in the Software without restriction, including
99# without limitation the rights to use, copy, modify, merge, publish,
1010# distribute, sublicense, and/or sell copies of the Software, and to
1111# permit persons to whom the Software is furnished to do so, subject to
12- # the following conditions:
13- #
12+ # the following conditions:
13+ #
1414# The above copyright notice and this permission notice shall be
15- # included in all copies or substantial portions of the Software.
16- #
15+ # included in all copies or substantial portions of the Software.
16+ #
1717# The Software is provided "as is", without warranty of any kind,
1818# express or implied, including but not limited to the warranties of
1919# merchantability, fitness for a particular purpose and
2020# noninfringement. In no event shall the authors or copyright holders be
2121# liable for any claim, damages or other liability, whether in an action
2222# of contract, tort or otherwise, arising from, out of or in connection
23- # with the Software or the use or other dealings in the Software.
24- #
23+ # with the Software or the use or other dealings in the Software.
24+ #
2525
2626#
2727# We rely on the shell wrapper to handle parameter validation.
4949# Unread count = N
5050#
5151# Note: We expect, but do not fail, if N is not provided or not an integer.
52- #
52+ #
5353# All other strings are ignored.
5454#
5555# Mouse-clicks
8585# o https://stackoverflow.com/questions/16670125/python-format-string-thousand-separator-with-spaces
8686#
8787
88- from PyQt5 .QtWidgets import QApplication , QMenu , QSystemTrayIcon , qApp , QMessageBox , QMainWindow
88+ from PyQt5 .QtWidgets import QApplication , QMenu , QSystemTrayIcon
8989from PyQt5 .QtGui import QIcon
9090from PyQt5 .QtCore import QProcess , QTimer
9191import sys , signal , locale , os .path , psutil , subprocess
@@ -108,7 +108,7 @@ def find_sub_list(sl,l):
108108#
109109# https://stackoverflow.com/questions/22291434/pyqt-application-closes-successfully-but-process-is-not-killed/22305331
110110#
111- def kill_proc_tree (pid , including_parent = False ):
111+ def kill_proc_tree (pid , including_parent = False ):
112112 parent = psutil .Process (pid )
113113 for child in parent .children (recursive = True ):
114114 child .kill ()
@@ -178,7 +178,7 @@ def __init__(self):
178178
179179 # Number formatting
180180 locale .setlocale (locale .LC_ALL , '' )
181- locale ._override_localeconv = { 'mon_thousands_sep' : ',' }
181+ locale ._override_localeconv [ "mon_thousands_sep" ] = ","
182182
183183 # Start the `new_msgs' process
184184 self .start_process ()
@@ -263,7 +263,7 @@ def gen_menu(self):
263263 str (locale .format_string ('%d' , self .unread_msgs_count , grouping = True , monetary = True )))
264264 else :
265265 self .unreadAction = self .menu .addAction (self .tooltip_error_msg_not_int + str (self .unread_msgs_count ))
266-
266+
267267 self .separator = self .menu .addSeparator ()
268268 self .quitAction = self .menu .addAction ("Quit" )
269269 self .quitAction .triggered .connect (self .quit_cleanup )
@@ -335,7 +335,7 @@ def handle_stdout(self):
335335 self .trayIcon .setToolTip (self .tooltip_error_msg_not_int + str (self .unread_msgs_count ))
336336
337337 self .gen_menu ()
338-
338+
339339 def handle_state (self , state ):
340340 print_debug ('> handle_state()' )
341341 states = {
0 commit comments