safe.impact_statistics.function_options_dialog module

InaSAFE Disaster risk assessment tool developed by AusAid - Impact Functions Dialog.

Contact : ole.moller.nielsen@gmail.com

Note

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

class safe.impact_statistics.function_options_dialog.FunctionOptionsDialog(parent=None)[source]

Bases: PyQt4.QtGui.QDialog, Ui_FunctionOptionsDialogBase

ConfigurableImpactFunctions Dialog for InaSAFE.

accept()[source]

Override the default accept function

Note

see http://tinyurl.com/pyqt-differences # Broken url

bind(widget, property_name, function)[source]

Return the widget.property converting the value using the function.

Parameters:
  • widget (QWidget) – QWidget instance
  • property_name (str) – The name of property inside QWidget instance
  • function (Callable) – A function to convert the property value
Returns:

The property value of widget

build_form(parameters)[source]

Build a form from impact functions parameter.

Parameters:parameters – Parameters to be edited
build_minimum_needs_form(parameters)[source]

Build minimum needs tab.

Parameters:parameters (list) – A list containing element of form
build_post_processor_form(form_elements)[source]

Build Post Processor Tab.

Parameters:form_elements (dict) – A Dictionary containing element of form.
build_widget(form_layout, name, parameter_value)[source]

Create a new form element dynamically based from key_value type.

The Parameter Container will be inserted to form_layout.

Parameters:
  • form_layout (QFormLayout) – Mandatory a layout instance
  • name (str) – Mandatory string referencing the key in the function configurable parameters dictionary.
  • parameter_value – Mandatory representing the value referenced

by the key. :type parameter_value: object

Returns:a function that return the value of widget
Raises:None
explain_errors(exception)[source]
parse_input(input_dict)[source]

Parse the input value of widget.

Parameters:

input_dict (dict) – Dictionary that holds all values of element.

Returns:

Dictionary that can be consumed for impact functions.

Return type:

dict

Raises:
  • ValueError - occurs when some input cannot be converted

    to suitable type.

result()[source]

Get the result.

set_dialog_info(function_id)[source]

Show help text in dialog.

Parameters:function_id – The id of a function