91 if dlg.exec() == QDialog.DialogCode.Accepted: |
92 if dlg.exec() == QDialog.DialogCode.Accepted: |
92 firstName, lastName, email = dlg.getData() |
93 firstName, lastName, email = dlg.getData() |
93 else: |
94 else: |
94 firstName, lastName, email = ( |
95 firstName, lastName, email = ( |
95 "Firstname", "Lastname", "email_address") |
96 "Firstname", "Lastname", "email_address") |
96 try: |
97 with contextlib.suppress(OSError), open(cfgFile, "w") as f: |
97 with open(cfgFile, "w") as f: |
98 f.write("[user]\n") |
98 f.write("[user]\n") |
99 f.write(" name = {0} {1}\n".format(firstName, lastName)) |
99 f.write(" name = {0} {1}\n".format(firstName, lastName)) |
100 f.write(" email = {0}\n".format(email)) |
100 f.write(" email = {0}\n".format(email)) |
|
101 except OSError: |
|
102 # ignore these |
|
103 pass |
|
104 editor = MiniEditor(cfgFile, "Properties", self) |
101 editor = MiniEditor(cfgFile, "Properties", self) |
105 editor.show() |
102 editor.show() |