wsgikit.PrettyDict

class wsgikit.PrettyDict

Simple formatter to get Python dicts printed in human-readable format

Usage example:

import wsgikit

def my_wsgi_app( environ, start_response):
        status = '200 OK'
        response_headers = [('Content-type','text/plain')]
        start_response( status, response_headers)
        
        request = wsgikit.HttpRequest( environ)
        
        return wsgikit.PrettyDict.format( request.to_dict())
classmethod format(this, d, tab=4, indent=0)

Performs dict formatting to human-readable string

Parameters:
  • d – dictionary to format
  • tab – tab identation length
  • indent – initial identation to use for formatting
Return type:

str

Previous topic

wsgikit.FileUploader

Next topic

WSGIkit Errors

This Page