Skip to content
Snippets Groups Projects
ArchiveExtractor.py 33.7 KiB
Newer Older
        Case insensitive.

        Parameters:
        -----------
        pattern: str
            Pattern to search, wildchar * accepted.
            example "dg*dcct*current"

        Returns:
        --------
        results: (str,)
            List of string match
        """
        keywords=pattern.lower().split('*')

        matches = [attr for attr in self.attr_table if all(k in attr.lower() for k in keywords)]

        return matches


    def infoattr(self, attribute):
        """
        Get informations for an attribute and pack it into a python dict.

        Parameters
        ----------
        attribute : String
            Name of the attribute. Full Tango name i.e. "test/dg/panda/current".

        Returns
        -------
        info : dict
            Dictionnary of propertyname:propertyvalue
        """
        info = dict()

        for func in ("GetAttDefinitionData", "GetAttPropertiesData"):
            R=getattr(self.extractor, func)(attribute)
            if not R is None:
                for i in R:
                    _s=i.split("::")
                    info[_s[0]]=_s[1]
            else:
                self.logger.warning("Function %s on extractor returned None"%func)


        return info