twisted.internet.endpoints.quoteStringArgument - python examples

Here are the examples of the python api twisted.internet.endpoints.quoteStringArgument taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : _parser.py
Copyright MIT License
Author : wistbean
def unparseEndpoint(args, kwargs):
    """
    Un-parse the already-parsed args and kwargs back into endpoint syntax.

    @param args: C{:}-separated arguments
    @type args: L{tuple} of native L{str}

    @param kwargs: C{:} and then C{=}-separated keyword arguments

    @type arguments: L{tuple} of native L{str}

    @return: a string equivalent to the original format which this was parsed
        as.
    @rtype: native L{str}
    """

    description = ':'.join(
        [quoteStringArgument(str(arg)) for arg in args] +
        sorted(['%s=%s' % (quoteStringArgument(str(key)),
                    quoteStringArgument(str(value)))
         for key, value in iteritems(kwargs)
        ]))
    return description