diff --git a/src/Mod/BIM/bimcommands/BimArchUtils.py b/src/Mod/BIM/bimcommands/BimArchUtils.py index 9b31ef04d4..ec3de06802 100644 --- a/src/Mod/BIM/bimcommands/BimArchUtils.py +++ b/src/Mod/BIM/bimcommands/BimArchUtils.py @@ -22,18 +22,15 @@ """Misc Arch util commands""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") - - class Arch_Add: "the Arch Add command definition" diff --git a/src/Mod/BIM/bimcommands/BimAxis.py b/src/Mod/BIM/bimcommands/BimAxis.py index debbcf3682..fb23223dee 100644 --- a/src/Mod/BIM/bimcommands/BimAxis.py +++ b/src/Mod/BIM/bimcommands/BimAxis.py @@ -22,16 +22,16 @@ """The BIM Axis-related commands""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") + class Arch_Axis: "the Arch Axis command definition" diff --git a/src/Mod/BIM/bimcommands/BimBackground.py b/src/Mod/BIM/bimcommands/BimBackground.py index 9f9051fe84..eceeadd664 100644 --- a/src/Mod/BIM/bimcommands/BimBackground.py +++ b/src/Mod/BIM/bimcommands/BimBackground.py @@ -24,7 +24,6 @@ """The BIM Background command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimBox.py b/src/Mod/BIM/bimcommands/BimBox.py index 82968934b6..1d35a71545 100644 --- a/src/Mod/BIM/bimcommands/BimBox.py +++ b/src/Mod/BIM/bimcommands/BimBox.py @@ -23,7 +23,6 @@ """The BIM Box command""" -import os import FreeCAD import FreeCADGui @@ -141,7 +140,7 @@ class BIM_Box: def taskbox(self): "sets up a taskbox widget" - from PySide import QtCore, QtGui + from PySide import QtGui wid = QtGui.QWidget() ui = FreeCADGui.UiLoader() diff --git a/src/Mod/BIM/bimcommands/BimBuilder.py b/src/Mod/BIM/bimcommands/BimBuilder.py index b007a6cbdc..21528447db 100644 --- a/src/Mod/BIM/bimcommands/BimBuilder.py +++ b/src/Mod/BIM/bimcommands/BimBuilder.py @@ -24,7 +24,6 @@ """The BIM Builder command""" - import FreeCAD import FreeCADGui @@ -43,7 +42,6 @@ class BIM_Builder: } def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Builder") diff --git a/src/Mod/BIM/bimcommands/BimBuildingPart.py b/src/Mod/BIM/bimcommands/BimBuildingPart.py index e90326e7e8..bacc2b2d7f 100644 --- a/src/Mod/BIM/bimcommands/BimBuildingPart.py +++ b/src/Mod/BIM/bimcommands/BimBuildingPart.py @@ -25,12 +25,12 @@ # TODO: Refactor the Site code so it becomes a BuildingPart too -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -56,7 +56,7 @@ class Arch_Level: FreeCADGui.addModule("Arch") FreeCADGui.addModule("Draft") FreeCADGui.addModule("WorkingPlane") - FreeCADGui.doCommand("obj = Arch.makeFloor(FreeCADGui.Selection.getSelection())") + FreeCADGui.doCommand("obj = Arch.makeFloor(FreeCADGui.Selection.getSelection())") FreeCADGui.doCommand("obj.Placement = WorkingPlane.get_working_plane().get_placement()") FreeCADGui.doCommand("Draft.autogroup(obj)") FreeCAD.ActiveDocument.commitTransaction() diff --git a/src/Mod/BIM/bimcommands/BimClassification.py b/src/Mod/BIM/bimcommands/BimClassification.py index 32c1efed23..e0c272b5b4 100644 --- a/src/Mod/BIM/bimcommands/BimClassification.py +++ b/src/Mod/BIM/bimcommands/BimClassification.py @@ -22,13 +22,14 @@ """The BIM Classification command""" +import os import FreeCAD import FreeCADGui -import os QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -306,7 +307,7 @@ class BIM_Classification: # self.spanTopLevels() def updateByTree(self): - from PySide import QtCore, QtGui + from PySide import QtGui # order by hierarchy def istop(obj): @@ -368,8 +369,8 @@ class BIM_Classification: self.form.treeObjects.expandAll() def updateDefault(self): + from PySide import QtGui import Draft - from PySide import QtCore, QtGui d = self.objectslist.copy() d.update(self.matlist) @@ -389,7 +390,7 @@ class BIM_Classification: self.form.treeObjects.setCurrentItem(it) def updateClasses(self, search=""): - from PySide import QtCore, QtGui + from PySide import QtGui self.form.treeClass.clear() @@ -436,7 +437,7 @@ class BIM_Classification: first = False def addChildren(self, children, parent, search=""): - from PySide import QtCore, QtGui + from PySide import QtGui if children: for c in children: @@ -526,7 +527,8 @@ class BIM_Classification: ) if not os.path.exists(preset): return None - import codecs, re + import codecs + import re d = Item() with codecs.open(preset, "r", "utf-8") as f: @@ -663,7 +665,7 @@ class BIM_Classification: def getIcon(self,obj): """returns a QIcon for an object""" - from PySide import QtCore, QtGui + from PySide import QtGui import Arch_rc if hasattr(obj.ViewObject, "Icon"): diff --git a/src/Mod/BIM/bimcommands/BimCommon.py b/src/Mod/BIM/bimcommands/BimCommon.py index d3e720b00d..3a464ec276 100644 --- a/src/Mod/BIM/bimcommands/BimCommon.py +++ b/src/Mod/BIM/bimcommands/BimCommon.py @@ -24,7 +24,6 @@ """The BIM Common command""" - import FreeCAD import FreeCADGui @@ -47,7 +46,6 @@ class BIM_Common: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Common") diff --git a/src/Mod/BIM/bimcommands/BimCompound.py b/src/Mod/BIM/bimcommands/BimCompound.py index 216fe7fd5e..3f5d2a5366 100644 --- a/src/Mod/BIM/bimcommands/BimCompound.py +++ b/src/Mod/BIM/bimcommands/BimCompound.py @@ -24,7 +24,6 @@ """The BIM Compound command""" - import FreeCAD import FreeCADGui @@ -47,7 +46,6 @@ class BIM_Compound: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Compound") diff --git a/src/Mod/BIM/bimcommands/BimConvert.py b/src/Mod/BIM/bimcommands/BimConvert.py index 79377e2c30..8dac4243bd 100644 --- a/src/Mod/BIM/bimcommands/BimConvert.py +++ b/src/Mod/BIM/bimcommands/BimConvert.py @@ -24,7 +24,6 @@ """The BIM Convert command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimCurtainwall.py b/src/Mod/BIM/bimcommands/BimCurtainwall.py index 7dd821d0e1..d88e75ba1e 100644 --- a/src/Mod/BIM/bimcommands/BimCurtainwall.py +++ b/src/Mod/BIM/bimcommands/BimCurtainwall.py @@ -22,13 +22,12 @@ """Misc Arch util commands""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimCut.py b/src/Mod/BIM/bimcommands/BimCut.py index e9dca8d967..99b8086eb5 100644 --- a/src/Mod/BIM/bimcommands/BimCut.py +++ b/src/Mod/BIM/bimcommands/BimCut.py @@ -24,7 +24,6 @@ """The BIM Cut command""" - import FreeCAD import FreeCADGui @@ -46,7 +45,6 @@ class BIM_Cut: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Cut") diff --git a/src/Mod/BIM/bimcommands/BimCutPlane.py b/src/Mod/BIM/bimcommands/BimCutPlane.py index a19280a8ec..36d3b8abef 100644 --- a/src/Mod/BIM/bimcommands/BimCutPlane.py +++ b/src/Mod/BIM/bimcommands/BimCutPlane.py @@ -23,13 +23,12 @@ """The Arch CutPlane command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimDiff.py b/src/Mod/BIM/bimcommands/BimDiff.py index 0205a52f93..ef1c8f4724 100644 --- a/src/Mod/BIM/bimcommands/BimDiff.py +++ b/src/Mod/BIM/bimcommands/BimDiff.py @@ -22,7 +22,6 @@ """The BIM Diff command""" -import os import FreeCAD import FreeCADGui @@ -49,7 +48,7 @@ class BIM_Diff: # make the main doc the active one before running this script! # what will be compared: IDs, geometry, materials. Everything else is discarded. - from PySide import QtCore, QtGui + from PySide import QtGui import Draft MOVE_TOLERANCE = 0.2 # the max allowed move in mm diff --git a/src/Mod/BIM/bimcommands/BimDimensions.py b/src/Mod/BIM/bimcommands/BimDimensions.py index 18a8bd8f98..e700f70fdb 100644 --- a/src/Mod/BIM/bimcommands/BimDimensions.py +++ b/src/Mod/BIM/bimcommands/BimDimensions.py @@ -24,9 +24,9 @@ """The BIM DimensionAligned command""" - import FreeCAD import FreeCADGui + from draftguitools import gui_dimensions QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP diff --git a/src/Mod/BIM/bimcommands/BimDoor.py b/src/Mod/BIM/bimcommands/BimDoor.py index d6598fce1d..4a28b73022 100644 --- a/src/Mod/BIM/bimcommands/BimDoor.py +++ b/src/Mod/BIM/bimcommands/BimDoor.py @@ -24,7 +24,6 @@ """The BIM Door command""" - import FreeCAD import FreeCADGui from bimcommands import BimWindow diff --git a/src/Mod/BIM/bimcommands/BimDrawingView.py b/src/Mod/BIM/bimcommands/BimDrawingView.py index 637a68fd01..7635e33cd7 100644 --- a/src/Mod/BIM/bimcommands/BimDrawingView.py +++ b/src/Mod/BIM/bimcommands/BimDrawingView.py @@ -22,14 +22,12 @@ """The BIM DrawingView command""" - -import os import FreeCAD import FreeCADGui -from bimcommands import BimBuildingPart QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimEmptyTrash.py b/src/Mod/BIM/bimcommands/BimEmptyTrash.py index 5feeb10cff..4f2053cf63 100644 --- a/src/Mod/BIM/bimcommands/BimEmptyTrash.py +++ b/src/Mod/BIM/bimcommands/BimEmptyTrash.py @@ -24,7 +24,6 @@ """The BIM EmptyTrash command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimEquipment.py b/src/Mod/BIM/bimcommands/BimEquipment.py index e0bc19f7a7..09c215a751 100644 --- a/src/Mod/BIM/bimcommands/BimEquipment.py +++ b/src/Mod/BIM/bimcommands/BimEquipment.py @@ -22,13 +22,12 @@ """BIM equipment commands""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimExamples.py b/src/Mod/BIM/bimcommands/BimExamples.py index 6661f47308..cb1c4c9102 100644 --- a/src/Mod/BIM/bimcommands/BimExamples.py +++ b/src/Mod/BIM/bimcommands/BimExamples.py @@ -24,7 +24,6 @@ """The BIM Examples command""" - import FreeCAD import FreeCADGui @@ -44,7 +43,7 @@ class BIM_Examples: } def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui QtGui.QDesktopServices.openUrl("https://github.com/yorikvanhavre/FreeCAD-BIM-examples") diff --git a/src/Mod/BIM/bimcommands/BimExtrude.py b/src/Mod/BIM/bimcommands/BimExtrude.py index 6a37b4cd62..fad47e8439 100644 --- a/src/Mod/BIM/bimcommands/BimExtrude.py +++ b/src/Mod/BIM/bimcommands/BimExtrude.py @@ -24,7 +24,6 @@ """The BIM Extrude command""" - import FreeCAD import FreeCADGui @@ -45,7 +44,6 @@ class BIM_Extrude: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Extrude") diff --git a/src/Mod/BIM/bimcommands/BimFence.py b/src/Mod/BIM/bimcommands/BimFence.py index 2592c32c13..18ee964541 100644 --- a/src/Mod/BIM/bimcommands/BimFence.py +++ b/src/Mod/BIM/bimcommands/BimFence.py @@ -22,13 +22,12 @@ """BIM fence command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimFrame.py b/src/Mod/BIM/bimcommands/BimFrame.py index da946eb765..8009cac553 100644 --- a/src/Mod/BIM/bimcommands/BimFrame.py +++ b/src/Mod/BIM/bimcommands/BimFrame.py @@ -22,13 +22,12 @@ """BIM Frame command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -62,4 +61,3 @@ class Arch_Frame: FreeCADGui.addCommand('Arch_Frame',Arch_Frame()) - diff --git a/src/Mod/BIM/bimcommands/BimFuse.py b/src/Mod/BIM/bimcommands/BimFuse.py index b33b1edca9..dbacdaf23d 100644 --- a/src/Mod/BIM/bimcommands/BimFuse.py +++ b/src/Mod/BIM/bimcommands/BimFuse.py @@ -24,7 +24,6 @@ """The BIM Fuse command""" - import FreeCAD import FreeCADGui @@ -44,7 +43,6 @@ class BIM_Fuse: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Fuse") diff --git a/src/Mod/BIM/bimcommands/BimGlue.py b/src/Mod/BIM/bimcommands/BimGlue.py index 81f2534978..9300d521ad 100644 --- a/src/Mod/BIM/bimcommands/BimGlue.py +++ b/src/Mod/BIM/bimcommands/BimGlue.py @@ -24,7 +24,6 @@ """The BIM Glue command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimHelp.py b/src/Mod/BIM/bimcommands/BimHelp.py index 1df2bdb66b..0cda131f23 100644 --- a/src/Mod/BIM/bimcommands/BimHelp.py +++ b/src/Mod/BIM/bimcommands/BimHelp.py @@ -24,7 +24,6 @@ """The BIM Help command""" - import FreeCAD import FreeCADGui @@ -44,7 +43,7 @@ class BIM_Help: } def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui QtGui.QDesktopServices.openUrl("https://www.freecadweb.org/wiki/BIM_Workbench") diff --git a/src/Mod/BIM/bimcommands/BimIfcElements.py b/src/Mod/BIM/bimcommands/BimIfcElements.py index 123afb057b..5192271d7e 100644 --- a/src/Mod/BIM/bimcommands/BimIfcElements.py +++ b/src/Mod/BIM/bimcommands/BimIfcElements.py @@ -24,7 +24,6 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import FreeCAD import FreeCADGui @@ -50,7 +49,7 @@ class BIM_IfcElements: def Activated(self): import Draft - from PySide import QtCore, QtGui + from PySide import QtGui # build objects list self.objectslist = {} @@ -634,7 +633,7 @@ if FreeCAD.GuiUp: def getIcon(obj): """returns a QIcon for an object""" - from PySide import QtCore, QtGui + from PySide import QtGui import Arch_rc if hasattr(obj.ViewObject, "Icon"): diff --git a/src/Mod/BIM/bimcommands/BimIfcExplorer.py b/src/Mod/BIM/bimcommands/BimIfcExplorer.py index fc772f8976..cb96f40af3 100644 --- a/src/Mod/BIM/bimcommands/BimIfcExplorer.py +++ b/src/Mod/BIM/bimcommands/BimIfcExplorer.py @@ -21,6 +21,7 @@ # *************************************************************************** import os + import FreeCAD import FreeCADGui @@ -44,7 +45,7 @@ class BIM_IfcExplorer: def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui try: import ifcopenshell @@ -174,7 +175,7 @@ class BIM_IfcExplorer: "opens a file" import ifcopenshell - from PySide import QtCore, QtGui + from PySide import QtGui self.filename = "" lastfolder = FreeCAD.ParamGet( @@ -253,7 +254,7 @@ class BIM_IfcExplorer: "inserts selected objects in the active document" from importers import importIFC - from PySide import QtCore, QtGui + from PySide import QtCore doc = FreeCAD.ActiveDocument if doc and self.filename: @@ -472,7 +473,7 @@ class BIM_IfcExplorer: "adds the attributes of the given IFC entity under the given QTreeWidgetITem" import ifcopenshell - from PySide import QtCore, QtGui + from PySide import QtGui entity = self.ifc[eid] @@ -555,7 +556,7 @@ class BIM_IfcExplorer: def addProperties(self, eid, parent): "adds properties of a given entity to the given QTReeWidgetItem" - from PySide import QtCore, QtGui + from PySide import QtGui entity = self.ifc[eid] if hasattr(entity, "IsDefinedBy"): @@ -585,7 +586,7 @@ class BIM_IfcExplorer: def onSelectTree(self, item, previous): "displays attributes and properties of a tree item" - from PySide import QtCore, QtGui + from PySide import QtCore self.backnav.append(previous) eid = item.data(0, QtCore.Qt.UserRole) @@ -628,7 +629,7 @@ class BIM_IfcExplorer: def onDoubleClickTree(self, item, column): "when a property or attribute is double-clicked" - from PySide import QtCore, QtGui + from PySide import QtCore if self.tree: txt = item.text(column) diff --git a/src/Mod/BIM/bimcommands/BimIfcProperties.py b/src/Mod/BIM/bimcommands/BimIfcProperties.py index 02a8f42b16..9bb01e3fbe 100644 --- a/src/Mod/BIM/bimcommands/BimIfcProperties.py +++ b/src/Mod/BIM/bimcommands/BimIfcProperties.py @@ -26,11 +26,13 @@ import os import sys + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -53,7 +55,7 @@ class BIM_IfcProperties: return v def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui try: import ArchIFC @@ -244,7 +246,7 @@ class BIM_IfcProperties: return result def updateByType(self): - from PySide import QtCore, QtGui + from PySide import QtGui groups = {} for name, role in self.objectslist.items(): @@ -278,7 +280,7 @@ class BIM_IfcProperties: self.spanTopLevels() def updateByTree(self): - from PySide import QtCore, QtGui + from PySide import QtGui # order by hierarchy def istop(obj): @@ -336,7 +338,7 @@ class BIM_IfcProperties: self.form.tree.expandAll() def updateDefault(self): - from PySide import QtCore, QtGui + from PySide import QtGui for name, role in self.objectslist.items(): role = role[0] @@ -432,7 +434,7 @@ class BIM_IfcProperties: return props def getSearchResults(self, obj): - from PySide import QtCore, QtGui + from PySide import QtGui text = self.form.searchField.currentText() if not text: @@ -465,7 +467,7 @@ class BIM_IfcProperties: return QtGui.QStandardItem() def updateProperties(self, sel1=None, sel2=None): - from PySide import QtCore, QtGui + from PySide import QtGui self.propmodel.clear() self.propmodel.setHorizontalHeaderLabels( @@ -628,7 +630,7 @@ class BIM_IfcProperties: del self.objectslist[name][1][prop] def addProperty(self, idx=0, pset=None, prop=None, ptype=None): - from PySide import QtCore, QtGui + from PySide import QtGui if not self.form.tree.selectedIndexes(): return @@ -685,7 +687,7 @@ class BIM_IfcProperties: self.form.comboProperty.setCurrentIndex(0) def addPset(self, idx): - from PySide import QtCore, QtGui + from PySide import QtGui if not self.form.tree.selectedIndexes(): return @@ -732,7 +734,7 @@ class BIM_IfcProperties: self.form.comboPset.setCurrentIndex(0) def removeProperty(self): - from PySide import QtCore, QtGui + from PySide import QtGui sel = self.form.treeProperties.selectedIndexes() remove = [] @@ -764,7 +766,7 @@ class BIM_IfcProperties: if FreeCAD.GuiUp: - from PySide import QtCore, QtGui + from PySide import QtGui class propertiesDelegate(QtGui.QStyledItemDelegate): def __init__(self, parent=None, container=None, ptypes=[], plabels=[], *args): diff --git a/src/Mod/BIM/bimcommands/BimIfcQuantities.py b/src/Mod/BIM/bimcommands/BimIfcQuantities.py index f1ea3d0b19..36678c5f10 100644 --- a/src/Mod/BIM/bimcommands/BimIfcQuantities.py +++ b/src/Mod/BIM/bimcommands/BimIfcQuantities.py @@ -24,13 +24,15 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import csv +import os + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") QPROPS = [ @@ -81,7 +83,7 @@ class BIM_IfcQuantities: return v def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui # build objects list self.objectslist = {} @@ -329,7 +331,7 @@ class BIM_IfcQuantities: """Updates a single line of the table, without updating the actual object""" - from PySide import QtCore, QtGui + from PySide import QtCore i = self.get_row(name) if i == -1: diff --git a/src/Mod/BIM/bimcommands/BimImagePlane.py b/src/Mod/BIM/bimcommands/BimImagePlane.py index f171639c09..4d35e51cf7 100644 --- a/src/Mod/BIM/bimcommands/BimImagePlane.py +++ b/src/Mod/BIM/bimcommands/BimImagePlane.py @@ -24,7 +24,6 @@ """The BIM ImagePlane command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimLayers.py b/src/Mod/BIM/bimcommands/BimLayers.py index 4ad159229b..236af77e50 100644 --- a/src/Mod/BIM/bimcommands/BimLayers.py +++ b/src/Mod/BIM/bimcommands/BimLayers.py @@ -22,12 +22,12 @@ """Layers manager for FreeCAD""" -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -35,7 +35,7 @@ def getColorIcon(color): "returns a QtGui.QIcon from a color 3-float tuple" - from PySide import QtCore, QtGui + from PySide import QtGui c = QtGui.QColor(int(color[0] * 255), int(color[1] * 255), int(color[2] * 255)) im = QtGui.QImage(48, 48, QtGui.QImage.Format_ARGB32) @@ -64,7 +64,7 @@ class BIM_Layers: def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui # store changes to be committed self.deleteList = [] @@ -441,7 +441,7 @@ class BIM_Layers: def onToggle(self): "toggle selected layers on/off" - from PySide import QtCore, QtGui + from PySide import QtCore state = None for index in self.dialog.tree.selectedIndexes(): @@ -460,7 +460,7 @@ class BIM_Layers: def onIsolate(self): "isolates the selected layers (turns all the others off" - from PySide import QtCore, QtGui + from PySide import QtCore onrows = [] for index in self.dialog.tree.selectedIndexes(): @@ -473,7 +473,7 @@ class BIM_Layers: def onIFC(self): "attributes this layer to an IFC project" - from PySide import QtCore, QtGui + from PySide import QtGui for index in self.dialog.tree.selectedIndexes(): if index.column() == 1: diff --git a/src/Mod/BIM/bimcommands/BimLeader.py b/src/Mod/BIM/bimcommands/BimLeader.py index 6f65590b79..f76b21ce10 100644 --- a/src/Mod/BIM/bimcommands/BimLeader.py +++ b/src/Mod/BIM/bimcommands/BimLeader.py @@ -24,9 +24,9 @@ """The BIM Leader command""" - import FreeCAD import FreeCADGui + from draftguitools import gui_lines # Line tool from Draft QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP diff --git a/src/Mod/BIM/bimcommands/BimLibrary.py b/src/Mod/BIM/bimcommands/BimLibrary.py index 40c9607ee9..a781aeb82f 100644 --- a/src/Mod/BIM/bimcommands/BimLibrary.py +++ b/src/Mod/BIM/bimcommands/BimLibrary.py @@ -25,13 +25,15 @@ from __future__ import print_function """The BIM library tool""" -import sys import os +import sys + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") FILTERS = [ @@ -108,7 +110,7 @@ class BIM_Library_TaskPanel: def __init__(self, offlinemode=False): - from PySide import QtCore, QtGui + from PySide import QtGui self.mainDocName = FreeCAD.Gui.ActiveDocument.Document.Name self.previewDocName = "Viewer" @@ -345,7 +347,9 @@ class BIM_Library_TaskPanel: def addtolibrary(self): # DISABLED - import Part, Mesh, os + import os + import Mesh + import Part self.fileDialog = QtGui.QFileDialog.getSaveFileName( None, "Save As", self.librarypath @@ -380,7 +384,6 @@ class BIM_Library_TaskPanel: def setSearchModel(self, text): - import PartGui from PySide import QtGui def add_line(f, dp): @@ -445,7 +448,6 @@ class BIM_Library_TaskPanel: def setOnlineModel(self): from PySide import QtGui - import PartGui def addItems(root, d, path): for k, v in d.items(): @@ -813,8 +815,8 @@ class BIM_Library_TaskPanel: def getOnlineContentsAPI(self, url): """same as getOnlineContents but uses github API (faster)""" - import requests import json + import requests result = {} count = 0 diff --git a/src/Mod/BIM/bimcommands/BimMaterial.py b/src/Mod/BIM/bimcommands/BimMaterial.py index 29061417e7..581c4852b7 100644 --- a/src/Mod/BIM/bimcommands/BimMaterial.py +++ b/src/Mod/BIM/bimcommands/BimMaterial.py @@ -22,12 +22,12 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") if FreeCAD.GuiUp: diff --git a/src/Mod/BIM/bimcommands/BimNudge.py b/src/Mod/BIM/bimcommands/BimNudge.py index 25186739f6..4d74d2338c 100644 --- a/src/Mod/BIM/bimcommands/BimNudge.py +++ b/src/Mod/BIM/bimcommands/BimNudge.py @@ -22,7 +22,6 @@ """BIM nudge commands""" -import os import FreeCAD import FreeCADGui @@ -36,7 +35,7 @@ class BIM_Nudge: def getNudgeValue(self, mode): "mode can be dist, up, down, left, right. dist returns a float in mm, other modes return a 3D vector" - from PySide import QtCore, QtGui + from PySide import QtGui mw = FreeCADGui.getMainWindow() if mw: @@ -136,7 +135,7 @@ class BIM_Nudge_Switch(BIM_Nudge): } def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui mw = FreeCADGui.getMainWindow() if mw: diff --git a/src/Mod/BIM/bimcommands/BimOffset.py b/src/Mod/BIM/bimcommands/BimOffset.py index 406d629882..8cfc912b48 100644 --- a/src/Mod/BIM/bimcommands/BimOffset.py +++ b/src/Mod/BIM/bimcommands/BimOffset.py @@ -24,7 +24,6 @@ """The BIM Offset command""" - import FreeCAD import FreeCADGui @@ -46,7 +45,6 @@ class BIM_Offset2D: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_Offset2D") diff --git a/src/Mod/BIM/bimcommands/BimPanel.py b/src/Mod/BIM/bimcommands/BimPanel.py index c0cbb7352f..f4f8c78203 100644 --- a/src/Mod/BIM/bimcommands/BimPanel.py +++ b/src/Mod/BIM/bimcommands/BimPanel.py @@ -22,8 +22,6 @@ """BIM Panel-related Arch_""" - -import os import FreeCAD import FreeCADGui @@ -334,7 +332,6 @@ class NestTaskPanel: def __init__(self,obj=None): import ArchNesting - from PySide import QtCore, QtGui self.form = FreeCADGui.PySideUic.loadUi(":/ui/ArchNest.ui") self.form.progressBar.hide() self.form.ButtonPreview.setEnabled(False) diff --git a/src/Mod/BIM/bimcommands/BimPipe.py b/src/Mod/BIM/bimcommands/BimPipe.py index 82bfe2fe1c..4d624a2ae5 100644 --- a/src/Mod/BIM/bimcommands/BimPipe.py +++ b/src/Mod/BIM/bimcommands/BimPipe.py @@ -22,13 +22,12 @@ """BIM Panel-related Arch_""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimPreflight.py b/src/Mod/BIM/bimcommands/BimPreflight.py index 11fc0acdf7..fb28048f19 100644 --- a/src/Mod/BIM/bimcommands/BimPreflight.py +++ b/src/Mod/BIM/bimcommands/BimPreflight.py @@ -22,9 +22,11 @@ """This module contains FreeCAD commands for the BIM workbench""" - -import sys +import importlib +import inspect import os +import sys + import FreeCAD import FreeCADGui @@ -32,10 +34,6 @@ QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate -import importlib -import inspect - - tests = [ "testAll", "testIFC4", @@ -80,7 +78,7 @@ class BIM_Preflight: class BIM_Preflight_TaskPanel: def __init__(self): - from PySide import QtCore, QtGui + from PySide import QtGui self.results = {} # to store the result message self.culprits = {} # to store objects to highlight @@ -156,12 +154,12 @@ class BIM_Preflight_TaskPanel: self.customTests[butname] = func def getStandardButtons(self): - from PySide import QtCore, QtGui + from PySide import QtGui return QtGui.QDialogButtonBox.Close def reject(self): - from PySide import QtCore, QtGui + from PySide import QtGui QtGui.QApplication.restoreOverrideCursor() FreeCADGui.Control.closeDialog() @@ -170,7 +168,7 @@ class BIM_Preflight_TaskPanel: def passed(self, test): "sets the button as passed" - from PySide import QtCore, QtGui + from PySide import QtGui getattr(self.form, test).setIcon(QtGui.QIcon(":/icons/button_valid.svg")) getattr(self.form, test).setText(translate("BIM", "Passed")) @@ -181,7 +179,7 @@ class BIM_Preflight_TaskPanel: def failed(self, test): "sets the button as failed" - from PySide import QtCore, QtGui + from PySide import QtGui getattr(self.form, test).setIcon(QtGui.QIcon(":/icons/process-stop.svg")) getattr(self.form, test).setText("Failed") @@ -192,7 +190,7 @@ class BIM_Preflight_TaskPanel: def reset(self, test): "reset the button" - from PySide import QtCore, QtGui + from PySide import QtGui getattr(self.form, test).setIcon(QtGui.QIcon(":/icons/button_right.svg")) getattr(self.form, test).setText(translate("BIM", "Test")) @@ -293,7 +291,7 @@ class BIM_Preflight_TaskPanel: def testAll(self): "runs all tests" - from PySide import QtCore, QtGui + from PySide import QtGui from draftutils import todo for test in tests: @@ -698,6 +696,7 @@ class BIM_Preflight_TaskPanel: def testQuantities(self): "tests for explicit quantities export" + import Draft from PySide import QtCore, QtGui test = "testQuantities" diff --git a/src/Mod/BIM/bimcommands/BimProfile.py b/src/Mod/BIM/bimcommands/BimProfile.py index d6cbc3b8b6..2d71d592e9 100644 --- a/src/Mod/BIM/bimcommands/BimProfile.py +++ b/src/Mod/BIM/bimcommands/BimProfile.py @@ -22,13 +22,12 @@ """BIM Panel-related Arch_""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimProject.py b/src/Mod/BIM/bimcommands/BimProject.py index 3f0f5a705c..9e22957a52 100644 --- a/src/Mod/BIM/bimcommands/BimProject.py +++ b/src/Mod/BIM/bimcommands/BimProject.py @@ -24,7 +24,6 @@ """The BIM Project command - Includes previous Arch Project""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimProjectManager.py b/src/Mod/BIM/bimcommands/BimProjectManager.py index 83213f75df..96041080c6 100644 --- a/src/Mod/BIM/bimcommands/BimProjectManager.py +++ b/src/Mod/BIM/bimcommands/BimProjectManager.py @@ -22,10 +22,9 @@ """This module contains FreeCAD commands for the BIM workbench""" - -import os -import sys import math +import os + import FreeCAD import FreeCADGui @@ -49,7 +48,7 @@ class BIM_ProjectManager: import FreeCADGui import ArchBuildingPart - from PySide import QtCore, QtGui + from PySide import QtGui self.form = FreeCADGui.PySideUic.loadUi(":/ui/dialogProjectManager.ui") self.project = None @@ -413,7 +412,7 @@ class BIM_ProjectManager: def savePreset(self): import Arch - from PySide import QtCore, QtGui + from PySide import QtGui res = QtGui.QInputDialog.getText( None, @@ -648,7 +647,7 @@ class BIM_ProjectManager: ) d.Meta = values - from PySide import QtCore, QtGui + from PySide import QtGui filename = QtGui.QFileDialog.getSaveFileName( QtGui.QApplication.activeWindow(), @@ -670,7 +669,7 @@ class BIM_ProjectManager: """loads the contents of a template into the current file""" import FreeCADGui - from PySide import QtCore, QtGui + from PySide import QtGui filename = QtGui.QFileDialog.getOpenFileName( QtGui.QApplication.activeWindow(), diff --git a/src/Mod/BIM/bimcommands/BimRebar.py b/src/Mod/BIM/bimcommands/BimRebar.py index 02bc0cdbee..520041e0ff 100644 --- a/src/Mod/BIM/bimcommands/BimRebar.py +++ b/src/Mod/BIM/bimcommands/BimRebar.py @@ -22,13 +22,12 @@ """BIM Rebar command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimReextrude.py b/src/Mod/BIM/bimcommands/BimReextrude.py index b21f06a51a..efae914e35 100644 --- a/src/Mod/BIM/bimcommands/BimReextrude.py +++ b/src/Mod/BIM/bimcommands/BimReextrude.py @@ -24,7 +24,6 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimReference.py b/src/Mod/BIM/bimcommands/BimReference.py index 0a00ab5478..064581e635 100644 --- a/src/Mod/BIM/bimcommands/BimReference.py +++ b/src/Mod/BIM/bimcommands/BimReference.py @@ -22,13 +22,12 @@ """BIM Rebar command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimReorder.py b/src/Mod/BIM/bimcommands/BimReorder.py index 34eff7841c..d926afbe23 100644 --- a/src/Mod/BIM/bimcommands/BimReorder.py +++ b/src/Mod/BIM/bimcommands/BimReorder.py @@ -23,7 +23,6 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import FreeCAD import FreeCADGui @@ -57,7 +56,7 @@ class BIM_Reorder: class BIM_Reorder_TaskPanel: def __init__(self, obj): - from PySide import QtCore, QtGui + from PySide import QtGui self.obj = obj self.form = FreeCADGui.PySideUic.loadUi(":/ui/dialogReorder.ui") diff --git a/src/Mod/BIM/bimcommands/BimRewire.py b/src/Mod/BIM/bimcommands/BimRewire.py index 869bcc6076..a8fda529ee 100644 --- a/src/Mod/BIM/bimcommands/BimRewire.py +++ b/src/Mod/BIM/bimcommands/BimRewire.py @@ -24,7 +24,6 @@ """The BIM Rewire command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimRoof.py b/src/Mod/BIM/bimcommands/BimRoof.py index 97e097be76..029dc0d533 100644 --- a/src/Mod/BIM/bimcommands/BimRoof.py +++ b/src/Mod/BIM/bimcommands/BimRoof.py @@ -22,13 +22,12 @@ """BIM Roof command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -83,4 +82,3 @@ class Arch_Roof: FreeCADGui.addCommand("Arch_Roof", Arch_Roof()) - diff --git a/src/Mod/BIM/bimcommands/BimSchedule.py b/src/Mod/BIM/bimcommands/BimSchedule.py index 8018925232..2ecfdf1568 100644 --- a/src/Mod/BIM/bimcommands/BimSchedule.py +++ b/src/Mod/BIM/bimcommands/BimSchedule.py @@ -22,13 +22,12 @@ """BIM Schedule command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimSectionPlane.py b/src/Mod/BIM/bimcommands/BimSectionPlane.py index c6a326b27a..89da1c5be1 100644 --- a/src/Mod/BIM/bimcommands/BimSectionPlane.py +++ b/src/Mod/BIM/bimcommands/BimSectionPlane.py @@ -22,13 +22,12 @@ """BIM Schedule command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimSetup.py b/src/Mod/BIM/bimcommands/BimSetup.py index c5ea7ef468..d77b1b4d94 100644 --- a/src/Mod/BIM/bimcommands/BimSetup.py +++ b/src/Mod/BIM/bimcommands/BimSetup.py @@ -24,6 +24,7 @@ import os import sys + import FreeCAD import FreeCADGui @@ -396,7 +397,7 @@ class BIM_Setup: ) def setPreset(self, preset=None): - from PySide import QtCore, QtGui + from PySide import QtGui unit = None decimals = None @@ -650,11 +651,11 @@ class BIM_Setup: ifcok = True if not ifcok: # ifcopenshell not installed - import re import json - from PySide import QtGui - import zipfile + import re from urllib import request + import zipfile + from PySide import QtGui if not FreeCAD.GuiUp: reply = QtGui.QMessageBox.Yes diff --git a/src/Mod/BIM/bimcommands/BimShape2DView.py b/src/Mod/BIM/bimcommands/BimShape2DView.py index 3d69e95c34..9816e28c42 100644 --- a/src/Mod/BIM/bimcommands/BimShape2DView.py +++ b/src/Mod/BIM/bimcommands/BimShape2DView.py @@ -24,9 +24,9 @@ """The BIM ShapeView command""" - import FreeCAD import FreeCADGui + from draftguitools import gui_shape2dview QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP diff --git a/src/Mod/BIM/bimcommands/BimSimpleCopy.py b/src/Mod/BIM/bimcommands/BimSimpleCopy.py index 1bf6b5edfc..747b45f03d 100644 --- a/src/Mod/BIM/bimcommands/BimSimpleCopy.py +++ b/src/Mod/BIM/bimcommands/BimSimpleCopy.py @@ -24,7 +24,6 @@ """The BIM SimpleCopy command""" - import FreeCAD import FreeCADGui @@ -47,7 +46,6 @@ class BIM_SimpleCopy: return v def Activated(self): - import PartGui FreeCADGui.runCommand("Part_SimpleCopy") diff --git a/src/Mod/BIM/bimcommands/BimSite.py b/src/Mod/BIM/bimcommands/BimSite.py index 0fb487e83a..77ea154c10 100644 --- a/src/Mod/BIM/bimcommands/BimSite.py +++ b/src/Mod/BIM/bimcommands/BimSite.py @@ -25,12 +25,12 @@ # TODO: Refactor the Site code so it becomes a BuildingPart too -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimSketch.py b/src/Mod/BIM/bimcommands/BimSketch.py index 355d1c4732..6ccd1e3f8d 100644 --- a/src/Mod/BIM/bimcommands/BimSketch.py +++ b/src/Mod/BIM/bimcommands/BimSketch.py @@ -24,7 +24,6 @@ """The Bim Sketch command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimSpace.py b/src/Mod/BIM/bimcommands/BimSpace.py index a05e39ff0f..7874dc7d4f 100644 --- a/src/Mod/BIM/bimcommands/BimSpace.py +++ b/src/Mod/BIM/bimcommands/BimSpace.py @@ -22,13 +22,12 @@ """BIM Schedule command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimStairs.py b/src/Mod/BIM/bimcommands/BimStairs.py index 1491de5645..a47e0fc10b 100644 --- a/src/Mod/BIM/bimcommands/BimStairs.py +++ b/src/Mod/BIM/bimcommands/BimStairs.py @@ -22,13 +22,12 @@ """BIM Schedule command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimTDPage.py b/src/Mod/BIM/bimcommands/BimTDPage.py index f1f5966dd0..ebfdc703a0 100644 --- a/src/Mod/BIM/bimcommands/BimTDPage.py +++ b/src/Mod/BIM/bimcommands/BimTDPage.py @@ -24,10 +24,10 @@ """The BIM TDPage command""" +import os import FreeCAD import FreeCADGui -import os QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate @@ -49,7 +49,7 @@ class BIM_TDPage: return v def Activated(self): - from PySide import QtCore, QtGui + from PySide import QtGui import TechDraw templatedir = FreeCAD.ParamGet( diff --git a/src/Mod/BIM/bimcommands/BimTDView.py b/src/Mod/BIM/bimcommands/BimTDView.py index a80c0819d4..ae0416a2a4 100644 --- a/src/Mod/BIM/bimcommands/BimTDView.py +++ b/src/Mod/BIM/bimcommands/BimTDView.py @@ -24,7 +24,6 @@ """The BIM TD View command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimText.py b/src/Mod/BIM/bimcommands/BimText.py index f7b1fd3800..f57978df58 100644 --- a/src/Mod/BIM/bimcommands/BimText.py +++ b/src/Mod/BIM/bimcommands/BimText.py @@ -24,7 +24,6 @@ """This module contains BIM wrappers for commands from other workbenches""" - import FreeCAD import FreeCADGui @@ -87,4 +86,3 @@ class BIM_Text: FreeCADGui.addCommand("BIM_Text", BIM_Text()) - diff --git a/src/Mod/BIM/bimcommands/BimTogglePanels.py b/src/Mod/BIM/bimcommands/BimTogglePanels.py index b77da954fe..4b6e4b37c7 100644 --- a/src/Mod/BIM/bimcommands/BimTogglePanels.py +++ b/src/Mod/BIM/bimcommands/BimTogglePanels.py @@ -28,6 +28,7 @@ import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimTrash.py b/src/Mod/BIM/bimcommands/BimTrash.py index fc0db35cec..d4800cf87d 100644 --- a/src/Mod/BIM/bimcommands/BimTrash.py +++ b/src/Mod/BIM/bimcommands/BimTrash.py @@ -24,7 +24,6 @@ """The BIM Trash command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimTruss.py b/src/Mod/BIM/bimcommands/BimTruss.py index 6aab7bc40b..7652fa5fbe 100644 --- a/src/Mod/BIM/bimcommands/BimTruss.py +++ b/src/Mod/BIM/bimcommands/BimTruss.py @@ -22,13 +22,12 @@ """BIM Truss command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimTutorial.py b/src/Mod/BIM/bimcommands/BimTutorial.py index e7b53e3dbc..c43997b4e2 100644 --- a/src/Mod/BIM/bimcommands/BimTutorial.py +++ b/src/Mod/BIM/bimcommands/BimTutorial.py @@ -22,13 +22,14 @@ """This is the tutorial of the BIM workbench""" - import os + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -91,7 +92,9 @@ class BIM_Tutorial: QtCore.QTimer.singleShot(1000, self.load) def load(self, arg=None): - import re, sys, codecs + import codecs + import re + import sys if sys.version_info.major < 3: import urllib2 @@ -212,7 +215,7 @@ class BIM_Tutorial: self.update() def update(self): - from PySide import QtCore, QtGui + from PySide import QtCore if not hasattr(self, "form") or not self.form or not hasattr(self, "dock"): return @@ -271,7 +274,7 @@ class BIM_Tutorial: QtCore.QTimer.singleShot(TESTINTERVAL, self.checkGoals) def checkGoals(self): - from PySide import QtCore, QtGui + from PySide import QtCore if not hasattr(self, "form"): return diff --git a/src/Mod/BIM/bimcommands/BimUngroup.py b/src/Mod/BIM/bimcommands/BimUngroup.py index 1b6ab04147..0784a219d8 100644 --- a/src/Mod/BIM/bimcommands/BimUngroup.py +++ b/src/Mod/BIM/bimcommands/BimUngroup.py @@ -24,7 +24,6 @@ """The BIM Ungroup command""" - import FreeCAD import FreeCADGui diff --git a/src/Mod/BIM/bimcommands/BimViews.py b/src/Mod/BIM/bimcommands/BimViews.py index 1c03676a87..0d16b21aee 100644 --- a/src/Mod/BIM/bimcommands/BimViews.py +++ b/src/Mod/BIM/bimcommands/BimViews.py @@ -23,11 +23,13 @@ """The BIM Views command""" import sys + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + UPDATEINTERVAL = 2000 # number of milliseconds between BIM Views window update PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimWall.py b/src/Mod/BIM/bimcommands/BimWall.py index 4c65847aa0..13a973d170 100644 --- a/src/Mod/BIM/bimcommands/BimWall.py +++ b/src/Mod/BIM/bimcommands/BimWall.py @@ -22,13 +22,12 @@ """BIM wall command""" - -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") diff --git a/src/Mod/BIM/bimcommands/BimWelcome.py b/src/Mod/BIM/bimcommands/BimWelcome.py index f06e52e2c4..6a9f8456ad 100644 --- a/src/Mod/BIM/bimcommands/BimWelcome.py +++ b/src/Mod/BIM/bimcommands/BimWelcome.py @@ -22,11 +22,11 @@ """This module contains FreeCAD commands for the BIM workbench""" -import os import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") @@ -41,8 +41,6 @@ class BIM_Welcome: } def Activated(self): - from PySide import QtCore, QtGui - self.form = FreeCADGui.PySideUic.loadUi(":ui/dialogWelcome.ui") # handle the tutorial links diff --git a/src/Mod/BIM/bimcommands/BimWindow.py b/src/Mod/BIM/bimcommands/BimWindow.py index a65114acb4..076364eb3c 100644 --- a/src/Mod/BIM/bimcommands/BimWindow.py +++ b/src/Mod/BIM/bimcommands/BimWindow.py @@ -22,13 +22,14 @@ """BIM window command""" - import os + import FreeCAD import FreeCADGui QT_TRANSLATE_NOOP = FreeCAD.Qt.QT_TRANSLATE_NOOP translate = FreeCAD.Qt.translate + PARAMS = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") ALLOWEDHOSTS = ["Wall","Structure","Roof"] diff --git a/src/Mod/BIM/bimcommands/BimWindows.py b/src/Mod/BIM/bimcommands/BimWindows.py index 65839f26e4..a37de39e1a 100644 --- a/src/Mod/BIM/bimcommands/BimWindows.py +++ b/src/Mod/BIM/bimcommands/BimWindows.py @@ -22,7 +22,6 @@ """The BIM Windows Manager command""" -import os import FreeCAD import FreeCADGui @@ -52,7 +51,7 @@ class BIM_Windows: class BIM_Windows_TaskPanel: def __init__(self): - from PySide import QtCore, QtGui + from PySide import QtGui self.form = FreeCADGui.PySideUic.loadUi(":/ui/dialogWindows.ui") self.form.setWindowIcon(QtGui.QIcon(":/icons/BIM_Windows.svg")) @@ -78,7 +77,8 @@ class BIM_Windows_TaskPanel: FreeCAD.ActiveDocument.recompute() def update(self, index=None): - import Draft, Arch_rc + import Draft + import Arch_rc from PySide import QtGui self.form.windows.clear() @@ -214,7 +214,8 @@ class BIM_Windows_TaskPanel: self.update() def setMaterial(self): - import Draft, Arch_rc + import Draft + import Arch_rc from PySide import QtGui form = FreeCADGui.PySideUic.loadUi(":/ui/dialogMaterialChooser.ui") diff --git a/src/Mod/BIM/bimcommands/__init__.py b/src/Mod/BIM/bimcommands/__init__.py index 88d2ce3c47..ef6aed1f43 100644 --- a/src/Mod/BIM/bimcommands/__init__.py +++ b/src/Mod/BIM/bimcommands/__init__.py @@ -1,7 +1,8 @@ +import glob +import os + import Arch_rc import PartGui -import os -import glob # populate the list of submodules modules = glob.glob(os.path.join(os.path.dirname(__file__), "*.py"))