Package openid :: Module oidutil
[frames | no frames]

Module openid.oidutil

This module contains general utility code that is used throughout the library.

For users of this library, the log function is probably the most interesting.
Function Summary
str appendArgs(url, args)
Append query arguments to a HTTP(s) URL.
  autoSubmitHTML(form, title)
  fromBase64(s)
  log(message, level)
Handle a log message from the OpenID library.
  toBase64(s)
Represent string s as base64, omitting newlines

Function Details

appendArgs(url, args)

Append query arguments to a HTTP(s) URL. If the URL already has query arguemtns, these arguments will be added, and the existing arguments will be preserved. Duplicate arguments will not be detected or collapsed (both will appear in the output).
Parameters:
url - The url to which the arguments will be appended
           (type=str)
args - The query arguments to add to the URL. If a dictionary is passed, the items will be sorted before appending them to the URL. If a sequence of pairs is passed, the order of the sequence will be preserved.
           (type=A dictionary from string to string, or a sequence of pairs of strings.)
Returns:
The URL with the parameters added
           (type=str)

log(message, level=0)

Handle a log message from the OpenID library.

This implementation writes the string it to sys.stderr, followed by a newline.

Currently, the library does not use the second parameter to this function, but that may change in the future.

To install your own logging hook:
 from openid import oidutil

 def myLoggingFunction(message, level):
     ...

 oidutil.log = myLoggingFunction
Parameters:
message - A string containing a debugging message from the OpenID library
           (type=str)
level - The severity of the log message. This parameter is currently unused, but in the future, the library may indicate more important information with a higher level value.
           (type=int or None)
Returns:
Nothing.

toBase64(s)

Represent string s as base64, omitting newlines

Generated by Epydoc 2.1 on Fri Jun 6 15:54:34 2008 http://epydoc.sf.net