add Class StartStopBTN to wg_func.py
This commit is contained in:
20
wg_func.py
20
wg_func.py
@ -41,6 +41,23 @@ class GreenLabel(tk.Tk):
|
||||
self.lb_tunnel.grid(column=3, row=1, sticky="w")
|
||||
|
||||
|
||||
class StartStopBTN(tk.Tk):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.wg_switch = None
|
||||
self.btn_stst = None
|
||||
self.wg_vpn_start = tk.PhotoImage(file=r'icons/wg-vpn-start-48.png')
|
||||
self.wg_vpn_stop = tk.PhotoImage(file=r'icons/wg-vpn-stop-48.png')
|
||||
|
||||
def button_stop(self):
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_stop, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=15, sticky="s")
|
||||
|
||||
def button_start(self):
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_start, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=15, sticky="s")
|
||||
|
||||
|
||||
class ConToDict:
|
||||
@classmethod
|
||||
def covert_to_dict(cls, file):
|
||||
@ -138,8 +155,7 @@ class ImportTunnel:
|
||||
self.lb_tunnel = tk.Label(self, textvariable=self.StrVar, fg='green')
|
||||
self.lb_tunnel.config(font=("Ubuntu", 11, "bold"))
|
||||
self.lb_tunnel.grid(column=3, row=1, sticky="w")
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_stop, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=15, sticky="s")
|
||||
StartStopBTN.button_stop(self)
|
||||
wg_read = os.environ['HOME'] + '/tester/' + str(self.a) + '.conf'
|
||||
file = open(wg_read, 'r')
|
||||
ConToDict.covert_to_dict(file)
|
||||
|
Reference in New Issue
Block a user