Module trase.tools.pcs.helpers

Functions

def fetchone(cur, msg='') ‑> tuple

Fetch one row from the cursor

:raises NoDataError: if no rows exist. You can customise the message using the msg keyword.

def fetchsingle(cur, msg='', too_long=None)

Fetch a single column of one row from the cursor.

:raises NoDataError: if no rows exist. You can customise the message using the msg keyword. :raises ValueError: if the row contains more than one column. You may specify a different exception with the too_long keyword.

def find_max_sequence(list_1, list_2)

Build longest sequence from 2 incomplete lists.

def flatten(list_of_lists)

Flatten values of in list of lists into single list.

:param list_of_lists: :type list_of_lists: list[list]

def flows_dataset_version_already_released(ref_id, cur=None)
def node_attributes_dataset_version_already_released(ref_id, cur=None)
def production_only(func)

Decorator to prevent execution of function on database other than production.

def unreleased_flows_dataset_only(func)

Decorator to prevent execution of function on flows datasets that have already been released.

def unreleased_node_attributes_dataset_only(func)

Decorator to prevent execution of function on node attributes datasets that have already been released.

Classes

class lazyproperty (func)

Only compute value of attribute when queried.