removed global vars/wildcard imports

This commit is contained in:
Eric Lay 2023-12-16 09:10:23 -06:00
parent 7d27196f96
commit be62ddb4bf
1 changed files with 2 additions and 8 deletions

View File

@ -8,12 +8,8 @@ import subprocess
from os import path from os import path
from functools import partial from functools import partial
from PyQt5.QtCore import QTimer from PyQt5.QtCore import QTimer
from PyQt5.QtGui import * from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import * from PyQt5.QtWidgets import QAction, QApplication, QSystemTrayIcon, QMenu
# Available Updates holders
avail = ""
outputList = ""
# Use config.yml file to allow for compatibility with # Use config.yml file to allow for compatibility with
# most terminal emulators possible, custom timer duration and icons # most terminal emulators possible, custom timer duration and icons
@ -61,7 +57,6 @@ match icn:
def count(): def count():
cmd = ['checkupdates'] cmd = ['checkupdates']
p1 = subprocess.Popen(cmd,stdout=subprocess.PIPE) p1 = subprocess.Popen(cmd,stdout=subprocess.PIPE)
global outputList
outputList = ((p1.communicate()[0]).decode()).rstrip('\n') outputList = ((p1.communicate()[0]).decode()).rstrip('\n')
outputCount = len(outputList.splitlines()) outputCount = len(outputList.splitlines())
if outputCount == 0: if outputCount == 0:
@ -73,7 +68,6 @@ def count():
menu.addAction(quit) menu.addAction(quit)
for i in outputList.splitlines(): for i in outputList.splitlines():
menu.addAction(i, partial(infos, i)) menu.addAction(i, partial(infos, i))
global avail
avail = str(outputCount)+" Updates" avail = str(outputCount)+" Updates"
tray.setToolTip(avail) tray.setToolTip(avail)
tray.setVisible(True) tray.setVisible(True)