Package Halberd :: Module util
[show private | hide private]
[frames | no frames]

Module Halberd.util

Miscellaneous functions.
Function Summary
tuple addresses(host)
Get the network addresses to which a given host resolves to.
str hostname(url)
Get the hostname part of an URL.
  utctime()
  _gen_table()
Generate translation table.

Variable Summary
str table: Translation table for normalizing strings.

Function Details

addresses(host)

Get the network addresses to which a given host resolves to.
Parameters:
host - Hostname we want to resolve.
           (type=str)
Returns:
Network addresses.
           (type=tuple)

hostname(url)

Get the hostname part of an URL.
Parameters:
url - A valid URL (must be preceded by scheme://).
           (type=str)
Returns:
Hostname corresponding to the URL or the empty string in case of failure.
           (type=str)

_gen_table()

Generate translation table.

Variable Details

table

Translation table for normalizing strings.
Type:
str
Value:
'________________________________________________0123456789_______ABCD\
EFGHIJKLMNOPQRSTUVWXYZ______abcdefghijklmnopqrstuvwxyz________________\
______________________________________________________________________\
_______________________________________________'                       

Generated by Epydoc 2.1 on Thu Aug 17 12:42:14 2006 http://epydoc.sf.net