1.13 web.util -- Useful utility functions that don't fit elsewhere
This module provides a number of functions which come in handy when programming web applications but that don't fit in elsewhere. It is a catch all module for useful leftovers.
A word-wrap function that preserves existing line breaks and most spaces in the text. Expects that existing line breaks are posix newlines. (ie backslash n)
- The text to wrap
- The maximum number of characters in a line
Strip illegal HTML tags from string
- The HTML which needs some tags stripping
- A list or tuple of tags to leave in place
||[root='../', cgi='/cgi-bin', ])|
Run a simple webserver on port 8080 on localhost. The root of the website corresponds to the directory root. cgi is URL of the the cgi-bin where files can be executed. Once this command is run code execution stops as the webserver listens for requests so there is no point in writing code after this command as it will not be run.
NOT SUITABLE FOR COMMERCIAL USE.
- The only directory where scripts are allowed to run. Directory names should be the full URL path from the root of the webserver and therefore should begin with