Package pylal :: Package dq :: Module dqHTMLUtils
[hide private]
[frames] | no frames]

Module dqHTMLUtils

source code


Author: Duncan Macleod <duncan.macleod@astro.cf.ac.uk>

Functions [hide private]
 
write_table(page, headers, data, cl='')
Write table into glue.markup.page object.
source code
 
write_head(title, css, js, base=None, refresh=None, jquery=True)
Returns glue.markup.page object with <head> tag filled.
source code
 
write_banner(title, text="")
Returns glue.markup.page object for <div id="header">
source code
 
write_menu(sections, pages, current=None)
Returns glue.markup.page object for <div id="menubar">, constructing menu in HTML.
source code
 
init_page(head, banner, menu, **kwargs)
Initialise html into markup page, including <head> tag, banner and menu.
source code
 
close_page(page, footer=False)
Close content, maintab, and container divs, write footer and close <body> and <html> tags.
source code
 
write_glossary(page, terms)
Write a glossary of DQ terms into the glue.markup.page object page using the list of (term,definition) tuples terms.
source code
 
write_h(page, title, id, cl=3, toggle=True)
Write hX header into glue.markup.page object page with toggling.
source code
 
link_image(page, href, src, alt, title, **kwargs)
Link image into glue.markup.page object page with standard options
source code
 
link_file(page, href, text)
Link file into glue.markup.page object page, with associated text and options.
source code
 
get_ldas_url()
Returns the url for http access to this host, based on its domain name Returns None-type if you're not on a recognised LIGO-Virgo cluster.
source code
Variables [hide private]
  __date__ = git_version.date
This module provides a few extensions to glue.markup to streamline GEO/LIGO detector characterisation tools that use very similar web interfaces
Function Details [hide private]

write_table(page, headers, data, cl='')

source code 

Write table into glue.markup.page object. headers are written with <th>,
multiple columns of data are written with <td>. Classes include:
  * "", default class writes standard table with single column of headers
        and multiple columns of data
  * "list", writes table of 'header[i]: data[i]' definition-style entries

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:

  cl : string
    name for HTML table class, cl='list' treats special case above

write_head(title, css, js, base=None, refresh=None, jquery=True)

source code 

Returns glue.markup.page object with <head> tag filled.

Arguments:

  title : string
    text for <title> tag
  css : string
    relative path to style sheet
  js : string
    relative path to javascript

Keyword arguments:

  base : string
    absolute http(s) path of url base
  refresh : int
    number of seconds after which to refresh page automatically
  jquery : [ True | False ]
    import jquery AJAX script in header, default: True

write_menu(sections, pages, current=None)

source code 

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

init_page(head, banner, menu, **kwargs)

source code 

Initialise html into markup page, including <head> tag, banner and menu. Pass further html elements to the body tag using the kwargs.

write_h(page, title, id, cl=3, toggle=True)

source code 

Write hX header into glue.markup.page object page with toggling. Text contained within title is printed while link is constructed and toggled using javascipt toggleVisible function

get_ldas_url()

source code 

Returns the url for http access to this host, based on its domain name Returns None-type if you're not on a recognised LIGO-Virgo cluster. Should not be used when not on an LDAS cluster, can't tell the difference between nodes on CDS network at a site, and those on LDAS, for example...

Example: >>> socket.getfqdn() ldas-pcdev1.ligo-la.caltech.edu >>> dqHTMLUtils.get_ldas_url() 'https://ldas-jobs.ligo-la.caltech.edu'