70 if filename: |
70 if filename: |
71 try: |
71 try: |
72 with open(filename, "r") as f: |
72 with open(filename, "r") as f: |
73 jsonString = f.read() |
73 jsonString = f.read() |
74 themeDict = json.loads(jsonString) |
74 themeDict = json.loads(jsonString) |
75 except (TypeError, OSError) as err: |
75 except (OSError, TypeError) as err: |
76 EricMessageBox.critical( |
76 EricMessageBox.critical( |
77 None, |
77 None, |
78 self.tr("Import Theme"), |
78 self.tr("Import Theme"), |
79 self.tr( |
79 self.tr( |
80 "<p>The theme file <b>{0}</b> could not" |
80 "<p>The theme file <b>{0}</b> could not" |
200 |
200 |
201 try: |
201 try: |
202 jsonString = json.dumps(themeDict, indent=2) |
202 jsonString = json.dumps(themeDict, indent=2) |
203 with open(filename, "w") as f: |
203 with open(filename, "w") as f: |
204 f.write(jsonString) |
204 f.write(jsonString) |
205 except (TypeError, OSError) as err: |
205 except (OSError, TypeError) as err: |
206 EricMessageBox.critical( |
206 EricMessageBox.critical( |
207 None, |
207 None, |
208 self.tr("Export Theme"), |
208 self.tr("Export Theme"), |
209 self.tr( |
209 self.tr( |
210 "<p>The theme file <b>{0}</b> could not" |
210 "<p>The theme file <b>{0}</b> could not" |