def __initializeFromRaw(self):
        """Initialze from raw data (OrderedDict)"""

        for (key, value) in self.raw_data.items():
            if key.startswith("@"):
                # be compatible with IncludedInBuild
                if "@oslc_cm:label" != key:
                    continue

            attr = key.split(":")[-1].replace("-", "_")
            attr_list = attr.split(".")

            # ignore long attributes
            if len(attr_list) > 1:
                # attr = "_".join([attr_list[-2],
                #                  attr_list[-1]])
                continue

            self.field_alias[attr] = key

            if isinstance(value, OrderedDict):
                value_text = value.get("#text")
                if value_text is not None:
                    value = value_text
                else:
                    # request detailed info using rdf:resource
                    value = list(value.values())[0]

                    try:
                        value = self.__get_rdf_resource_title(value)
                    except (exception.RTCException, Exception):
                        self.log.error("Unable to handle %s", value)
            self.setattr(attr, value)
def __initializeFromRaw ( self ) : for ( key , value ) in self . raw_data . items ( ) : if key . startswith ( "@" ) : if "@oslc_cm:label" != key : continue attr = key . split ( ":" ) [ - 1 ] . replace ( "-" , "_" ) attr_list = attr . split ( "." ) if len ( attr_list ) > 1 : continue self . field_alias [ attr ] = key if isinstance ( value , OrderedDict ) : value_text = value . get ( "#text" ) if value_text is not None : value = value_text else : value = list ( value . values ( ) ) [ 0 ] try : value = self . __get_rdf_resource_title ( value ) except ( exception . RTCException , Exception ) : self . log . error ( "Unable to handle %s" , value ) self . setattr ( attr , value )
Initialze from raw data (OrderedDict)