Python gi.repository.GObject 模块,property() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用gi.repository.GObject.property()

项目:oacids    作者:openaps    | 项目源码 | 文件源码
def Set(self, interface_name, property_name, new_value):
      # validate the property name and value, update internal state
      if interface_name == self.OWN_IFACE:
        # self.set_property(property_name, new_value)
        fields = self.item.fields
        if self.isExtra:
          fields = self.item.extra.fields
        old_value = fields.get(property_name, None)
        old = [ ]
        if old_value is not None and old_value != new_value:
          old = [ { property_name: old_value } ]
        fields[property_name] = new_value
        self.PropertiesChanged(interface_name,
            { property_name: new_value }, old)