<commit_before>## -*- coding: utf-8 -*-
from vendor.Qt import QtCore, QtGui, QtWidgets
import random
import string
import maya.cmds as cmds
import os


class ButtonWidget(QtWidgets.QToolButton):

    def __init__(self, parent, data, preview=False):
        self.parent = parent
        super(ButtonWidget, self).__init__(parent)
        self.data = data
        self.preview = preview

    def mouseMoveEvent(self, event):
        # 中クリックだけドラッグ＆ドロップ可能にする
        if event.buttons() != QtCore.Qt.MidButton:
            return

        # ドラッグ＆ドロップされるデータ形式を代入
        mimedata = QtCore.QMimeData()

        drag = QtGui.QDrag(self)
        drag.setMimeData(mimedata)
        # ドロップした位置にボタンの左上をセット
        drag.setHotSpot(event.pos() - self.rect().topLeft())
        drop_action = drag.exec_(QtCore.Qt.MoveAction)

    def mousePressEvent(self, event):
        # ボタンが押されたときのボタンの色の変化
        QtWidgets.QPushButton.mousePressEvent(self, event)

        # 左クリック
        if self.preview is True:
            return
        if event.button() == QtCore.Qt.LeftButton:
            print('mousePressEvent : ' + self.data.label)
            if self.data.use_externalfile is True:
                code = readfile(self.data.externalfile)
            else:
                code = self.data.code
            source_type = self.data.script_language.lower()
            script_execute(code, source_type)


class ButtonData(object):
    def __init__(self, label='', code='', path=''):
        self.label = label
        self.label_font_size = 10
        self.tooltip = ''
        self.bool_tooltip = True
        self.code = code
        self.script_language = 'Python'
        self.position_x = 0
        self.position_y = 0
        self.fix_size_flag = False
        self.btn_size_x = 100
        self.btn_size_y = 50
        self.icon_file = ':/polySphere.png'

        self.use_label = True
        self.use_icon = False
        self.icon_style = 0

        self.icon_size_x = 30
        self.icon_size_y = 30

        self.bgcolor = '#4a4a4a'
        self.use_bgcolor = False<commit_msg>ラベルの初期値を設定<commit_after>## -*- coding: utf-8 -*-
from vendor.Qt import QtCore, QtGui, QtWidgets
import random
import string
import maya.cmds as cmds
import os


class ButtonWidget(QtWidgets.QToolButton):

    def __init__(self, parent, data, preview=False):
        self.parent = parent
        super(ButtonWidget, self).__init__(parent)
        self.data = data
        self.preview = preview

    def mouseMoveEvent(self, event):
        # 中クリックだけドラッグ＆ドロップ可能にする
        if event.buttons() != QtCore.Qt.MidButton:
            return

        # ドラッグ＆ドロップされるデータ形式を代入
        mimedata = QtCore.QMimeData()

        drag = QtGui.QDrag(self)
        drag.setMimeData(mimedata)
        # ドロップした位置にボタンの左上をセット
        drag.setHotSpot(event.pos() - self.rect().topLeft())
        drop_action = drag.exec_(QtCore.Qt.MoveAction)

    def mousePressEvent(self, event):
        # ボタンが押されたときのボタンの色の変化
        QtWidgets.QPushButton.mousePressEvent(self, event)

        # 左クリック
        if self.preview is True:
            return
        if event.button() == QtCore.Qt.LeftButton:
            print('mousePressEvent : ' + self.data.label)
            if self.data.use_externalfile is True:
                code = readfile(self.data.externalfile)
            else:
                code = self.data.code
            source_type = self.data.script_language.lower()
            script_execute(code, source_type)


class ButtonData(object):
    def __init__(self, label='newButton', code='', path=''):
        self.label = label
        self.label_font_size = 10
        self.tooltip = ''
        self.bool_tooltip = True
        self.code = code
        self.script_language = 'Python'
        self.position_x = 0
        self.position_y = 0
        self.fix_size_flag = False
        self.btn_size_x = 100
        self.btn_size_y = 50
        self.icon_file = ':/polySphere.png'

        self.use_label = True
        self.use_icon = False
        self.icon_style = 0

        self.icon_size_x = 30
        self.icon_size_y = 30

        self.bgcolor = '#4a4a4a'
        self.use_bgcolor = False
{'fraction_non_alphanumeric': 0.09879518072289156, 'fraction_numerical': 0.008674698795180723, 'mean_word_length': 2.08166295471418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3537359', 'n_tokens_mistral': 1460, 'n_tokens_neox': 1394, 'n_words': 253}