Python builtins.ascii() Examples

The following are 1 code examples of builtins.ascii(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module builtins , or try the search function .
Example #1
Source File: _utils.py    From pywbem with GNU Lesser General Public License v2.1 6 votes vote down vote up
def convert_field(self, value, conversion):
        """
        do any conversion on the resulting object
        """
        if conversion is None:  # pylint: disable=no-else-return
            return value
        elif conversion == 's':
            return str(value)
        elif conversion == 'r':
            return repr(value)
        elif conversion == 'a':
            return _ascii(value)
        elif conversion == 'A':
            return _ascii2(value)
        raise ValueError(
            "Unknown conversion specifier {0!s}".format(conversion))