This commit is contained in:
Valerie Wolfe 2021-07-09 12:51:00 -04:00
parent c10b49aa00
commit ad55eab84d

View file

@ -4,7 +4,8 @@ from os.path import expanduser
from subprocess import check_output, Popen from subprocess import check_output, Popen
from sys import argv from sys import argv
from tkinter import Button, Label, Frame, SINGLE, Tk from tkinter import Frame, SINGLE, Tk
from tkinter import Button, Label
if len(argv) != 2: if len(argv) != 2:
print("sysmenu: invalid number of arguments") print("sysmenu: invalid number of arguments")
@ -56,10 +57,10 @@ def font(name):
fontinfo = config[sec] fontinfo = config[sec]
return (fontinfo['family'], fontinfo['size']) return (fontinfo['family'], fontinfo['size'])
def make_button(name): def make_button(name: str):
spec = config[name] spec = config[name]
text = spec['text'] text = spec['text']
if('eval' in spec and bool(spec['eval'])): if 'eval' in spec and bool(spec['eval']):
text = beval(text) text = beval(text)
button = Button( button = Button(
root, root,
@ -78,10 +79,10 @@ def make_button(name):
) )
components.append(button) components.append(button)
def make_label(name): def make_label(name: str):
spec = config[name] spec = config[name]
text = spec['text'] text = spec['text']
if('eval' in spec): if 'eval' in spec and bool(spec['eval']):
text = beval(text) text = beval(text)
label = Label( label = Label(
root, root,