lgtm: removes unused imports in Python scripts

This commit is contained in:
wmayer
2022-03-20 23:00:55 +01:00
parent bec723ba17
commit cf7fd5d2ac
17 changed files with 16 additions and 28 deletions

View File

@@ -213,7 +213,7 @@ def InitApplications():
subdirectory = workbench.Name if not workbench.Subdirectory else workbench.Subdirectory
subdirectory = subdirectory.replace("/",os.path.sep)
subdirectory = os.path.join(Dir, subdirectory)
classname = workbench.Classname
#classname = workbench.Classname
sys.path.insert(0,subdirectory)
PathExtension.append(subdirectory)
RunInitPy(subdirectory)

View File

@@ -1,7 +1,6 @@
# (c) 2021 Werner Mayer LGPL
from PySide2 import QtUiTools
from PySide2 import QtCore
import FreeCADGui as Gui

View File

@@ -180,7 +180,6 @@ def InitApplications():
RunInitGuiPy(Dir)
Log("All modules with GUIs using InitGui.py are now initialized\n")
extension_modules = []
try:
import pkgutil
import importlib

View File

@@ -24,7 +24,6 @@
import FreeCAD as App
import FreeCADGui as Gui
from PySide import QtCore
from PySide import QtGui
class RemoteDebugger():

View File

@@ -33,7 +33,6 @@ __url__ = "https://www.freecadweb.org"
import FreeCAD
import FreeCADGui
from FreeCAD import Units
from PySide import QtCore
from femguiutils import selection_widgets
from femtools import femutils
from femtools import membertools

View File

@@ -21,8 +21,6 @@
# * *
# ***************************************************************************/
import FreeCAD as App
def getAllDependencies(feat):
'''getAllDependencies(feat): gets all features feat depends on, directly or indirectly.
Returns a list, with deepest dependencies last. feat is not included in the list, except

View File

@@ -19,14 +19,11 @@
#* *
#***************************************************************************
import FreeCAD, Sketcher
import FreeCAD
if FreeCAD.GuiUp:
import FreeCADGui,SketcherGui,os
from PySide import QtCore, QtGui
from PySide.QtCore import Qt
from PySide.QtGui import QApplication, QCursor
from FreeCADGui import PySideUic as uic
import FreeCADGui
from PySide import QtCore
#s=os.path.dirname(__file__)
#s=os.path.join(s,"ProfileLib")

View File

@@ -19,7 +19,7 @@
# USA *
#**************************************************************************
import FreeCAD, FreeCADGui, os, sys, unittest, Sketcher, SketcherGui
#import FreeCAD, FreeCADGui, os, sys, unittest, Sketcher, SketcherGui
#---------------------------------------------------------------------------

View File

@@ -20,7 +20,6 @@
#***************************************************************************
import os
import sys
import FreeCAD
import FreeCADGui

View File

@@ -106,7 +106,7 @@ def getInfo(filename):
import gnomevfs
except Exception:
# alternative method
import hashlib,urllib.parse
import hashlib
fhash = hashlib.md5(bytes(urllib.parse.quote("file://"+path,safe=":/"),"ascii")).hexdigest()
thumb = os.path.join(os.path.expanduser("~"),".thumbnails","normal",fhash+".png")
else:

View File

@@ -19,7 +19,6 @@
#* *
#***************************************************************************
import sys
from PySide import QtGui

View File

@@ -66,7 +66,7 @@ class TemplatePyMod_Cmd2:
self.node=[]
self.view.removeEventCallback("SoMouseButtonEvent",self.call)
p=PolygonCreator(d,v,10)
self.polycreator = PolygonCreator(d,v,10)
def IsActive(self):
if FreeCAD.ActiveDocument is None:

View File

@@ -597,7 +597,7 @@ class ViewProviderCircleSet:
def updateData(self, fp, prop):
if prop == "Shape":
edges=p = fp.getPropertyByName("Shape").Edges
edges = fp.getPropertyByName("Shape").Edges
pts=[]
ver=[]
for i in edges:
@@ -630,8 +630,8 @@ def makeCircleSet():
doc=FreeCAD.newDocument()
a=FreeCAD.ActiveDocument.addObject("App::FeaturePython","Circles")
c=CircleSet(a)
v=ViewProviderCircleSet(a.ViewObject)
CircleSet(a)
ViewProviderCircleSet(a.ViewObject)
a.Shape=comp
doc.recompute()

View File

@@ -5,8 +5,7 @@
# http://forum.freecadweb.org/viewtopic.php?f=3&t=2307
import threading
import Mesh, MeshGui
from FreeCAD import Base
import Mesh
# Create a global mesh and make copies of them
# This makes the algorithm faster by ~60%.

View File

@@ -6,7 +6,7 @@ Examples for customizing the FreeCAD application with PySide facilities.
__author__ = "Werner Mayer <werner.wm.mayer@gmx.de>"
from PySide import QtCore,QtGui
import FreeCAD,FreeCADGui, __main__
import FreeCADGui, __main__
class MainWindow:
def __init__(self):

View File

@@ -102,6 +102,7 @@ class TaskManyTaskBoxes:
widget2 = QtGui.QWidget()
widget2.setWindowTitle("My Test Box")
text = QtGui.QLabel("testBox",widget2)
text.setObjectName("label")
self.form = [widget1,widget2]
def createTask():

View File

@@ -1,7 +1,6 @@
# (c) 2012 Werner Mayer LGPL
import FreeCAD, FreeCADGui
from FreeCAD import Base
from pivy import coin
class Texture:
@@ -50,9 +49,9 @@ class ViewProviderTexture:
doc = FreeCADGui.getDocument(doc.Name)
graph = doc.ActiveView.getSceneGraph()
graph.removeChild(root)
def claimChildren(self):
return [self.obj.Object.Source]
def claimChildren(self):
return [self.obj.Object.Source]
def __getstate__(self):
return None