added a way to delete the file config

master
kirbylife 2020-12-08 19:42:02 -06:00
parent 58f3d9c9d4
commit dde1d50954
2 changed files with 9 additions and 2 deletions

View File

@ -94,7 +94,8 @@ class MunyalClient(Icon):
while True:
print("Conectando al websocket")
ws = websocket.WebSocketApp(
"ws://127.0.0.1:12345",
f"ws://{self.config['login']['user']}.loca.lt",
# "ws://127.0.0.1:12345",
on_message=print,
on_error=print,
on_close=lambda soc: self.__ws_close(ws))

View File

@ -1,4 +1,5 @@
import os
import sys
import pathlib
import pickle
from hashlib import sha256
@ -17,6 +18,8 @@ def __get_config_folder():
folder = os.path.join(os.path.expandvars("%APPDATA%"), "Munyal")
return folder
def __get_files_folder():
folder = os.path.join(os.path.expanduser("~"), Munyal)
def get_config():
while True:
@ -85,7 +88,7 @@ def gui_config():
passwd_field = Entry(root, textvariable=passwd, show="*")
folder = StringVar()
folder.set(__get_config_folder())
folder.set(__get_files_folder())
folder_field = Entry(root, textvariable=folder)
btn_folder = Button(root,
text="Examinar",
@ -120,4 +123,7 @@ def search_folder(field):
if __name__ == "__main__":
if "--restart" in sys.argv:
if __get_config():
os.removedirs(__get_config_folder())
print(get_config())