Package buildxml :: Package tools :: Module functions
[hide private]
[frames] | no frames]

Module functions

source code

This module holds some utility functions.


Author: Johannes Schwenk

Copyright: 2010, Johannes Schwenk

Version: 1.0

Date: 2010-09-15

Functions [hide private]
int
du(start_path=u'.')
Computes the size of the files in the file system subtree starting at start_path .
source code
 
unescape(text)
Unescape HTML Entities # © October 28, 2006 | Fredrik Lundh
source code
 
parse_date(date)
Parses date strings of formats:
source code
Function Details [hide private]

du(start_path=u'.')

source code 

Computes the size of the files in the file system subtree starting at start_path .

Returns: int
The recursive size of start_path in bytes.

unescape(text)

source code 

Unescape HTML Entities # © October 28, 2006 | Fredrik Lundh

http://effbot.org/zone/re-sub.htm#unescape-html

Removes HTML or XML character references and entities from a text string.

Parameters:
  • text - The HTML (or XML) source text.
Returns:
The plain text, as a Unicode string, if necessary.

parse_date(date)

source code 

Parses date strings of formats:

Sun, 06 Nov 1994 08:49:37 GMT Sunday, 06-Nov-94 08:49:37 GMT Sun Nov 6 08:49:37 1994

Parameters:
  • date - Date as string.
Returns:
A datetime.datetime object or None if parsing failed.