src/eric7/Project/ProjectFile.py

branch
eric7
changeset 10050
3750abc45d5e
parent 9653
e67609152c5e
child 10154
d833c6a8c41f
equal deleted inserted replaced
10049:61a1757626ac 10050:3750abc45d5e
66 66
67 projectDict["project"] = self.__project.getProjectData() 67 projectDict["project"] = self.__project.getProjectData()
68 68
69 # modify paths to contain universal separators 69 # modify paths to contain universal separators
70 for key in self.__project.getFileCategories() + ["TRANSLATIONEXCEPTIONS"]: 70 for key in self.__project.getFileCategories() + ["TRANSLATIONEXCEPTIONS"]:
71 ##for key in (
72 ##"SOURCES",
73 ##"FORMS",
74 ##"TRANSLATIONS",
75 ##"TRANSLATIONEXCEPTIONS",
76 ##"RESOURCES",
77 ##"INTERFACES",
78 ##"PROTOCOLS",
79 ##"OTHERS",
80 ##):
81 with contextlib.suppress(KeyError): 71 with contextlib.suppress(KeyError):
82 projectDict["project"][key] = sorted( 72 projectDict["project"][key] = sorted(
83 [ 73 [
84 FileSystemUtilities.fromNativeSeparators(f) 74 FileSystemUtilities.fromNativeSeparators(f)
85 for f in projectDict["project"][key] 75 for f in projectDict["project"][key]
100 90
101 try: 91 try:
102 jsonString = json.dumps(projectDict, indent=2, sort_keys=True) 92 jsonString = json.dumps(projectDict, indent=2, sort_keys=True)
103 with open(filename, "w", newline="") as f: 93 with open(filename, "w", newline="") as f:
104 f.write(jsonString) 94 f.write(jsonString)
105 except (TypeError, OSError) as err: 95 except (OSError, TypeError) as err:
106 with EricOverridenCursor(): 96 with EricOverridenCursor():
107 EricMessageBox.critical( 97 EricMessageBox.critical(
108 None, 98 None,
109 self.tr("Save Project File"), 99 self.tr("Save Project File"),
110 self.tr( 100 self.tr(

eric ide

mercurial