Package eggbasket :: Module util
[hide private]

Module util

source code

Functions [hide private]
 
_make_link(s)
Turn HTTP URLs and emails adresses into HTML link elements.
source code
 
_rewrite_url(urlfield, info)
Set value for info[urlfield] to URL of package info['Name'].
source code
 
_xform_fieldname(s)
Return s with dashes repleced with spaces and ever word capitalized.
source code
 
get_base_url()
Return base URL of application.
source code
 
has_extension(filename, extensions=[], case_sensitive=False)
Return True if filename has one of the given extensions, False otherwise.
source code
 
is_package_dir(path)
Returns True if path is a directory containing at least one package file.
source code
 
is_package_file(filename)
Return True if filename ends in one of the known package file extension.
source code
 
munge_pkg_info(pkg_info)
Rewrite package info data for display on meta data view page.
source code
 
txt2html(text, use_docutils=True)
Try to convert text into HTML with docutils.
source code
Variables [hide private]
  _email_rx = re.compile(r'([-\w\.\+]+@[\w\.]+?\.\w+)')
Function Details [hide private]

get_base_url()

source code 

Return base URL of application.

Tries to account for 'Host' header and reverse proxing.

munge_pkg_info(pkg_info)

source code 

Rewrite package info data for display on meta data view page.

Turns URLs into links and optionall rewrites hoemapge/download URLs.

txt2html(text, use_docutils=True)

source code 

Try to convert text into HTML with docutils.

If conversion fails using docutils is is turned off by the configuration, return text unaltered.