Skip to content

Commit 171e838

Browse files
committed
Apply code style
1 parent e2b2449 commit 171e838

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

MeshTools.py

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
try:
55
from cura.ApplicationMetadata import CuraSDKVersion
6-
except ImportError: # Cura <= 3.6
6+
except ImportError: # Cura <= 3.6
77
CuraSDKVersion = "6.0.0"
88
USE_QT5 = False
99
if CuraSDKVersion >= "8.0.0":
@@ -19,7 +19,6 @@
1919
from UM.PluginRegistry import PluginRegistry
2020
from UM.Message import Message
2121
from UM.Logger import Logger
22-
from UM.Version import Version
2322

2423
from UM.Scene.Selection import Selection
2524
from UM.Scene.SceneNode import SceneNode
@@ -31,37 +30,32 @@
3130
from cura.Scene.SliceableObjectDecorator import SliceableObjectDecorator
3231
from cura.Scene.BuildPlateDecorator import BuildPlateDecorator
3332
from UM.Mesh.MeshData import MeshData, calculateNormalsFromIndexedVertices
34-
from UM.Mesh.MeshBuilder import MeshBuilder
3533
from UM.Math.AxisAlignedBox import AxisAlignedBox
3634
from UM.Mesh.ReadMeshJob import ReadMeshJob
3735
from UM.Math.Vector import Vector
3836
from UM.Math.Matrix import Matrix
37+
from UM.Resources import Resources
38+
from UM.i18n import i18nCatalog
3939

4040
from .SetTransformMatrixOperation import SetTransformMatrixOperation
4141
from .SetParentOperationSimplified import SetParentOperationSimplified
4242
from .SetMeshDataAndNameOperation import SetMeshDataAndNameOperation
43-
43+
4444
import os
4545
import sys
4646
import numpy
4747
import trimesh
4848
import random
49-
import copy
5049

5150
from typing import Optional, List, Dict
5251

53-
from UM.Resources import Resources
54-
from UM.i18n import i18nCatalog
55-
5652
Resources.addSearchPath(
5753
os.path.join(os.path.abspath(os.path.dirname(__file__)))
5854
) # Plugin translation file import
5955

6056
catalog = i18nCatalog("meshtools")
6157

62-
if catalog.hasTranslationLoaded():
63-
Logger.log("i", "Mesh-Tool Plugin translation loaded!")
64-
58+
6559
class MeshTools(Extension, QObject,):
6660
def __init__(self, parent = None) -> None:
6761
QObject.__init__(self, parent)
@@ -78,9 +72,9 @@ def __init__(self, parent = None) -> None:
7872
self._controller = self._application.getController()
7973
self._controller.getScene().sceneChanged.connect(self._onSceneChanged)
8074

81-
self._currently_loading_files = [] #type: List[str]
82-
self._node_queue = [] #type: List[SceneNode]
83-
self._mesh_not_watertight_messages = {} #type: Dict[str, Message]
75+
self._currently_loading_files = [] # type: List[str]
76+
self._node_queue = [] # type: List[SceneNode]
77+
self._mesh_not_watertight_messages = {} # type: Dict[str, Message]
8478

8579
self._settings_dialog = None
8680
self._rename_dialog = None
@@ -128,7 +122,7 @@ def _onEngineCreated(self) -> None:
128122
for child in main_window.contentItem().children():
129123
try:
130124
if not USE_QT5:
131-
test = child.handleVisibility # With QtQuick Controls 2, ContextMenu is the only item that has a findItemIndex function in the main window root contentitem
125+
test = child.handleVisibility # With QtQuick Controls 2, ContextMenu is the only item that has a findItemIndex function in the main window root contentitem
132126
else:
133127
test = child.findItemIndex # With QtQuick Controls 1, ContextMenu is the only item that has a findItemIndex function
134128
context_menu = child
@@ -346,7 +340,10 @@ def fixSimpleHolesForMeshes(self) -> None:
346340
success = tri_node.fill_holes()
347341
self._replaceSceneNode(node, [tri_node])
348342
if not success:
349-
self._message.setText(catalog.i18nc("@info:status", "The mesh needs more extensive repair to become watertight"))
343+
self._message.setText(catalog.i18nc(
344+
"@info:status",
345+
"The mesh needs more extensive repair to become watertight"
346+
))
350347
self._message.show()
351348

352349
@pyqtSlot()

0 commit comments

Comments
 (0)