Back to index

plone3  3.1.7
Functions | Variables
MimetypesRegistry.tests.utils Namespace Reference

Functions

def normalize_html
def input_file_path
def output_file_path
def matching_inputs
def load

Variables

tuple PREFIX = abspath(dirname(__file__))

Function Documentation

Definition at line 16 of file utils.py.

00016 
00017 def input_file_path(file):
00018     return join(PREFIX, 'input', file)

def MimetypesRegistry.tests.utils.load (   dotted_name,
  globals = None 
)
load a python module from it's name 

Definition at line 25 of file utils.py.

00025 
00026 def load(dotted_name, globals=None):
00027     """ load a python module from it's name """
00028     mod = __import__(dotted_name, globals)
00029     components = dotted_name.split('.')
00030     for comp in components[1:]:
00031         mod = getattr(mod, comp)
00032     return mod

Here is the caller graph for this function:

Definition at line 22 of file utils.py.

00022 
00023 def matching_inputs(pattern):
00024     return [basename(path) for path in glob.glob(join(PREFIX, "input", pattern))]

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 7 of file utils.py.

00007 
00008 def normalize_html(s):
00009     s = re.sub(r"\s+", " ", s)
00010     s = re.sub(r"(?s)\s+<", "<", s)
00011     s = re.sub(r"(?s)>\s+", ">", s)
00012     s = re.sub(r"\r", "", s)
00013     return s

Definition at line 19 of file utils.py.

00019 
00020 def output_file_path(file):
00021     return join(PREFIX, 'output', file)


Variable Documentation

tuple MimetypesRegistry.tests.utils.PREFIX = abspath(dirname(__file__))

Definition at line 14 of file utils.py.