spinetoolbox.widgets.spine_datapackage_widget¶
Widget shown to user when opening a ‘datapackage.json’ file in Data Connection item.
| author: |
|
|---|---|
| date: | 7.7.2018 |
Module Contents¶
Classes¶
SpineDatapackageWidget |
A widget to edit CSV files in a Data Connection and create a tabular datapackage. |
CustomPackage |
Custom datapackage class. |
-
class
spinetoolbox.widgets.spine_datapackage_widget.SpineDatapackageWidget(data_connection)[source]¶ Bases:
PySide2.QtWidgets.QMainWindowA widget to edit CSV files in a Data Connection and create a tabular datapackage.
Initialize class.
Parameters: data_connection (DataConnection) – Data Connection associated to this widget Add extra menu actions.
-
update_window_modified(self, _clean=None)[source]¶ Updates window modified status and save actions depending on the state of the undo stack.
-
showEvent(self, e)[source]¶ Called when the form shows. Init datapackage (either from existing datapackage.json or by inferring a new one from sources) and update ui.
Adjusts copy and paste actions depending on which widget has the focus.
-
add_message(self, msg)[source]¶ Prepend regular message to status bar.
Parameters: msg (str) – String to show in QStatusBar
-
_handle_current_resource_changed(self, current, _previous)[source]¶ Resets resource data and schema models whenever a new resource is selected.
-
class
spinetoolbox.widgets.spine_datapackage_widget.CustomPackage(*args, **kwargs)[source]¶ Bases:
datapackage.PackageCustom datapackage class.
-
difference_infer(self, path)[source]¶ Infers only what’s new in the given path.
Parameters: path (str) –
-
append_to_primary_key(self, resource_index, field_index)[source]¶ Append field to resources’s primary key.
-