MCPcopy Create free account
hub / github.com/nodejs/node / _PrintObjects

Method _PrintObjects

tools/gyp/pylib/gyp/xcodeproj_file.py:3155–3180  ·  view source on GitHub ↗
(self, file)

Source from the content-addressed store, hash-verified

3153 del self._properties["objects"]
3154
3155 def _PrintObjects(self, file):
3156 if self._should_print_single_line:
3157 self._XCPrint(file, 0, "objects = {")
3158 else:
3159 self._XCPrint(file, 1, "objects = {\n")
3160
3161 objects_by_class = {}
3162 for object in self.Descendants():
3163 if object == self:
3164 continue
3165 class_name = object.__class__.__name__
3166 if class_name not in objects_by_class:
3167 objects_by_class[class_name] = []
3168 objects_by_class[class_name].append(object)
3169
3170 for class_name in sorted(objects_by_class):
3171 self._XCPrint(file, 0, "\n")
3172 self._XCPrint(file, 0, "/* Begin " + class_name + " section */\n")
3173 for object in sorted(objects_by_class[class_name], key=attrgetter("id")):
3174 object.Print(file)
3175 self._XCPrint(file, 0, "/* End " + class_name + " section */\n")
3176
3177 if self._should_print_single_line:
3178 self._XCPrint(file, 0, "}; ")
3179 else:
3180 self._XCPrint(file, 1, "};\n")

Callers 1

PrintMethod · 0.95

Calls 6

sortedFunction · 0.85
_XCPrintMethod · 0.80
DescendantsMethod · 0.80
attrgetterFunction · 0.50
appendMethod · 0.45
PrintMethod · 0.45

Tested by

no test coverage detected