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

Function MergeAttributes

tools/gyp/tools/pretty_vcproj.py:249–271  ·  view source on GitHub ↗
(node1, node2)

Source from the content-addressed store, hash-verified

247
248
249def MergeAttributes(node1, node2):
250 # No attributes to merge?
251 if not node2.attributes:
252 return
253
254 for name, value2 in node2.attributes.items():
255 # Don't merge the 'Name' attribute.
256 if name == "Name":
257 continue
258 value1 = node1.getAttribute(name)
259 if value1:
260 # The attribute exist in the main node. If it's equal, we leave it
261 # untouched, otherwise we concatenate it.
262 if value1 != value2:
263 node1.setAttribute(name, ";".join([value1, value2]))
264 else:
265 # The attribute does not exist in the main node. We append this one.
266 node1.setAttribute(name, value2)
267
268 # If the attribute was a property sheet attributes, we remove it, since
269 # they are useless.
270 if name == "InheritedPropertySheets":
271 node1.removeAttribute(name)
272
273
274def MergeProperties(node1, node2):

Callers 1

MergePropertiesFunction · 0.85

Calls 2

itemsMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected