def configuration(self): cd = CompositeNode.configuration(self) get_attribute(self, 'node_url', cd) if not self.is_remote(): for attr in PTYPE_MAP.get(self.parent.ptype)().supported_attrs(): get_attribute(self, attr, cd) return cd
def as_property(self): if self.__as_property is None: prop_map = {} prop_class = PTYPE_MAP.get(self.parent.ptype) for attr in prop_class().supported_attrs(): prop_map[attr] = getattr(self, attr) prop_map['reference'] = self.as_node_url() self.__as_property = prop_class(**prop_map) return self.__as_property
def configure(self, cd): Property.configure(self, cd) if self.is_remote(): return for attr in PTYPE_MAP.get(self.parent.ptype)().supported_attrs(): value = '' if attr in bacnet_attrs: try: value = self._get_bacnet_attr(attr) except: pass set_attribute(self, attr, value, cd)
def configure(self, cd): CompositeNode.configure(self, cd) if self.is_remote(): cd['node_url'] = self.as_remote_url() self.set_remote_url(cd['node_url']) if not cd.has_key('type'): cd['type'] = self.parent.ptype for attr in PTYPE_MAP.get(self.parent.ptype)().supported_attrs(): set_attribute(self, attr, '', cd) if self.node_url: cd['node_url'] = self.node_url #auto-discover if "meta" in cd: self.configure_meta(cd["meta"]) set_attribute(self, 'node_url', REQUIRED, cd) self._configured = True
def configuration(self): cd = Property.configuration(self) if not self.is_remote(): for attr in PTYPE_MAP.get(self.parent.ptype)().supported_attrs(): get_attribute(self, attr, cd) return cd