<commit_before># -*- coding: utf-8 -*-
"""
Contributed by <NAME>
Email: <EMAIL><at><EMAIL>.
Please see LICENSE for full license.
"""


# import os
# import sys
# import numpy as np
import math
import qt.QtGui as qg

# from popupcad.filetypes.operationoutput import OperationOutput
# import popupcad_manufacturing_plugins

import popupcad
from popupcad.filetypes.sketch import Sketch
from popupcad_manufacturing_plugins.manufacturing.autoweb4 import AutoWeb4
from popupcad.manufacturing.simplesketchoperation import SimpleSketchOp
from popupcad.filetypes.genericshapes import GenericLine
from popupcad.manufacturing.transform_internal import TransformInternal
from popupcad.manufacturing.laminateoperation2 import LaminateOperation2
from popupcad.filetypes.operation2 import Operation2
from popupcad.manufacturing.multivalueoperation3 import MultiValueOperation3
from popupcad.widgets.dragndroptree import DraggableTreeWidget
from popupcad.widgets.listmanager import SketchListManager,SketchListViewer
from popupcad.filetypes.operationoutput import OperationOutput

class Dialog(qg.QDialog):

    def __init__(self,design,prioroperations, tilepart = None):
        super(Dialog, self).__init__()

        if tilepart is not None:

            self.sheet_opref_tp = tilepart.sheet_opref
            self.part_opref_tp = tilepart.part_opref
            self.sketch_bounding_box_tp = tilepart.sketch_bounding_box
            self.sc_tp = tilepart.sc
            self.N_tp = tilepart.N
            self.x_gap_tp = tilepart.x_gap
            self.y_gap_tp = tilepart.y_gap
            self.support_offset_tp = tilepart.support_offset

        else:
            # define defaults
            self.sheet_opref_tp = design.operations[1].id
            self.part_opref_tp = design.operations[1].id
            self.sketch_bounding_box_tp = [(0,0),(0,0)]
            self.sc_tp = 1
            self.N_tp = 10
            self.x_gap_tp = 0
            self.y_gap_tp = 0
            self.support_offset_tp = 0

        self.build_dialog(design, prioroperations)

    def build_dialog(self, design, prioroperations):

        self.prioroperations = prioroperations
        self.design = design

        #       operation/part | sketch to tile in | sheet to tile into
        #                  'Number of parts', 'Scale'
        #                       'x-gap', 'y-gap'
        #                       'Support offset'

        self.part = DraggableTreeWidget()
        self.part.linklist(prioroperations)
        self.part.setObjectName("Operation to tile")
        # self.part.setCurrentItem(design.operation_index(self.part_opref_tp))
<commit_msg>dont need a design for tilepart, so it doesn't error<commit_after># -*- coding: utf-8 -*-
"""
Contributed by <NAME>
Email: <EMAIL><<EMAIL>.
Please see LICENSE for full license.
"""


# import os
# import sys
# import numpy as np
import math
import qt.QtGui as qg

# from popupcad.filetypes.operationoutput import OperationOutput
# import popupcad_manufacturing_plugins

import popupcad
from popupcad.filetypes.sketch import Sketch
from popupcad_manufacturing_plugins.manufacturing.autoweb4 import AutoWeb4
from popupcad.manufacturing.simplesketchoperation import SimpleSketchOp
from popupcad.filetypes.genericshapes import GenericLine
from popupcad.manufacturing.transform_internal import TransformInternal
from popupcad.manufacturing.laminateoperation2 import LaminateOperation2
from popupcad.filetypes.operation2 import Operation2
from popupcad.manufacturing.multivalueoperation3 import MultiValueOperation3
from popupcad.widgets.dragndroptree import DraggableTreeWidget
from popupcad.widgets.listmanager import SketchListManager,SketchListViewer
from popupcad.filetypes.operationoutput import OperationOutput

class Dialog(qg.QDialog):

    def __init__(self,design,prioroperations, tilepart = None):
        super(Dialog, self).__init__()

        if tilepart is not None:

            self.sheet_opref_tp = tilepart.sheet_opref
            self.part_opref_tp = tilepart.part_opref
            self.sketch_bounding_box_tp = tilepart.sketch_bounding_box
            self.sc_tp = tilepart.sc
            self.N_tp = tilepart.N
            self.x_gap_tp = tilepart.x_gap
            self.y_gap_tp = tilepart.y_gap
            self.support_offset_tp = tilepart.support_offset

        else:
            # define defaults
            self.sheet_opref_tp = None
            self.part_opref_tp = None
            self.sketch_bounding_box_tp = [(0,0),(0,0)]
            self.sc_tp = 1
            self.N_tp = 10
            self.x_gap_tp = 0
            self.y_gap_tp = 0
            self.support_offset_tp = 0

        self.build_dialog(design, prioroperations)

    def build_dialog(self, design, prioroperations):

        self.prioroperations = prioroperations
        self.design = design

        #       operation/part | sketch to tile in | sheet to tile into
        #                  'Number of parts', 'Scale'
        #                       'x-gap', 'y-gap'
        #                       'Support offset'

        self.part = DraggableTreeWidget()
        self.part.linklist(prioroperations)
        self.part.setObjectName("Operation to tile")
        # self.part.setCurrentItem(design.operation_index(self.part_opref_tp))

{'fraction_non_alphanumeric': 0.07229601518026565, 'fraction_numerical': 0.007590132827324478, 'mean_word_length': 2.8530701754385963, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 10, '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': '1788212', 'n_tokens_mistral': 1632, 'n_tokens_neox': 1486, 'n_words': 333}