Example #1
0
    def pasteData(self, data, setLocation=True):
        """Paste a copied guide representation.

        Arguments:
        data -- object, The JSON data object.

        Return:
        True if successful.

        """

        if not setLocation and data['location'] != self.getLocation():
            config = Config.getInstance()
            mirrorMap = config.getNameTemplate()['mirrorMap']
            if mirrorMap[data['location']] != data['location']:
                data = mirrorData(data, 0)
                del data['location']

        self.loadData(data)

        return True
Example #2
0
    def pasteData(self, data, setLocation=True):
        """Paste a copied guide representation.

        Args:
            data (dict): The JSON data object.
            setLocation (bool): Whether to set the location after pasting data.

        Returns:
            bool: True if successful.

        """

        if not setLocation and data['location'] != self.getLocation():
            config = Config.getInstance()
            mirrorMap = config.getNameTemplate()['mirrorMap']
            if mirrorMap[data['location']] != data['location']:
                data = mirrorData(data, 0)
                del data['location']

        self.loadData(data)

        return True
Example #3
0
    def pasteData(self, data, setLocation=True):
        """Paste a copied guide representation.

        Args:
            data (dict): The JSON data object.
            setLocation (bool): Whether to set the location after pasting data.

        Returns:
            bool: True if successful.

        """

        if not setLocation and data['location'] != self.getLocation():
            config = Config.getInstance()
            mirrorMap = config.getNameTemplate()['mirrorMap']
            if mirrorMap[data['location']] != data['location']:
                data = mirrorData(data, 0)
                del data['location']

        self.loadData(data)

        return True