From ae89c0c0ae7b4b30d4c1989916a61589c9d8825d Mon Sep 17 00:00:00 2001 From: Damon Bohls Date: Fri, 9 Mar 2018 23:37:46 -0600 Subject: [PATCH] feat(DB): Add method to export clusters to a database file. Fixes #231 --- nixnet/database/_cluster.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nixnet/database/_cluster.py b/nixnet/database/_cluster.py index 0cfe591..f262142 100644 --- a/nixnet/database/_cluster.py +++ b/nixnet/database/_cluster.py @@ -52,6 +52,21 @@ def __hash__(self): def __repr__(self): return '{}(handle={})'.format(type(self).__name__, self._handle) + def export(self, db_filepath): + # type: (typing.Text) -> None + """Exports this cluster to a CANdb++ or LIN database file format. + + A CAN cluster is exported as a CANdb++ database file (.dbc). + A LIN cluster is exported as a LIN database file (.ldf). + If the target file exists, it is overwritten. + + Exporting a cluster is not supported under Real-Time (RT). + + Args: + db_filepath(str): Contains the pathname to the database file. + """ + _funcs.nxdb_save_database(self._handle, db_filepath) + def merge( self, source_obj,