From dde1d50954974e90f6303674a07d1e8b474749e3 Mon Sep 17 00:00:00 2001
From: kirbylife <gabriel13m@gmail.com>
Date: Tue, 8 Dec 2020 19:42:02 -0600
Subject: [PATCH] added a way to delete the file config

---
 client.py | 3 ++-
 config.py | 8 +++++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/client.py b/client.py
index a9929f2..441e77e 100755
--- a/client.py
+++ b/client.py
@@ -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))
diff --git a/config.py b/config.py
index 732af03..b9bf093 100644
--- a/config.py
+++ b/config.py
@@ -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())