|
ATLAS Offline Software
|
|
def | sep (s) |
|
def | htmlDiv (id, contents='', attr='', keepEmptyDiv=True) |
|
def | htmlText (text, attr='', escapeText=False) |
|
def | htmlPre (text, attr='', escapeText=False) |
|
def | htmlPara (text='', attr='', escapeText=False) |
|
def | htmlLink (text, link, attr='', escapeText=False) |
|
def | htmlList (contents, attr='', listType='ul') |
|
def | htmlLI (text, attr='', escapeText=False) |
|
def | htmlFoldingSection (header, content, isClosed=True, headerClass='section-header', contentClass='section-content') |
|
def | htmlForm (contents, action='', method='post', attr='') |
|
def | htmlLabel (labelText, parName, attr='') |
|
def | htmlSelect (labelText, parName, args, choiceList, hint=None, descriptionSeparator='::', labelAttr='', attr='') |
|
def | htmlCheckbox (labelText, parName, args, labelAttr='', attr='') |
|
def | htmlTextInput (labelText, parName, args, size=None, maxLength=None, labelAttr='', attr='') |
|
def | htmlSubmit (text, parName, attr='', onlyOnce=False) |
|
◆ htmlCheckbox()
def WebPage.htmlCheckbox |
( |
|
labelText, |
|
|
|
parName, |
|
|
|
args, |
|
|
|
labelAttr = '' , |
|
|
|
attr = '' |
|
) |
| |
Make a checkbox (including label with text).
Definition at line 206 of file WebPage.py.
206 def htmlCheckbox(labelText, parName, args, labelAttr='', attr=''):
207 """Make a checkbox (including label with text)."""
208 snippet =
htmlLabel(labelText,parName,labelAttr)
209 checked =
'checked="checked"' if parName
in args
else ''
210 snippet +=
'<input type="checkbox" name="%s"%s%s/>\n' % (parName,
sep(checked),
sep(attr))
◆ htmlDiv()
def WebPage.htmlDiv |
( |
|
id, |
|
|
|
contents = '' , |
|
|
|
attr = '' , |
|
|
|
keepEmptyDiv = True |
|
) |
| |
Make a named div element containing contents. If
contents is empty, an empty string is returned,
unless keepEmtpyDiv is set True.
Definition at line 46 of file WebPage.py.
46 def htmlDiv(id, contents='', attr='', keepEmptyDiv=True):
47 """Make a named div element containing contents. If
48 contents is empty, an empty string is returned,
49 unless keepEmtpyDiv is set True."""
50 if contents
or keepEmptyDiv:
52 return '<div id="%s"%s>\n%s</div>\n' % (id,
sep(attr),contents)
54 return '<div%s>\n%s</div>\n' % (
sep(attr),contents)
◆ htmlFoldingSection()
def WebPage.htmlFoldingSection |
( |
|
header, |
|
|
|
content, |
|
|
|
isClosed = True , |
|
|
|
headerClass = 'section-header' , |
|
|
|
contentClass = 'section-content' |
|
) |
| |
Generate the html for a folding section using the toggleSection JavaScript utility
from WebPageUtils.js and CSS classes section-closed, section-open, and hidden.
Definition at line 154 of file WebPage.py.
155 headerClass='section-header',
156 contentClass='section-content'):
157 """Generate the html for a folding section using the toggleSection JavaScript utility
158 from WebPageUtils.js and CSS classes section-closed, section-open, and hidden."""
160 s =
'<div class="section-closed" onclick="toggleSection(this);">'
162 s =
'<div class="section-open" onclick="toggleSection(this);">'
163 s +=
'<span class="%s">%s</span></div>\n' % (headerClass,header)
164 h =
' hidden' if isClosed
else ''
165 s +=
'<div class="%s%s">\n%s</div>\n' % (contentClass,h,content)
◆ htmlForm()
def WebPage.htmlForm |
( |
|
contents, |
|
|
|
action = '' , |
|
|
|
method = 'post' , |
|
|
|
attr = '' |
|
) |
| |
Definition at line 168 of file WebPage.py.
168 def htmlForm(contents, action='', method='post', attr=''):
169 snippet =
'<form action="%s" method="%s"%s>\n' % (action,method,
sep(attr))
170 snippet +=
'<fieldset>\n'
172 snippet +=
'</fieldset>\n</form>\n'
◆ htmlLabel()
def WebPage.htmlLabel |
( |
|
labelText, |
|
|
|
parName, |
|
|
|
attr = '' |
|
) |
| |
Make a label for parName. If labelText is None,
an empty string is returned.
Definition at line 175 of file WebPage.py.
175 def htmlLabel(labelText, parName, attr=''):
176 """Make a label for parName. If labelText is None,
177 an empty string is returned."""
179 return '<label for="%s"%s>%s</label>' % (parName,
sep(attr),labelText)
◆ htmlLI()
def WebPage.htmlLI |
( |
|
text, |
|
|
|
attr = '' , |
|
|
|
escapeText = False |
|
) |
| |
Make a list item. Special HTML characters
in the text are properly replaced (using escape from cgi) if
escapeText is set True.
Definition at line 85 of file WebPage.py.
85 def htmlLI(text, attr='', escapeText=False):
86 """Make a list item. Special HTML characters
87 in the text are properly replaced (using escape from cgi) if
88 escapeText is set True."""
89 return '<li%s>%s</li>\n' % (
sep(attr), escape(text)
if escapeText
else text)
◆ htmlLink()
def WebPage.htmlLink |
( |
|
text, |
|
|
|
link, |
|
|
|
attr = '' , |
|
|
|
escapeText = False |
|
) |
| |
Definition at line 77 of file WebPage.py.
77 def htmlLink(text, link, attr='', escapeText=False):
78 return '<a href="%s"%s>%s</a>' % (link,
sep(attr),escape(text)
if escapeText
else text)
◆ htmlList()
def WebPage.htmlList |
( |
|
contents, |
|
|
|
attr = '' , |
|
|
|
listType = 'ul' |
|
) |
| |
Enclose list contents (a string with one or more list items) with
the proper list tag. The type of the list is given by listType.
Definition at line 80 of file WebPage.py.
80 def htmlList(contents, attr='', listType='ul'):
81 """Enclose list contents (a string with one or more list items) with
82 the proper list tag. The type of the list is given by listType."""
83 return '<%s%s>\n%s</%s>\n' % (listType,
sep(attr),contents,listType)
◆ htmlPara()
def WebPage.htmlPara |
( |
|
text = '' , |
|
|
|
attr = '' , |
|
|
|
escapeText = False |
|
) |
| |
Make a paragraph.
Definition at line 70 of file WebPage.py.
70 def htmlPara(text='', attr='', escapeText=False):
71 """Make a paragraph."""
73 return '<p%s>%s</p>\n' % (
sep(attr), escape(text)
if escapeText
else text)
◆ htmlPre()
def WebPage.htmlPre |
( |
|
text, |
|
|
|
attr = '' , |
|
|
|
escapeText = False |
|
) |
| |
Make a preformatted text section. Special HTML characters
in the text are properly replaced (using escape from cgi) if
escapeText is set True.
Definition at line 64 of file WebPage.py.
64 def htmlPre(text, attr='', escapeText=False):
65 """Make a preformatted text section. Special HTML characters
66 in the text are properly replaced (using escape from cgi) if
67 escapeText is set True."""
68 return '<pre%s>\n%s\n</pre>\n' % (
sep(attr),escape(text)
if escapeText
else text)
◆ htmlSelect()
def WebPage.htmlSelect |
( |
|
labelText, |
|
|
|
parName, |
|
|
|
args, |
|
|
|
choiceList, |
|
|
|
hint = None , |
|
|
|
descriptionSeparator = '::' , |
|
|
|
labelAttr = '' , |
|
|
|
attr = '' |
|
) |
| |
Make a select statement (including label with text).
Definition at line 183 of file WebPage.py.
183 def htmlSelect(labelText, parName, args, choiceList, hint=None, descriptionSeparator='::
', labelAttr='', attr=
''):
184 """Make a select statement (including label with text)."""
185 snippet =
htmlLabel(labelText,parName,labelAttr)
186 default = args[parName]
if parName
in args
else ''
187 if not isinstance(default,list):
189 snippet +=
'<select name="%s"%s>\n' % (parName,
sep(attr))
191 snippet +=
'<option value="">%s</option>\n' % hint
193 p = c.split(descriptionSeparator)
199 snippet +=
'<option selected="yes" value="%s">%s</option>\n' % (val,desc)
201 snippet +=
'<option value="%s">%s</option>\n' % (val,desc)
202 snippet +=
'</select>\n'
◆ htmlSubmit()
def WebPage.htmlSubmit |
( |
|
text, |
|
|
|
parName, |
|
|
|
attr = '' , |
|
|
|
onlyOnce = False |
|
) |
| |
Make a submit button. If onlyOnce is true, the button can only
be clicked once in order to prevent multiple clicking of the
submit button.
Definition at line 227 of file WebPage.py.
227 def htmlSubmit(text, parName, attr='', onlyOnce=False):
228 """Make a submit button. If onlyOnce is true, the button can only
229 be clicked once in order to prevent multiple clicking of the
233 s =
'<input type="button" name="%s" value="%s"' % (parName,text)
234 s +=
' onclick="this.form.submit()"'
235 s +=
'%s />\n' %
sep(attr)
238 return '<input type="submit" name="%s" value="%s"%s />\n' % (parName,text,
sep(attr))
◆ htmlText()
def WebPage.htmlText |
( |
|
text, |
|
|
|
attr = '' , |
|
|
|
escapeText = False |
|
) |
| |
Make a text consisting of an unnamed div. Special HTML characters
in the text are properly replaced (using escape from cgi) if
escapeText is set True.
Definition at line 58 of file WebPage.py.
58 def htmlText(text, attr='', escapeText=False):
59 """Make a text consisting of an unnamed div. Special HTML characters
60 in the text are properly replaced (using escape from cgi) if
61 escapeText is set True."""
62 return '<div%s>%s</div>\n' % (
sep(attr),escape(text)
if escapeText
else text)
◆ htmlTextInput()
def WebPage.htmlTextInput |
( |
|
labelText, |
|
|
|
parName, |
|
|
|
args, |
|
|
|
size = None , |
|
|
|
maxLength = None , |
|
|
|
labelAttr = '' , |
|
|
|
attr = '' |
|
) |
| |
Make a text input area (including label with text). Special HTML
characters in any default text are properly replaced.
Definition at line 213 of file WebPage.py.
213 def htmlTextInput(labelText, parName, args, size=None, maxLength = None, labelAttr='', attr=''):
214 """Make a text input area (including label with text). Special HTML
215 characters in any default text are properly replaced."""
216 snippet =
htmlLabel(labelText,parName,labelAttr)
217 snippet +=
'<input type="text" name="%s"' % parName
219 snippet +=
' value="%s"' % escape(args[parName],
True)
221 snippet +=
' size="%s"' % size
223 snippet +=
' maxlength="%s"' % maxLength
224 snippet +=
'%s/>\n' %
sep(attr)
◆ sep()
Add separator to string s unless s is empty.
Definition at line 42 of file WebPage.py.
43 """Add separator to string s unless s is empty."""
44 return ' '+s
if s
else s
◆ __author__
string WebPage.__author__ = 'Juerg Beringer' |
|
private |
◆ __version__
string WebPage.__version__ = 'WebPage.py atlas/athena' |
|
private |
◆ endPage
◆ startPage
Initial value:
2 %(contentType)s<?xml version="1.0" encoding="UTF-8"?>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7 <title>%(pageTitle)s</title>
8 <link href="%(cssName)s" rel="stylesheet" type="text/css" />
9 %(pageHeaderSnippets)s\
Definition at line 20 of file WebPage.py.
def htmlLink(text, link, attr='', escapeText=False)
def htmlForm(contents, action='', method='post', attr='')
def htmlPara(text='', attr='', escapeText=False)
def htmlTextInput(labelText, parName, args, size=None, maxLength=None, labelAttr='', attr='')
def htmlCheckbox(labelText, parName, args, labelAttr='', attr='')
def htmlDiv(id, contents='', attr='', keepEmptyDiv=True)
def htmlList(contents, attr='', listType='ul')
def htmlLI(text, attr='', escapeText=False)
def htmlText(text, attr='', escapeText=False)
def htmlSelect(labelText, parName, args, choiceList, hint=None, descriptionSeparator='::', labelAttr='', attr='')
def htmlLabel(labelText, parName, attr='')
def htmlFoldingSection(header, content, isClosed=True, headerClass='section-header', contentClass='section-content')
def htmlPre(text, attr='', escapeText=False)
def htmlSubmit(text, parName, attr='', onlyOnce=False)