Пример #1
0
    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)
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
    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)
Пример #5
0
    def update(self, data):
        """
        Update the database with the given data.

        :type data: dict
        :rtype: dict
        """
        return studiolibrary.updateJson(self.path(), data)
Пример #6
0
    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)