本文整理汇总了Python中UM.Settings.InstanceContainer.InstanceContainer.setMetaData方法的典型用法代码示例。如果您正苦于以下问题:Python InstanceContainer.setMetaData方法的具体用法?Python InstanceContainer.setMetaData怎么用?Python InstanceContainer.setMetaData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UM.Settings.InstanceContainer.InstanceContainer
的用法示例。
在下文中一共展示了InstanceContainer.setMetaData方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _createFlattenedContainerInstance
# 需要导入模块: from UM.Settings.InstanceContainer import InstanceContainer [as 别名]
# 或者: from UM.Settings.InstanceContainer.InstanceContainer import setMetaData [as 别名]
def _createFlattenedContainerInstance(self, instance_container1, instance_container2):
flat_container = InstanceContainer(instance_container2.getName())
flat_container.setDefinition(instance_container2.getDefinition())
flat_container.setMetaData(instance_container2.getMetaData())
for key in instance_container2.getAllKeys():
flat_container.setProperty(key, "value", instance_container2.getProperty(key, "value"))
for key in instance_container1.getAllKeys():
flat_container.setProperty(key, "value", instance_container1.getProperty(key, "value"))
return flat_container
示例2: _createFlattenedContainerInstance
# 需要导入模块: from UM.Settings.InstanceContainer import InstanceContainer [as 别名]
# 或者: from UM.Settings.InstanceContainer.InstanceContainer import setMetaData [as 别名]
def _createFlattenedContainerInstance(self, instance_container1, instance_container2):
flat_container = InstanceContainer(instance_container2.getName())
# The metadata includes id, name and definition
flat_container.setMetaData(copy.deepcopy(instance_container2.getMetaData()))
if instance_container1.getDefinition():
flat_container.setDefinition(instance_container1.getDefinition().getId())
for key in instance_container2.getAllKeys():
flat_container.setProperty(key, "value", instance_container2.getProperty(key, "value"))
for key in instance_container1.getAllKeys():
flat_container.setProperty(key, "value", instance_container1.getProperty(key, "value"))
return flat_container