nxt.legacy module

class FileConverter(file_data)[source]

Bases: object

determine_version()[source]

Strips off the bug fix number then returns the major version number and the feature number. :return: Version number #.##

classmethod get_converted_data(file_data)[source]

Sets up converter object and returns the converted data. Note the input data and output data may be the same if no conversion is deemed necessary. :param file_data: Dict of file data from NxtIo :return: Updated file data dict

class LegacyFileConverter(file_data, from_version, to_version)[source]

Bases: object

convert()[source]

Meant to be overloaded with conversion logic.

classmethod get_converted(file_data)[source]

Kicks off the conversion of the data and returns the converted data. :param file_data: Dict of file data from NxtIo :return: Updated file data dict

class V1(file_data)[source]

Bases: nxt.legacy.LegacyFileConverter

convert()[source]

Meant to be overloaded with conversion logic.

unpack_node_data(node_data, parent_path)[source]
arrange_node_data()[source]
deep_order_data(node_dict)[source]

Recursively orders the ordered dicts

drop_nodes()[source]
static has_opinion(attr_value)[source]
is_ancestor(path, ancestor_path)[source]
static get_parent_path(path)[source]
static get_name_from_path(path)[source]
class V109(file_data)[source]

Bases: nxt.legacy.LegacyFileConverter

convert()[source]

Meant to be overloaded with conversion logic.

update_refs()[source]
update_meta_data()[source]
arrange_node_data()[source]
deep_order_data(node_dict)[source]

Recursively orders the ordered dicts

is_ancestor(path, ancestor_path)[source]
class V114(file_data)[source]

Bases: nxt.legacy.LegacyFileConverter

convert()[source]

Meant to be overloaded with conversion logic.

arrange_node_data()[source]
deep_order_data(node_dict)[source]

Recursively orders the ordered dicts

is_ancestor(path, ancestor_path)[source]
class V115(file_data)[source]

Bases: nxt.legacy.LegacyFileConverter

convert()[source]

Meant to be overloaded with conversion logic.

order_save_data(file_dict)[source]
order_nodes_dict(nodes_dict)[source]
order_node_data(node_data)[source]
order_meta_data(meta_data)[source]
cli_file_convert(file_path, replace=False)[source]

Simple logic for converting files from the CLI