66 try: |
66 try: |
67 jsonString = json.dumps(multiProjectDict, indent=2) |
67 jsonString = json.dumps(multiProjectDict, indent=2) |
68 with open(filename, "w") as f: |
68 with open(filename, "w") as f: |
69 f.write(jsonString) |
69 f.write(jsonString) |
70 except (TypeError, OSError) as err: |
70 except (TypeError, OSError) as err: |
71 with E5OverridenCursor(): |
71 with EricOverridenCursor(): |
72 E5MessageBox.critical( |
72 EricMessageBox.critical( |
73 None, |
73 None, |
74 self.tr("Save Multi Project File"), |
74 self.tr("Save Multi Project File"), |
75 self.tr( |
75 self.tr( |
76 "<p>The multi project file <b>{0}</b> could not be " |
76 "<p>The multi project file <b>{0}</b> could not be " |
77 "written.</p><p>Reason: {1}</p>" |
77 "written.</p><p>Reason: {1}</p>" |
94 try: |
94 try: |
95 with open(filename, "r") as f: |
95 with open(filename, "r") as f: |
96 jsonString = f.read() |
96 jsonString = f.read() |
97 multiProjectDict = json.loads(jsonString) |
97 multiProjectDict = json.loads(jsonString) |
98 except (OSError, json.JSONDecodeError) as err: |
98 except (OSError, json.JSONDecodeError) as err: |
99 E5MessageBox.critical( |
99 EricMessageBox.critical( |
100 None, |
100 None, |
101 self.tr("Read Multi Project File"), |
101 self.tr("Read Multi Project File"), |
102 self.tr( |
102 self.tr( |
103 "<p>The multi project file <b>{0}</b> could not be " |
103 "<p>The multi project file <b>{0}</b> could not be " |
104 "read.</p><p>Reason: {1}</p>" |
104 "read.</p><p>Reason: {1}</p>" |