| Home | Trees | Indices | Help |
|
|---|
|
|
Utilities for HTML generation on the LIGO Data Grid.
This module provides some useful functions for buildling HTML content on the LIGO Data Grid, and a few extensions to glue.markup to streamline GEO/LIGO tools that use very similar web interfaces.
Date: 2017-12-05 15:29:36 +0000
Author: Duncan M. Macleod <duncan.macleod@ligo.org>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Write table into glue.markup.page object. headers are written with <th>,
multiple columns of data are written with <td>.
Arguments:
page : glue.markup.page
page object into which to write table
headers : list
list of table header elements
data : list
list (or nested list) of table data elements, list of lists used for
multiple rows
Keyword arguments:
classdict : dict
dict containing tag:class pairs for table, td, th, and td HTML tags
"table":"list" prints table with headers and data side-by-side,
all others print all headers in one row, then all data in one row
(use list of lists for multiple rows).
|
Returns glue.markup.page object for <div id_="menubar">, constructing menu
in HTML.
Arguments:
sections : list
ordered list of menu entry names
pages : dict
dict of section:href pairs holding link paths for each element of
sections list
Keyword arguments:
current : str
element of sections list to identify with class="open"
classdict : dict
dict of tag:class pairs for setting HTML tags
|
Write a glossary of DQ terms into the glue.markup.page object page using the
list of (term,definition) tuples terms.
Arguments:
entries : dict
dict of term:definition pairs for inclusion in glossary
Keyword arguments:
htag : str
HTML tag to use for header, default <h1>
classdict : dict
dict of tag:class pairs for HTML class assignment
|
Find the web server for this host on the LIGO Data Grid. @returns the fully-qualified domain name of the web server associated with this host. Example: >>> socket.getfqdn() ldas-pcdev1.ligo-la.caltech.edu >>> htmlutils.get_web_server() "https://ldas-jobs.ligo-la.caltech.edu" |
Returns a glue.markup.page object with an h1 heading, descriptive text, some plots, and the arguments used to generate it.
Designed for embedding/including as a frame in a larger page.
Arguments:
header : str
text to write as header (<h1>)
htag : str
HTML tag to use for header, default <h1>
desc : str
descriptive text to print below header(s) (<p>)
plotlist : list
list of filepath strings or (path, title) tuples to include
(<a>,<img>)
args : [ str | list ]
string with arguments used to generate plots, or list of arguments
to be space-separated
version : str
code version str/number to include
classdict : dict
dict containing HTML class strings for each tag used
init : [ True | False ]
initialise the markup.page object, adds HTML and BODY tags
|
Build a complete HTML page from 6 components: icon banner homebutton tabs
menu frame. All other args passed to glue.markup.page.init function.
See docstring of that function for help.
Body is built to the following format:
<div id_="container">
<div class="content" id_="header">
<div>
<div class="nav">
ICON
</div>
<div class="frame">
BANNER
</div>
</div>
</div>
<div class="content" id_="tabs">
<div>
<div class="nav">
HOMEBUTTON
</div>
<div class="frame">
TABS
</div>
</div>
</div>
<div class="content" id_="main">
<div>
<div class="nav">
MENUBAR
</div>
<div class="frame">
FRAME
</div>
</div>
</div>
</div>
|
Returns a glue.markup.page object with an heading, descriptive text, summary section with one plot and text, section with other plots,
section with subplots, then section with info.
Designed for embedding/including as a frame in a larger page.
Keyword arguments:
header : str
text to write as header (<h1>)
htag : str
HTML tag to use for header, default <h1>
desc : str
descriptive text to print below header(s) (<p>)
plotlist : list
list of filepath strings or (path, title) tuples to include
(<a>,<img>)
text : [ str | glue.markup.page ]
text to print below summary plot (<p>), or glue.markup.page to
drop in with no enclosing tags.
subplotlist : list
list of filepath strings or (path, title) tuples to include
(<a>,<img>)
info : str
information to print below summary plot (<p>), or
glue.markup.page to drop in with no enclosing tags.
classdict : dict
dict containing HTML class strings for each tag used
init : [ True | False ]
initialise the markup.page object, adds HTML and BODY tags
|
Returns a glue.markup.page object formatting the given executable, commandline arguments, and any included files.
Arguments:
executable : string
path of executable file (sys.argv[0])
cmdargs : iterable
set of command line arguments (sys.argv[1:])
Keyword arguments:
filedict : [ dict | iterable ]
iterable of ("name", filepath) pairs to insert in full into the page
classdict : dict
dict containing HTML class strings for each tag used
init : [ True | False ]
initialise the markup.page object, adds HTML and BODY tags
|
Find the web readable directory for the user on thie host. @returns the absolute path of the "public_html" equivalent directory on this host. Example: >>> socket.getfqdn() ldas-pcdev1.ligo-la.caltech.edu >>> htmlutils.get_html_directory() "/home/duncan.macleod/public_html" |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Tue Dec 12 01:21:41 2017 | http://epydoc.sourceforge.net |