Logo Search packages:      
Sourcecode: matplotlib version File versions  Download package

def configobj::Section::encode (   self,
  encoding 
)

Encode all strings and values from unicode,
using the specified encoding.

Works with subsections and list values.
Uses the ``walk`` method.

Definition at line 910 of file configobj.py.

00910                               :
        """
        Encode all strings and values from unicode,
        using the specified encoding.
        
        Works with subsections and list values.
        Uses the ``walk`` method.
        """
        warn('use of ``encode`` is deprecated.', DeprecationWarning)
        def encode(section, key, encoding=encoding):
            """ """
            val = section[key]
            if isinstance(val, (list, tuple)):
                newval = []
                for entry in val:
                    newval.append(entry.encode(encoding))
            elif isinstance(val, dict):
                newval = val
            else:
                newval = val.encode(encoding)
            newkey = key.encode(encoding)
            section.rename(key, newkey)
            section[newkey] = newval
        self.walk(encode, call_on_sections=True)

    def istrue(self, key):


Generated by  Doxygen 1.6.0   Back to index