def rotate(self, amount=1, blocksOnly=False):
        """
        Rotates the brush.
        :keyword blocksOnly: Also rotate the data value of the block we're brushing with.
        """
        def rotateBlock():
            list = [key for key in self.options if isinstance(self.options[key], Block)]
            list = getattr(self.brushMode, 'rotatableBlocks', list)
            for key in list:
                bl = self.options[key]
                data = [[[bl.blockData]]]
                blockrotation.RotateLeft([[[bl.ID]]], data)
                bl.blockData = data[0][0][0]
            self.showPanel()

        if config.settings.rotateBlockBrush.get() or blocksOnly:
            rotateBlock()
        if not blocksOnly:
            W = self.options['W']
            self.options['W'] = self.options['L']
            self.options['L'] = W
        self.setupPreview()

        Rotates the brush.
        :keyword blocksOnly: Also rotate the data value of the block we're brushing with.
        
editortools/brush.py