1.7 MaskTools -- Simple HTML patterns.

This module is a simple module that contains a few commonly used HTML patterns. Its main purpose is to show you that it ease very easy to create your own masks and reuse them all over your website.

mask: x()
Returns the code for a transparent pixel. This is very useful when you want to draw 1-pixel wide lines.

The way it is used is the following:

# Draw a 1px by 100px blue line
<table border=0 cellspacing=0 cellpadding=0><tr><td width=100 height=1 bgColor=blue py-eval="maskTools.x()"></td></tr></table>

mask: displayByColumn(dataList, numberOfColumns=2, columnWidth=0, gapWidth=50, tdClass='')
This function displays a list of data on several columns.

dataList is a list of strings that you want to display

numberOfColumns is the number of columns that you want to use to display the data

columnWidth is used if you want to use a specific with for the columns (in pixels)

gapWidth is the number of pixels between each column

tdClass is the style sheet class to use to display the strings

Example:

# Display integers from 1 to 102 in 7 columns with 20 pixels between each column:
<py-eval="maskTools.displayByColumn(map(str,range(1,103)), 7, 0, 20)">

mask: displayByLine(dataList, numberOfLines=2, lineHeight=0, gapHeight=50)
This function displays a list of data on several lines.

dataList is a list of strings that you want to display

numberOfLines is the number of lines that you want to use to display the data

lineHeight is used if you want to use a specific height for the lines (in pixels)

gapHeight is the number of pixels between each line

tdClass is the style sheet class to use to display the strings

Example:

# Display integers from 1 to 102 in 7 lines with 5 pixels between each line:
<py-eval="maskTools.displayByLine(map(str,range(1,103)), 7, 0, 5)">

mask: textInBox(text, boxColor="black", insideColor="white")
This function displays a text in a box

text is the text to display inside the box

boxColor is the color of the border of the box

insideColor is the color of the background of the box

Example:

<py-eval="maskTools.textInBox('This is some text displayed in a red box filled with yellow', boxColor='red', insideColor='yellow')">

See About this document... for information on suggesting changes.