From f827dc8ff5c698053deaca7b3035e745aa2e62fd Mon Sep 17 00:00:00 2001 From: Ramin Date: Fri, 16 Feb 2024 12:26:38 +0330 Subject: [PATCH] save url for next use --- ross_ui/controller/mainWindow.py | 7 +++++++ ross_ui/model/api.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ross_ui/controller/mainWindow.py b/ross_ui/controller/mainWindow.py index 773cc71..062e049 100644 --- a/ross_ui/controller/mainWindow.py +++ b/ross_ui/controller/mainWindow.py @@ -107,6 +107,11 @@ def __init__(self): self.closeBottonPCAManual.clicked.connect(self.PCAManualCloseButton) self.doneBottonPCAManual.clicked.connect(self.PCAManualDoneButton) + + if os.path.isfile('./.tmp/url'): + with open('./.tmp/url', 'r') as f: + self.url = f.read() + def resetOnSignOutVars(self): self.raw = None @@ -447,6 +452,8 @@ def open_server_dialog(self): dialog = server_form(server_text=self.url) if dialog.exec_() == QtWidgets.QDialog.Accepted: self.url = dialog.lineEdit.text() + with open('./.tmp/url', 'w') as f: + f.write(self.url) def open_raw_dialog(self, variables): dialog = raw_form(variables) diff --git a/ross_ui/model/api.py b/ross_ui/model/api.py index c2ad23a..b02007a 100644 --- a/ross_ui/model/api.py +++ b/ross_ui/model/api.py @@ -4,7 +4,7 @@ import requests -class API(): +class API: def __init__(self, url): self.url = url self.refresh_token = None