common.services.calts package

Submodules

common.services.calts.CalibrationGraph module

Module with HTML Graph generators for the CalTS Graph View

class common.services.calts.CalibrationGraph.CalibrationGraph(parent, data)

Bases: object

Base class for generating Calibration Graphs, to be used in a html page

bar_height = 15
bar_width = 0
generate()

generate the Graph

graph_table_class = 'GraphTable'
classmethod initBar(background='', div_html='', height=15, left=-1, margin='1px 1px 1px 1px', other_args='', other_style='', width=0, zindex=0)

return initialized bar

classmethod initData(cal_type='', elements=None, heading=('', '', ''), dbview_url='', total_count=0)

initialize a data dict

classmethod initElement(text_left='', text_right='', bars=None)

return initialized element for the data

class common.services.calts.CalibrationGraph.CalibrationGraphDateObs(parent, data)

Bases: common.services.calts.CalibrationGraph.CalibrationGraph

class for generating DATE-OBS Calibration Graphs

bar_height = 15
generateBar(bar)

generate the bars part of the Graph

generateLegend(cal_type)

return the legend of the graph

classmethod initBar(**kwargs)

use the class variables for the initBar method

class common.services.calts.CalibrationGraph.CalibrationGraphTimestamps(parent, data)

Bases: common.services.calts.CalibrationGraph.CalibrationGraph

class for generating Timestamp Calibration Graphs

generateBar(bar)

generate the bars part of the Graph

generateLegend(cal_type)

return the legend of the graph

classmethod initBar(**kwargs)

use the class variables for the initBar method

class common.services.calts.CalibrationGraph.CalibrationGraphValidate(parent, data)

Bases: common.services.calts.CalibrationGraph.CalibrationGraph

class for generating Validate Calibration Graphs

bar_width = 13
generateBar(bar)

generate the bars part of the Graph

generateLegend(cal_type)

return the legend of the graph

classmethod initBar(**kwargs)

use the class variables for the initBar method

common.services.calts.HtmlCalibration module

File HtmlCalibration.py Author WJ Vriend (wjvriend[AT]astro.rug.nl)

CalTS base class definitions

exception common.services.calts.HtmlCalibration.CalibrationError

Bases: Exception

common.services.calts.HtmlCalibrationEdit module

File HtmlCalibrationEdit.py Author WJ Vriend (wjvriend[AT]astro.rug.nl)

exception common.services.calts.HtmlCalibrationEdit.CalibrationEditError

Bases: common.services.calts.HtmlCalibration.CalibrationError

class common.services.calts.HtmlCalibrationEdit.HtmlCalibrationEdit(args, parent=None)

Bases: common.services.general.HtmlBase.HtmlBase

This class generates html page for editing the timestamps and (un)setting the valid flag.

template file - CalibrationEdit.html.tmpl

CLOSEWIN = '<html><body onload="window.close();"></body></html>'
CLOSEWIN_REFRESH = '<html><body onload="window.opener.document.frmSelection.submit();window.close();"></body></html>'
ERROR_TEXT = 'An error has occured'
HTML_ERROR = '<html><body><h3>%s</h3><p>%%s</p></body></html>'
UPDATE_LOG = 'calts_sql_update.log'
URL_NAME = 'CalList'
check_date(a_date)

check if the given date is valid

check_dates(date_start, date_end)

check if the start date is before the end date

creation_date_1990 = datetime.datetime(1990, 1, 1, 0, 0)
getDateObs(obj)

determine date obs to display

getHtml()

generate HTML, for selecting or updating

getIsValidSelectOptions()

Return the options for the is_valid select box Return two lists; what to show and the values

getMainTableCheckbox(obj, checked)

Return the checkbox definition in the table row

getMainTableCheckboxHeader(main_table_all_checked)

Return the checkbox definition in the table header

getMainTableContents()

return the contents for the main table(s)

getMainTableHeaders(objects, main_table_all_checked)

Return the headers of the main table

getMessages()

Return the messages to show

getObjectAttributes(obj)

return the attributes name and values of the object to show in the overview table return as [(‘name1’, ‘value1’), (‘name2’, ‘value2’), ..]

classmethod get_url(class_str, object_id, server=None, project=None, privileges=None, full_url=True, hide_flagged=True)

return an url for the given class_str and object_id

classmethod is_retrievable(obj)

has this object a retrievable file associated

mainTableAllChecked(objects)

Should all entries in the main table be checked

max_comment_length = 20
max_length_elem = 40
oradate_format_long = "'DD-MM-YYYY HH24:MI:SS'"
oradate_format_short = "'DD-MM-YYYY'"
python_format_long = '%d-%m-%Y %T'
python_format_short = '%d-%m-%Y'
renderMainTable()

render the main Table

renderMainTableRow(obj, main_table_all_checked)

return the contents for the main table(s)

selectCalEdit()

retrieve calibration data from the database

classmethod supportsClass(class_string)

Does HtmlCalibrationEdit support the given class ?

updateCalEdit()

update calibration timestamps and is_valid to the DB

updatePrivileges()

update the privileges of the selected objects

use_in_template = False

common.services.calts.HtmlCalibrationGraph module

common.services.calts.HtmlCalibrationQuality module

common.services.calts.HtmlCalibrationTable module

File HtmlCalibrationTable.py Author WJ Vriend (wjvriend[AT]astro.rug.nl) Date Dec 2004

exception common.services.calts.HtmlCalibrationTable.CalibrationTableError

Bases: common.services.calts.HtmlCalibration.CalibrationError

class common.services.calts.HtmlCalibrationTable.HtmlCalibrationTable(args, parent=None)

Bases: common.services.general.HtmlBase.HtmlBase

This class generates the tabular data for calts in html format.

template file - CalibrationTable.html.tmpl

ERROR_HTML = '<html><body><h3>%s</h3><p>%%s</p></body></html>'
ERROR_TEXT = 'Error encountered:'
MAX_ROWS = 2000
date_format_long = "'DD-MM-YYYY HH24:MI:SS'"
date_format_long_disp = '%d %b %Y %T'
date_format_short_disp = '%d %b %Y'
extraTablePreHeaders()

return extra (pre) headers for the html table, that are headers after the comments column but before the regular headers

extraTablePreValues(row, count)

return extra elements for the table row

formatRowValue(col_name, col_value)

format the row value with given column name

getHtml()

generate html

getTableHeaders()

return the columns or headers for this table

getTableRows()

return all the rows to render in the html table, some columns are mandatory: (1) object_id, when using checkboxes and link to Edit form (2) filename, for link to Edit form (3) nr of comments

index_filename = 1
index_nr_comments = -1
index_object_id = 0
makeTableHeader()

make html table header

makeTableRow(row, count)

make a html table table row from the db row

make_all()

loop through all input args, those with name elem_<object_id> make valid/invalid as specified in make_what

show_comments = True
use_in_template = True

common.services.calts.HtmlComment module

File HtmlCComment.py Author WJ Vriend (wjvriend[AT]astro.rug.nl) Date Apr 2005

class common.services.calts.HtmlComment.HtmlComment(args, parent=None)

Bases: common.services.general.HtmlBase.HtmlBase

This class generates the html page for viewing and adding comments.

template file - Comment.html.tmpl

CLOSEWIN = '<html><body onload="window.close();"></body></html>'
DBERROR_OBJ = '<html><body>ERROR in HtmlComment when selecting object, exception: %s</body></html>'
ERROR_CRERATING_COMMENT = '<html><body>ERROR in HtmlComment creating Comment; %s</body></html>'
ERROR_STR = 'ERROR in HtmlComment'
UNKNOWN = '<html><body>ERROR in HtmlComment; unknown operation</body></html>'
URL_NAME = 'CalList'
addComment()

get date and time from input and store comment

date_format_python = '%d-%m-%Y %H:%M:%S'
getHtml()

generate html

classmethod get_url(class_str, object_id, server=None, project=None, privileges=None, full_url=True)

return an url for the given class_str and object_id

showComments()
classmethod storeComment(caltype, object_id, content, user='', date=None)

store comment in the database

use_in_template = False

Module contents