62 |
62 |
63 try: |
63 try: |
64 jsonString = json.dumps(userProjectDict, indent=2) |
64 jsonString = json.dumps(userProjectDict, indent=2) |
65 with open(filename, "w") as f: |
65 with open(filename, "w") as f: |
66 f.write(jsonString) |
66 f.write(jsonString) |
67 except (TypeError, EnvironmentError) as err: |
67 except (TypeError, OSError) as err: |
68 with E5OverridenCursor(): |
68 with E5OverridenCursor(): |
69 E5MessageBox.critical( |
69 E5MessageBox.critical( |
70 None, |
70 None, |
71 self.tr("Save User Project Properties"), |
71 self.tr("Save User Project Properties"), |
72 self.tr( |
72 self.tr( |
91 """ |
91 """ |
92 try: |
92 try: |
93 with open(filename, "r") as f: |
93 with open(filename, "r") as f: |
94 jsonString = f.read() |
94 jsonString = f.read() |
95 userProjectDict = json.loads(jsonString) |
95 userProjectDict = json.loads(jsonString) |
96 except (EnvironmentError, json.JSONDecodeError) as err: |
96 except (OSError, json.JSONDecodeError) as err: |
97 E5MessageBox.critical( |
97 E5MessageBox.critical( |
98 None, |
98 None, |
99 self.tr("Read User Project Properties"), |
99 self.tr("Read User Project Properties"), |
100 self.tr( |
100 self.tr( |
101 "<p>The user specific project properties file <b>{0}</b>" |
101 "<p>The user specific project properties file <b>{0}</b>" |