示例#1
0
    def _attributes(self):
        """ Return all available attributes as dictionary.

            The dictionary includes all class and instance attributes.
            
        """
        return attributes(self)
示例#2
0
    def _attributes(self):

        """ Return all available attributes as dictionary.

            The dictionary includes all class and instance attributes.
            
        """
        return attributes(self)
示例#3
0
    def _format(self, template, recursive=0):
        """ Format the text template using the namespace contents.

            template must be a text using Python string placeholders,
            e.g. "%(attrname)s" or "%(attrname)r". Formatting is done
            using all available attributes of the namespace (including
            class attributes).

            If recursive is true, the formatting is applied recursively
            (as long as the string '%(' occurs in the template), i.e.
            the Namespace attributes may also contain Python string
            placeholders.
            
        """
        if not recursive:
            return template % attributes(self)
        dict = attributes(self)
        while template.find('%(') >= 0:
            template = template % dict
        return template
示例#4
0
    def _format(self, template, recursive=0):

        """ Format the text template using the namespace contents.

            template must be a text using Python string placeholders,
            e.g. "%(attrname)s" or "%(attrname)r". Formatting is done
            using all available attributes of the namespace (including
            class attributes).

            If recursive is true, the formatting is applied recursively
            (as long as the string '%(' occurs in the template), i.e.
            the Namespace attributes may also contain Python string
            placeholders.
            
        """
        if not recursive:
            return template % attributes(self)
        dict = attributes(self)
        while template.find('%(') >= 0:
            template = template % dict
        return template