def saveSettings(self, data): """ Save the given dict to the local location of the SETTING_PATH. :type data: dict :rtype: None """ path = studiolibrary.localPath("FormWidget.json") studiolibrary.updateJson(path, data)
def save(data): """ Save the given dict to the local location of the SETTING_PATH. :type data: dict :rtype: None """ global _settings _settings = None studiolibrary.updateJson(path(), data)
def saveSettings(data): """ Save the given dict to the local location of the SETTING_PATH. :type data: dict :rtype: None """ global _settings _settings = None studiolibrary.updateJson(SETTINGS_PATH, data)
def saveItemData(self, items): """ Save the item data to the database for the given items and columns. :type items: list[studiolibrary.LibraryItem] """ data = {} for item in items: path = item.path() itemData = item.itemData() data.setdefault(path, itemData) studiolibrary.updateJson(self.databasePath(), data)
def update(self, data): """ Update the database with the given data. :type data: dict :rtype: dict """ return studiolibrary.updateJson(self.path(), data)
def saveItemData(self, items, columns=None): """ Save the item data to the database for the given items and columns. :type columns: list[str] :type items: list[studiolibrary.LibraryItem] """ data = {} columns = columns or ["Custom Order"] for item in items: path = item.path() data.setdefault(path, {}) for column in columns: value = item.text(column) data[path].setdefault(column, value) studiolibrary.updateJson(self.databasePath(), data)