changed error handling
This commit is contained in:
parent
be62ddb4bf
commit
bacde53401
|
@ -21,7 +21,7 @@ else:
|
|||
try:
|
||||
f = open(config)
|
||||
except FileNotFoundError:
|
||||
print("No config file found\n")
|
||||
print("Error: No config file found\n")
|
||||
sys.exit(1)
|
||||
conf = yaml.load(f,yaml.FullLoader)
|
||||
term = str(conf['terminal'])
|
||||
|
@ -56,6 +56,7 @@ match icn:
|
|||
# Sets the menu options, list and count in proper spots
|
||||
def count():
|
||||
cmd = ['checkupdates']
|
||||
try:
|
||||
p1 = subprocess.Popen(cmd,stdout=subprocess.PIPE)
|
||||
outputList = ((p1.communicate()[0]).decode()).rstrip('\n')
|
||||
outputCount = len(outputList.splitlines())
|
||||
|
@ -71,6 +72,12 @@ def count():
|
|||
avail = str(outputCount)+" Updates"
|
||||
tray.setToolTip(avail)
|
||||
tray.setVisible(True)
|
||||
except subprocess.CalledProcessError:
|
||||
tray.setVisible(False)
|
||||
wait = 1800000
|
||||
updateTimer.killTimer
|
||||
updateTimer.start(wait)
|
||||
print("Error: \'checkupdates\' command unable to retrieve updates\nSetting timer to 30mins\n")
|
||||
|
||||
# Read the News
|
||||
def news():
|
||||
|
|
Loading…
Reference in New Issue