Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
Empty strings are stored as None
Browse files Browse the repository at this point in the history
  • Loading branch information
Yas_i_ru committed Jul 15, 2021
1 parent fff3096 commit 8328cbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ def clickMethod(self):
}

for k, v in settings.items():
if v == '':
v = None
if v == "":
settings[k] = None

with open("./.data/settings.json", "w+") as file:
json.dump(settings, file)
Expand Down Expand Up @@ -119,15 +119,15 @@ def retranslateUi(self, Dialog):
class Tray(QSystemTrayIcon):

def __init__(self, icon, parent, Dialog):
QSystemTrayIcon.__init__(self, icon, parent)

try:
with open("./.data/settings.json", "r+") as file:
self.settings = json.load(file)
except:
Dialog.show()
return

QSystemTrayIcon.__init__(self, icon, parent)

menu = QMenu(parent)

self.presence = Presence(self.settings["ApplicationID"])
Expand Down

0 comments on commit 8328cbc

Please sign in to comment.