From 9e0b4f0a312b129e3df56fea5b1372b9920ede93 Mon Sep 17 00:00:00 2001 From: Gbkng Date: Wed, 20 Dec 2023 12:08:19 +0100 Subject: [PATCH] autoflake remove unused imports, useless pass, unused vars --- AllTestLauncherSat.py | 5 +---- commands/application.py | 1 - commands/compile.py | 4 ---- commands/config.py | 5 ++--- commands/install.py | 2 -- commands/jobs.py | 1 - commands/launcher.py | 1 - commands/package.py | 2 +- commands/patch.py | 1 - commands/prepare.py | 2 -- commands/source.py | 2 -- commands/source_update.py | 2 -- commands/upgrade.py | 5 ----- .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../Cpp_Template__TEST/Cpp_Template__test.py | 1 - .../src/Controller/Controller.py | 11 +--------- .../src/Dialog/CreateCircleDialog.py | 5 ----- .../src/Dialog/CreatePolylineDialog.py | 5 ----- .../PythonComponent/src/Dialog/Dialog.py | 10 ---------- .../PythonComponent/src/Dialog/DialogEdit.py | 9 --------- .../src/Dialog/EditCenterDialog.py | 6 ------ .../src/Dialog/EditPointDialog.py | 6 ------ .../src/Dialog/EditRadiusDialog.py | 4 ---- .../src/Dialog/RenameDialog.py | 4 ---- .../PythonComponent/src/Model/Circle.py | 3 --- .../PythonComponent/src/Model/Model.py | 4 ---- .../PythonComponent/src/Model/Polyline.py | 5 ----- .../PythonComponent/src/PYCMP/PYCMP.py | 5 ----- .../PythonComponent/src/PYCMP/PYCMP_utils.py | 12 ----------- .../src/PYCMPGUI/PYCMPDesktop.py | 9 --------- .../PythonComponent/src/PYCMPGUI/PYCMPGUI.py | 20 ------------------- .../PythonComponent/src/StandAlone/Desktop.py | 11 ---------- .../src/StandAlone/StandalonePYCMPGUI.py | 1 - .../src/View/CircleGraphicsScene.py | 5 +---- .../src/View/CircleTreeWidgetItem.py | 3 --- .../src/View/GraphicsRectItem.py | 2 -- .../PythonComponent/src/View/GraphicsScene.py | 13 ------------ .../PythonComponent/src/View/GraphicsView.py | 17 +--------------- .../PythonComponent/src/View/Menu.py | 2 -- .../src/View/PolyGraphicsScene.py | 5 ----- .../src/View/PolyTreeWidgetItem.py | 4 ---- .../PythonComponent/src/View/TreeWidget.py | 15 -------------- .../src/View/TreeWidgetItem.py | 10 ---------- .../PythonComponent/src/View/View.py | 6 ------ .../src/Controller/Controller.py | 11 +--------- .../src/Dialog/CreateCircleDialog.py | 5 ----- .../src/Dialog/CreatePolylineDialog.py | 5 ----- .../PythonComponent8/src/Dialog/Dialog.py | 10 ---------- .../PythonComponent8/src/Dialog/DialogEdit.py | 9 --------- .../src/Dialog/EditCenterDialog.py | 6 ------ .../src/Dialog/EditPointDialog.py | 6 ------ .../src/Dialog/EditRadiusDialog.py | 4 ---- .../src/Dialog/RenameDialog.py | 4 ---- .../PythonComponent8/src/Model/Circle.py | 3 --- .../PythonComponent8/src/Model/Model.py | 4 ---- .../PythonComponent8/src/Model/Polyline.py | 5 ----- .../PythonComponent8/src/PYCMP/PYCMP.py | 5 ----- .../PythonComponent8/src/PYCMP/PYCMP_utils.py | 12 ----------- .../src/PYCMPGUI/PYCMPDesktop.py | 9 --------- .../PythonComponent8/src/PYCMPGUI/PYCMPGUI.py | 20 ------------------- .../src/StandAlone/Desktop.py | 11 ---------- .../src/StandAlone/StandalonePYCMPGUI.py | 1 - .../src/View/CircleGraphicsScene.py | 5 +---- .../src/View/CircleTreeWidgetItem.py | 3 --- .../src/View/GraphicsRectItem.py | 2 -- .../src/View/GraphicsScene.py | 13 ------------ .../PythonComponent8/src/View/GraphicsView.py | 17 +--------------- .../PythonComponent8/src/View/Menu.py | 2 -- .../src/View/PolyGraphicsScene.py | 5 ----- .../src/View/PolyTreeWidgetItem.py | 4 ---- .../PythonComponent8/src/View/TreeWidget.py | 15 -------------- .../src/View/TreeWidgetItem.py | 10 ---------- .../PythonComponent8/src/View/View.py | 6 ------ doc/src/conf.py | 2 -- src/ElementTreePython3.py | 1 - src/__init__.py | 1 - src/callerName.py | 2 -- src/colorama/win32.py | 2 +- src/debug.py | 3 +-- src/environment.py | 2 +- src/fork.py | 1 - src/i18n/i18nTest.py | 1 - src/loggingSimple.py | 5 +---- src/product.py | 1 - src/pyconf.py | 4 ---- src/salomeTools.py | 3 +-- src/test/TOOLS.py | 1 - src/test/scriptTemplate.py | 3 --- src/test_module.py | 6 +----- src/utilsSat.py | 5 ----- src/versionMinorMajorPatch.py | 2 -- src/xmlManager.py | 1 - test/test_020_debug.py | 3 --- test/test_021_versionMinorMajorPatch.py | 3 --- test/test_024_logging.py | 6 ------ test/test_035_pyconf.py | 3 --- test/test_100_satHelp.py | 5 +---- test/test_500_APPLI_TEST.py | 7 ++----- test/test_501_paramiko.py | 2 -- .../compilation/test_compilation.py | 2 -- .../test_sat5_0/compilation/test_configure.py | 2 -- test/test_sat5_0/compilation/test_make.py | 2 -- .../compilation/test_makeinstall.py | 2 -- .../config/test_create_user_pyconf.py | 1 - test/test_sat5_0/config/test_option_copy.py | 2 -- test/test_sat5_0/config/test_option_edit.py | 3 --- test/test_sat5_0/config/test_option_value.py | 3 --- .../test_sat5_0/config/test_option_value_2.py | 3 --- test/test_sat5_0/environ/test_environ.py | 2 -- test/test_sat5_0/job/test_job.py | 2 -- test/test_sat5_0/jobs/test_jobs.py | 2 -- test/test_sat5_0/log/test_launch_browser.py | 3 +-- test/test_sat5_0/log/test_launch_browser2.py | 3 --- test/test_sat5_0/prepare/test_clean.py | 2 -- test/test_sat5_0/prepare/test_patch.py | 2 -- test/test_sat5_0/prepare/test_prepare.py | 2 -- test/test_sat5_0/prepare/test_source.py | 2 -- test/test_sat5_0/shell/test_shell.py | 2 -- test/test_sat5_0/test/test_command.py | 2 -- unittestpy/HTMLTestRunner.py | 1 - 125 files changed, 20 insertions(+), 564 deletions(-) diff --git a/AllTestLauncherSat.py b/AllTestLauncherSat.py index 6c1740a..550c9ea 100755 --- a/AllTestLauncherSat.py +++ b/AllTestLauncherSat.py @@ -55,7 +55,6 @@ import unittest import traceback import argparse as AP -import glob import fnmatch import pprint as PP # pretty print import src @@ -225,7 +224,7 @@ def runOnArgs(args): del sys.path[0] done = False filesForTest[aFile] = (aImport, aModule) - except Exception as e: + except Exception: if done: del sys.path[0] # attention of sys.path appends done = False @@ -252,10 +251,8 @@ def runOnArgs(args): errPrint("Test: %s %s" % (i, k)) if i == 0: suite = loader.loadTestsFromModule(filesForTest[k][1]) - pass else: suite.addTests(loader.loadTestsFromModule(filesForTest[k][1])) - pass if args.type == "std": runner = unittest.TextTestRunner(verbosity=args.verbosity) diff --git a/commands/application.py b/commands/application.py index 1a2a67f..161410c 100644 --- a/commands/application.py +++ b/commands/application.py @@ -17,7 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import stat import sys import shutil import subprocess diff --git a/commands/compile.py b/commands/compile.py index 72e6af4..912faae 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -633,7 +633,6 @@ def compile_product_pip(sat, p_name_info, config, options, logger, header, len_e p_name, p_info = p_name_info res = 0 error_step = "" - pip_install_in_python = False pip_wheels_dir = os.path.join(config.LOCAL.archive_dir, "wheels") pip_install_cmd = ( config.INTERNAL.command.pip_install @@ -698,7 +697,6 @@ def compile_product_pip(sat, p_name_info, config, options, logger, header, len_e p_info.name, p_info.version, ) - pip_install_in_python = True else: # pip will install product in product install_dir pip_install_dir = os.path.join( @@ -971,8 +969,6 @@ def run(args, runner, logger): # Use the sorted list of all products to sort the list of products we have to compile sorted_product_list = [] - product_list_runtime = [] - product_list_compiletime = [] # store at beginning compile time products, we need to compile them before! for n in sorted_nodes: diff --git a/commands/config.py b/commands/config.py index a36fcfc..ca0183b 100644 --- a/commands/config.py +++ b/commands/config.py @@ -1133,7 +1133,7 @@ def show_properties(config, logger): ), 1, ) - except Exception as e: + except Exception: pass except Exception as e: # logger.write(src.printcolors.printcInfo(" %s\n" % "no properties"), 1) @@ -1314,7 +1314,7 @@ def run(args, runner, logger): "\nConfig.%s of application %s:\n\n%s\n" % (od, runner.cfg.VARS.application, res) ) - except Exception as e: + except Exception: msg = "\nConfig.%s of application %s: Unknown pyconf key\n" % ( od, runner.cfg.VARS.application, @@ -1509,4 +1509,3 @@ def run(args, runner, logger): # check system prerequisites if options.check_system: check_install_system(runner.cfg, logger) - pass diff --git a/commands/install.py b/commands/install.py index 9230279..7368e04 100644 --- a/commands/install.py +++ b/commands/install.py @@ -18,8 +18,6 @@ import os import shutil -import re -import subprocess import src import prepare diff --git a/commands/jobs.py b/commands/jobs.py index 7c9347d..6b436c8 100644 --- a/commands/jobs.py +++ b/commands/jobs.py @@ -32,7 +32,6 @@ try: import paramiko except: paramiko = "import paramiko impossible" - pass import src diff --git a/commands/launcher.py b/commands/launcher.py index 35057bf..6e7f7d6 100644 --- a/commands/launcher.py +++ b/commands/launcher.py @@ -17,7 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import platform import shutil import getpass import subprocess diff --git a/commands/package.py b/commands/package.py index 383232a..7d92201 100644 --- a/commands/package.py +++ b/commands/package.py @@ -392,7 +392,7 @@ def produce_relative_launcher(config, logger, file_dir, file_name, binaries_dir_ additional_env["ABSOLUTE_APPLI_PATH"] = ( "out_dir_Path" + config.VARS.sep + app_root_dir ) - launcher_name = src.get_launcher_name(config) + src.get_launcher_name(config) additional_env["APPLI"] = "out_dir_Path" + config.VARS.sep + file_name # create an environment file writer diff --git a/commands/patch.py b/commands/patch.py index b1fe135..8b473ba 100644 --- a/commands/patch.py +++ b/commands/patch.py @@ -18,7 +18,6 @@ import os import subprocess -import re import src import prepare diff --git a/commands/prepare.py b/commands/prepare.py index 18f0428..6b64bbf 100644 --- a/commands/prepare.py +++ b/commands/prepare.py @@ -16,9 +16,7 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import re import os -import pprint as PP import src import src.debug as DBG diff --git a/commands/source.py b/commands/source.py index 8a78ee6..c674d51 100644 --- a/commands/source.py +++ b/commands/source.py @@ -18,8 +18,6 @@ import os import shutil -import re -import subprocess import src import prepare diff --git a/commands/source_update.py b/commands/source_update.py index 95e6ae1..e66a422 100644 --- a/commands/source_update.py +++ b/commands/source_update.py @@ -18,8 +18,6 @@ import os import shutil -import re -import subprocess import src import prepare diff --git a/commands/upgrade.py b/commands/upgrade.py index 7f301d7..517ad89 100644 --- a/commands/upgrade.py +++ b/commands/upgrade.py @@ -17,7 +17,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import re import subprocess import src import src.debug as DBG @@ -614,7 +613,6 @@ def upgrade_product_pip(sat, p_name_info, config, options, logger, header, len_e p_name, p_info = p_name_info res = 0 error_step = "" - pip_install_in_python = False pip_wheels_dir = os.path.join(config.LOCAL.archive_dir, "wheels") pip_install_cmd = ( config.INTERNAL.command.pip_install @@ -679,7 +677,6 @@ def upgrade_product_pip(sat, p_name_info, config, options, logger, header, len_e p_info.name, p_info.version, ) - pip_install_in_python = True else: # pip will install product in product install_dir pip_install_dir = os.path.join( @@ -939,8 +936,6 @@ def run(args, runner, logger): # Use the sorted list of all products to sort the list of products we have to upgrade sorted_product_list = [] - product_list_runtime = [] - product_list_compiletime = [] # store at beginning compile time products, we need to compile them before! for n in sorted_nodes: diff --git a/data/templates/CppSalome6/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/CppSalome6/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100644 --- a/data/templates/CppSalome6/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/CppSalome6/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/CppSalome7/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/CppSalome7/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100644 --- a/data/templates/CppSalome7/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/CppSalome7/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/CppSalome78/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/CppSalome78/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100644 --- a/data/templates/CppSalome78/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/CppSalome78/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/CppSalome8/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/CppSalome8/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100644 --- a/data/templates/CppSalome8/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/CppSalome8/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/Cpp_Template/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/Cpp_Template/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100644 --- a/data/templates/Cpp_Template/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/Cpp_Template/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/Cpp_Template_med2/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/Cpp_Template_med2/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100755 --- a/data/templates/Cpp_Template_med2/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/Cpp_Template_med2/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/Cpp_Template_stda/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py b/data/templates/Cpp_Template_stda/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py index 05414cb..c3df350 100755 --- a/data/templates/Cpp_Template_stda/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py +++ b/data/templates/Cpp_Template_stda/src/Cpp_Template_/Cpp_Template__TEST/Cpp_Template__test.py @@ -7,7 +7,6 @@ if getenv("SALOMEPATH"): else: import :sat:{Cpp_Template_}SWIG my_:sat:{Cpp_Template_}=:sat:{Cpp_Template_}SWIG.:sat:{Cpp_Template_}() -pass # # print "Test Program of :sat:{Cpp_Template_} component" diff --git a/data/templates/PythonComponent/src/Controller/Controller.py b/data/templates/PythonComponent/src/Controller/Controller.py index 81db591..7dc2e6c 100755 --- a/data/templates/PythonComponent/src/Controller/Controller.py +++ b/data/templates/PythonComponent/src/Controller/Controller.py @@ -12,7 +12,6 @@ class Controller: self._mainFrame = MainFrame self._nbPolylines = 0 self._nbCircles = 0 - pass def getModels(self): return self._models @@ -25,14 +24,12 @@ class Controller: def setNbPolylines(self, n): self._nbPolylines = n - pass def getNbCircles(self): return self._nbCircles def setNbCircles(self, n): self._nbCircles = n - pass def createPolyline(self, name, randomNumberOfPoints): """Creates a Polyline object nammed name with randomNumberOfPoints points""" @@ -47,7 +44,6 @@ class Controller: y = random.uniform(0, x) point = x, y points.append(point) - pass myPolyline = Polyline(name, points, self) self._models.append(myPolyline) @@ -68,7 +64,6 @@ class Controller: def showModel(self, model): model.updateViews(mode="showing") - pass def editName(self, model, name): model.setName(name) @@ -92,15 +87,11 @@ class Controller: def removeModel(self, model): model.updateViews(mode="supression") - index = self._models.index(model) + self._models.index(model) del model - pass def saveListOfModels(self): for model in self._models: model.save() - pass - pass -pass diff --git a/data/templates/PythonComponent/src/Dialog/CreateCircleDialog.py b/data/templates/PythonComponent/src/Dialog/CreateCircleDialog.py index 1cc1818..67f10cc 100755 --- a/data/templates/PythonComponent/src/Dialog/CreateCircleDialog.py +++ b/data/templates/PythonComponent/src/Dialog/CreateCircleDialog.py @@ -12,7 +12,6 @@ class CreateCircleDialog(Dialog): # Setting default name nbCircles = controller.getNbCircles() self.entryName.setText("circle_" + str(nbCircles + 1)) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -36,7 +35,6 @@ class CreateCircleDialog(Dialog): self.entryRadius.setValidator(floatValidator) self.entryRadius.setText("10") self.v12.addWidget(self.entryRadius) - pass def execApply(self): name = self.name @@ -51,7 +49,6 @@ class CreateCircleDialog(Dialog): self.xCenter = str(self.entryxCenter.text()) self.yCenter = str(self.entryyCenter.text()) self.radius = str(self.entryRadius.text()) - pass def checkUserEntries(self): if ( @@ -70,7 +67,5 @@ class CreateCircleDialog(Dialog): self.entryxCenter.setText("0") self.entryyCenter.setText("0") self.entryRadius.setText("10") - pass -pass diff --git a/data/templates/PythonComponent/src/Dialog/CreatePolylineDialog.py b/data/templates/PythonComponent/src/Dialog/CreatePolylineDialog.py index e09946a..e6d953c 100755 --- a/data/templates/PythonComponent/src/Dialog/CreatePolylineDialog.py +++ b/data/templates/PythonComponent/src/Dialog/CreatePolylineDialog.py @@ -12,7 +12,6 @@ class CreatePolylineDialog(Dialog): # Setting default name nbPolylines = controller.getNbPolylines() self.entryName.setText("polyline_" + str(nbPolylines + 1)) - pass def addSpecialWidgets(self): @@ -25,7 +24,6 @@ class CreatePolylineDialog(Dialog): self.entryNbPoints.setValidator(intValidator) self.entryNbPoints.setText("10") self.v12.addWidget(self.entryNbPoints) - pass def execApply(self): name = self.name @@ -37,7 +35,6 @@ class CreatePolylineDialog(Dialog): def retrieveUserEntries(self): self.name = str(self.entryName.text()) self.nbPoints = str(self.entryNbPoints.text()) - pass def checkUserEntries(self): if self.name == "" or self.nbPoints == "": @@ -52,7 +49,5 @@ class CreatePolylineDialog(Dialog): nbPolylines = self.getController().getNbPolylines() self.entryName.setText("polyline_" + str(nbPolylines + 1)) self.entryNbPoints.setText("10") - pass -pass diff --git a/data/templates/PythonComponent/src/Dialog/Dialog.py b/data/templates/PythonComponent/src/Dialog/Dialog.py index fc7eaa8..c4b8853 100755 --- a/data/templates/PythonComponent/src/Dialog/Dialog.py +++ b/data/templates/PythonComponent/src/Dialog/Dialog.py @@ -33,7 +33,6 @@ class Dialog(QDialog): # Connecting widgets to slots self.connectSlots() - pass def getController(self): return self._controller @@ -53,17 +52,14 @@ class Dialog(QDialog): self.h2.addWidget(self.bClose) self.bHelp = QPushButton("Help", self) self.h2.addWidget(self.bHelp) - pass def addSpecialWidgets(self): print("Virtual method") - pass def connectSlots(self): self.bApply.clicked.connect(self.apply) self.bHelp.clicked.connect(self.help) self.bClose.clicked.connect(self.close) - pass def apply(self): @@ -76,7 +72,6 @@ class Dialog(QDialog): def retrieveUserEntries(self): self.name = str(self.entryName.text()) - pass def checkUserEntries(self): if self.name == "": @@ -86,21 +81,16 @@ class Dialog(QDialog): def execApply(self): print("Virtual method") - pass def reInitializeDialog(self): print("Virtual method") - pass def help(self): import os os.system("firefox " + self._helpFile + "&") - pass def close(self): self._widgetDialogBox.close() - pass -pass diff --git a/data/templates/PythonComponent/src/Dialog/DialogEdit.py b/data/templates/PythonComponent/src/Dialog/DialogEdit.py index c76563b..14cce60 100755 --- a/data/templates/PythonComponent/src/Dialog/DialogEdit.py +++ b/data/templates/PythonComponent/src/Dialog/DialogEdit.py @@ -33,7 +33,6 @@ class DialogEdit(QDialog): # Connecting widgets to slots self.connectSlots() - pass def getController(self): return self._controller @@ -47,17 +46,14 @@ class DialogEdit(QDialog): self.h2.addWidget(self.bCancel) self.bHelp = QPushButton("Help", self) self.h2.addWidget(self.bHelp) - pass def addSpecialWidgets(self): print("Virtual method") - pass def connectSlots(self): self.bOk.clicked.connect(self.apply) self.bHelp.clicked.connect(self.help) self.bCancel.clicked.connect(self.close) - pass def apply(self): self.retrieveUserEntries() @@ -70,7 +66,6 @@ class DialogEdit(QDialog): def retrieveUserEntries(self): print("Virtual method") - pass def checkUserEntries(self): print("Virtual method") @@ -78,17 +73,13 @@ class DialogEdit(QDialog): def execApply(self): print("Virtual method") - pass def help(self): import os os.system("firefox " + self._helpFile + "&") - pass def close(self): self._widgetDialogBox.close() - pass -pass diff --git a/data/templates/PythonComponent/src/Dialog/EditCenterDialog.py b/data/templates/PythonComponent/src/Dialog/EditCenterDialog.py index d6a9d03..b410191 100755 --- a/data/templates/PythonComponent/src/Dialog/EditCenterDialog.py +++ b/data/templates/PythonComponent/src/Dialog/EditCenterDialog.py @@ -18,13 +18,10 @@ class EditCenterDialog(DialogEdit): while oldCenter[i] != ":": oldX += oldCenter[i] i += 1 - pass for j in range(i + 1, len(oldCenter)): oldY += oldCenter[j] - pass self.entryX.setText(oldX) self.entryY.setText(oldY) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -40,7 +37,6 @@ class EditCenterDialog(DialogEdit): self.entryY = QLineEdit(self) self.entryY.setValidator(floatValidator) self.v12.addWidget(self.entryY) - pass def execApply(self): newX = float(self.newX) @@ -52,7 +48,6 @@ class EditCenterDialog(DialogEdit): def retrieveUserEntries(self): self.newX = str(self.entryX.text()) self.newY = str(self.entryY.text()) - pass def checkUserEntries(self): if self.newX == "" or self.newY == "": @@ -61,4 +56,3 @@ class EditCenterDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent/src/Dialog/EditPointDialog.py b/data/templates/PythonComponent/src/Dialog/EditPointDialog.py index 1c83890..7936f3f 100755 --- a/data/templates/PythonComponent/src/Dialog/EditPointDialog.py +++ b/data/templates/PythonComponent/src/Dialog/EditPointDialog.py @@ -20,14 +20,11 @@ class EditPointDialog(DialogEdit): while oldPoint[i] != ":": oldX += oldPoint[i] i += 1 - pass for j in range(i + 1, len(oldPoint)): oldY += oldPoint[j] - pass self.pointRange = pointRange self.entryX.setText(oldX) self.entryY.setText(oldY) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -43,7 +40,6 @@ class EditPointDialog(DialogEdit): self.entryY = QLineEdit(self) self.entryY.setValidator(floatValidator) self.v12.addWidget(self.entryY) - pass def execApply(self): pointRange = self.pointRange @@ -56,7 +52,6 @@ class EditPointDialog(DialogEdit): def retrieveUserEntries(self): self.newX = str(self.entryX.text()) self.newY = str(self.entryY.text()) - pass def checkUserEntries(self): if self.newX == "" or self.newY == "": @@ -65,4 +60,3 @@ class EditPointDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent/src/Dialog/EditRadiusDialog.py b/data/templates/PythonComponent/src/Dialog/EditRadiusDialog.py index a9c43c8..4374704 100755 --- a/data/templates/PythonComponent/src/Dialog/EditRadiusDialog.py +++ b/data/templates/PythonComponent/src/Dialog/EditRadiusDialog.py @@ -11,7 +11,6 @@ class EditRadiusDialog(DialogEdit): self._model = model self.entryRadius.setText(oldRadius) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -21,7 +20,6 @@ class EditRadiusDialog(DialogEdit): self.entryRadius = QLineEdit(self) self.entryRadius.setValidator(floatValidator) self.v12.addWidget(self.entryRadius) - pass def execApply(self): newRadius = self.newRadius @@ -30,7 +28,6 @@ class EditRadiusDialog(DialogEdit): def retrieveUserEntries(self): self.newRadius = str(self.entryRadius.text()) - pass def checkUserEntries(self): if self.newRadius == "": @@ -39,4 +36,3 @@ class EditRadiusDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent/src/Dialog/RenameDialog.py b/data/templates/PythonComponent/src/Dialog/RenameDialog.py index 6ff291b..4347690 100755 --- a/data/templates/PythonComponent/src/Dialog/RenameDialog.py +++ b/data/templates/PythonComponent/src/Dialog/RenameDialog.py @@ -11,14 +11,12 @@ class RenameDialog(DialogEdit): self._model = model self.entryName.setText(oldName) - pass def addSpecialWidgets(self): lName = QLabel("Name", self) self.v11.addWidget(lName) self.entryName = QLineEdit(self) self.v12.addWidget(self.entryName) - pass def execApply(self): newName = self.newName @@ -27,7 +25,6 @@ class RenameDialog(DialogEdit): def retrieveUserEntries(self): self.newName = str(self.entryName.text()) - pass def checkUserEntries(self): if self.newName == "": @@ -36,4 +33,3 @@ class RenameDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent/src/Model/Circle.py b/data/templates/PythonComponent/src/Model/Circle.py index 0f252b8..89a662d 100755 --- a/data/templates/PythonComponent/src/Model/Circle.py +++ b/data/templates/PythonComponent/src/Model/Circle.py @@ -16,14 +16,12 @@ class Circle(Model): self._radius = radius self.addTreeWidgetItem(self.getName(), controller) self.addGraphicScene(controller) - pass def getCenter(self): return self._center[0], self._center[1] def setCenter(self, center): self._center = center - pass def getRadius(self): return self._radius @@ -62,4 +60,3 @@ class Circle(Model): pass -pass diff --git a/data/templates/PythonComponent/src/Model/Model.py b/data/templates/PythonComponent/src/Model/Model.py index 3861780..f47db39 100755 --- a/data/templates/PythonComponent/src/Model/Model.py +++ b/data/templates/PythonComponent/src/Model/Model.py @@ -7,14 +7,12 @@ class Model: self._name = None self._views = [] - pass def getName(self): return self._name def setName(self, name): self._name = name - pass def getViews(self): return self._views @@ -30,7 +28,5 @@ class Model: def save(self): print("Virtual method") - pass -pass diff --git a/data/templates/PythonComponent/src/Model/Polyline.py b/data/templates/PythonComponent/src/Model/Polyline.py index 810ffcb..2641dd7 100755 --- a/data/templates/PythonComponent/src/Model/Polyline.py +++ b/data/templates/PythonComponent/src/Model/Polyline.py @@ -11,18 +11,15 @@ class Polyline(Model): self._points = points self.addTreeWidgetItem(self.getName(), controller) self.addGraphicScene(controller) - pass def getPoints(self): return self._points def setPoints(self, points): self._points = points - pass def editPoint(self, pointRange, newPoint): self._points[pointRange] = newPoint - pass def addTreeWidgetItem(self, name, controller): from PolyTreeWidgetItem import PolyTreeWidgetItem @@ -39,7 +36,6 @@ class Polyline(Model): str(x) + ":" + str(y), controller, ["Edit"] ) myTreeWidgetItem.addChild(newTreeWidgetItem) - pass myTreeWidgetItem.setModel(self) self.getViews().append(myTreeWidgetItem) return myTreeWidgetItem @@ -56,4 +52,3 @@ class Polyline(Model): pass -pass diff --git a/data/templates/PythonComponent/src/PYCMP/PYCMP.py b/data/templates/PythonComponent/src/PYCMP/PYCMP.py index 51afc58..47d43f9 100755 --- a/data/templates/PythonComponent/src/PYCMP/PYCMP.py +++ b/data/templates/PythonComponent/src/PYCMP/PYCMP.py @@ -49,7 +49,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, # self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb ) # - pass """ Touch the component @@ -69,7 +68,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, attr.SetValue( name ) attr = builder.FindOrCreateAttribute( object, "AttributeLocalID" ) attr.SetValue( objectID() ) - pass """ Dump module data to the Python script. @@ -85,8 +83,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, name = iter.Value().GetName() if name: names.append( name ) iter.Next() - pass - pass if names: abuffer += [ " from batchmode_salome import lcc" ] abuffer += [ " import :sat:{PYCMP}_ORB" ] @@ -94,7 +90,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, abuffer += [ " myCompo = lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ] abuffer += [ " " ] abuffer += [ " myCompo.createObject( theStudy, '%s' )" % name for name in names ] - pass abuffer += [ " " ] abuffer.append( " pass" ) abuffer.append( "\0" ) diff --git a/data/templates/PythonComponent/src/PYCMP/PYCMP_utils.py b/data/templates/PythonComponent/src/PYCMP/PYCMP_utils.py index 56e1557..e9d9171 100755 --- a/data/templates/PythonComponent/src/PYCMP/PYCMP_utils.py +++ b/data/templates/PythonComponent/src/PYCMP/PYCMP_utils.py @@ -90,8 +90,6 @@ def verbose(): __verbose__ = int( os.getenv( 'SALOME_VERBOSE', 0 ) ) except: __verbose__ = 0 - pass - pass return __verbose__ ### @@ -102,7 +100,6 @@ def getORB(): global __orb__ if __orb__ is None: __orb__ = CORBA.ORB_init( [''], CORBA.ORB_ID ) - pass return __orb__ ### @@ -113,7 +110,6 @@ def getNS(): global __naming_service__ if __naming_service__ is None: __naming_service__ = SALOME_NamingServicePy_i( getORB() ) - pass return __naming_service__ ## @@ -124,7 +120,6 @@ def getLCC(): global __lcc__ if __lcc__ is None: __lcc__ = LifeCycleCORBA( getORB() ) - pass return __lcc__ ## @@ -136,7 +131,6 @@ def getStudyManager(): if __study_manager__ is None: obj = getNS().Resolve( '/myStudyManager' ) __study_manager__ = obj._narrow( SALOMEDS.StudyManager ) - pass return __study_manager__ ### @@ -147,7 +141,6 @@ def getEngine(): global __engine__ if __engine__ is None: __engine__ = getLCC().FindOrLoadComponent( "FactoryServerPy", moduleName() ) - pass return __engine__ ### @@ -157,7 +150,6 @@ def getEngineIOR(): IOR = "" if getORB() and getEngine(): IOR = getORB().object_to_string( getEngine() ) - pass return IOR ### @@ -176,10 +168,8 @@ def findOrCreateComponent( study ): attr.SetValue( moduleID() ) try: builder.DefineComponentInstance( father, getEngine() ) - pass except: pass - pass return father ### @@ -192,6 +182,4 @@ def getObjectID( study, entry ): if sobj is not None: test, anAttr = sobj.FindAttribute( "AttributeLocalID" ) if test: ID = anAttr._narrow( SALOMEDS.AttributeLocalID ).Value() - pass - pass return ID diff --git a/data/templates/PythonComponent/src/PYCMPGUI/PYCMPDesktop.py b/data/templates/PythonComponent/src/PYCMPGUI/PYCMPDesktop.py index dcc57f7..58940d8 100755 --- a/data/templates/PythonComponent/src/PYCMPGUI/PYCMPDesktop.py +++ b/data/templates/PythonComponent/src/PYCMPGUI/PYCMPDesktop.py @@ -25,7 +25,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self.createTreeView() self.createGraphicsView() - pass def createTreeView( self ) : self._globalTree= TreeWidget( self ) @@ -35,19 +34,16 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._dockGlobalTree.setAllowedAreas( Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea ) self._dockGlobalTree.setWidget( self._globalTree ) self._sgDesktop.addDockWidget( Qt.LeftDockWidgetArea, self._dockGlobalTree ) - pass def createGraphicsView( self ) : scene = GraphicsScene( self._controller ) self._globalGraphicsView = GraphicsView( scene ) self._globalGraphicsViewID = self._sgPyQt.createView( "ViewCurve", self._globalGraphicsView ) - pass def createActions( self ) : self.createPolylineAction = self._sgPyQt.createAction( self._polylineID, "Polyline", "Create Polyline", "Show Polyline dialog box", "ExecPolyline.png" ) self.createCircleAction = self._sgPyQt.createAction( self._circleID, "Circle", "Create Circle", "Show Circle dialog box", "ExecCircle.png" ) self.deleteAllAction = self._sgPyQt.createAction( self._deleteAllID, "Delete all", "Delete all", "Delete all objects", "ExecDelAll.png" ) - pass def createMenus( self ) : curveMenu = self._sgPyQt.createMenu( " Curve", -1, self._curveMenuID, self._sgPyQt.defaultMenuGroup() ) @@ -56,7 +52,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._sgPyQt.createMenu( self.createPolylineAction, curveMenu ) self._sgPyQt.createMenu( self.createCircleAction, curveMenu ) self._sgPyQt.createMenu( self.deleteAllAction, advancedMenu ) - pass def createToolBars( self ) : createPolylineTB = self._sgPyQt.createTool("New polyline") @@ -66,7 +61,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._sgPyQt.createTool( self.createPolylineAction, createPolylineTB ) self._sgPyQt.createTool( self.createCircleAction, createCircleTB ) self._sgPyQt.createTool( self.deleteAllAction, deleteAllTB ) - pass def createPopups( self ) : pass @@ -76,7 +70,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : def setController( self, controller ) : self._controller = controller - pass def getGlobalTree( self ) : return self._globalTree @@ -96,6 +89,4 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : #Resizing the globalGraphicView sceneRect = scene.getRect() self._globalGraphicsView.fitInView ( sceneRect, Qt.KeepAspectRatio ) - pass -pass diff --git a/data/templates/PythonComponent/src/PYCMPGUI/PYCMPGUI.py b/data/templates/PythonComponent/src/PYCMPGUI/PYCMPGUI.py index eaa0e49..af63177 100755 --- a/data/templates/PythonComponent/src/PYCMPGUI/PYCMPGUI.py +++ b/data/templates/PythonComponent/src/PYCMPGUI/PYCMPGUI.py @@ -79,7 +79,6 @@ def setDesktop( ): moduleDesktop = :sat:{PYCMP}Desktop( sgPyQt, sg ) objectsManager = Controller( moduleDesktop ) moduleDesktop.setController( objectsManager ) - pass return moduleDesktop def incObjToMap( m, id ): @@ -87,7 +86,6 @@ def incObjToMap( m, id ): if id not in m: m[id] = 0 m[id] += 1 - pass def getSelection(): """This method analyses selection""" @@ -96,7 +94,6 @@ def getSelection(): seltypes = {} for i in range( selcount ): incObjToMap( seltypes, getObjectID( sg.getSelected( i ) ) ) - pass return selcount, seltypes ################################################ @@ -106,7 +103,6 @@ def getSelection(): def initialize(): """This method is called when module is initialized. It performs initialization actions""" setDesktop() - pass def windows(): """This method is called when module is initialized. It returns a map of popup windows to be used by the module""" @@ -122,7 +118,6 @@ def views(): def createPreferences(): """This method is called when module is initialized. It exports module preferences""" - pass def activate(): """This method is called when module is initialized. It returns True if activating is successfull, False otherwise""" @@ -141,7 +136,6 @@ def activate(): def viewTryClose( wid ): sgPyQt.setViewClosable(wid, True) - pass def deactivate(): """This method is called when module is deactivated""" @@ -152,41 +146,32 @@ def deactivate(): moduleDesktop.getDockGlobalTree().hide() moduleDesktop.updateGlobalGraphicsView( None ) moduleDesktop.getGlobalGraphicsView().hide() - pass def activeStudyChanged(): """This method is called when active study is changed""" setDesktop() - pass def createPopupMenu( popup, context ): """This method is called when popup menu is invocked""" - pass def OnGUIEvent( commandID ): """This method is called when a GUI action is activated""" if commandID in dict_command: dict_command[commandID]() - pass - pass def preferenceChanged( section, setting ): """This method is called when module's preferences are changed""" - pass def activeViewChanged( viewID ): """This method is called when active view is changed""" - pass def viewCloned( viewID ): """This method is called when active view is cloned""" - pass def viewClosed( viewID ): """This method is called when active view viewClosed""" - pass def engineIOR(): """This method is called when study is opened. It returns engine IOR""" @@ -206,7 +191,6 @@ def showCreatePolylineDialog() : widgetDialogBox.setWidget( myDialog ) widgetDialogBox.setWindowTitle( "Polyline definition" ) sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def showCreateCircleDialog() : from CreateCircleDialog import CreateCircleDialog @@ -217,7 +201,6 @@ def showCreateCircleDialog() : widgetDialogBox.setWidget( myDialog ) widgetDialogBox.setWindowTitle( "Circle definition" ) sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def deleteAll() : models = moduleDesktop.getController().getModels() @@ -226,9 +209,6 @@ def deleteAll() : if answer == QMessageBox.Yes : for model in models : moduleDesktop.getController().removeModel( model ) - pass - pass - pass ######################################################## # Commands dictionary diff --git a/data/templates/PythonComponent/src/StandAlone/Desktop.py b/data/templates/PythonComponent/src/StandAlone/Desktop.py index be011f9..4a85a87 100755 --- a/data/templates/PythonComponent/src/StandAlone/Desktop.py +++ b/data/templates/PythonComponent/src/StandAlone/Desktop.py @@ -33,14 +33,12 @@ class Desktop(QMainWindow): # Creating menus and toolbars self.createMenus() self.createToolBars() - pass def getController(self): return self._controller def setController(self, controller): self._controller = controller - pass def getGlobalTree(self): return self._globalTree @@ -61,7 +59,6 @@ class Desktop(QMainWindow): createPolylineAction.triggered.connect(self.showCreatePolylineDialog) createCircleAction.triggered.connect(self.showCreateCircleDialog) deleteAllAction.triggered.connect(self.deleteAll) - pass def createToolBars(self): # Creating toolBars @@ -75,7 +72,6 @@ class Desktop(QMainWindow): # Connecting slots createPolylineAction.triggered.connect(self.showCreatePolylineDialog) createCircleAction.triggered.connect(self.showCreateCircleDialog) - pass def showCreatePolylineDialog(self): from CreatePolylineDialog import CreatePolylineDialog @@ -88,7 +84,6 @@ class Desktop(QMainWindow): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Polyline definition") self.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def showCreateCircleDialog(self): from CreateCircleDialog import CreateCircleDialog @@ -99,7 +94,6 @@ class Desktop(QMainWindow): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Polyline definition") self.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def deleteAll(self): models = self.getController().getModels() @@ -114,9 +108,6 @@ class Desktop(QMainWindow): if answer == QMessageBox.Yes: for model in models: self.getController().removeModel(model) - pass - pass - pass def updateGlobalGraphicsView(self, scene): self._globalGraphicsView.setScene(scene) @@ -133,7 +124,5 @@ class Desktop(QMainWindow): topLeft.x(), topLeft.y(), 2 * sceneRect.width(), 2 * sceneRect.height() ) self._globalGraphicsView.fitInView(viewRect, Qt.IgnoreAspectRatio) - pass -pass diff --git a/data/templates/PythonComponent/src/StandAlone/StandalonePYCMPGUI.py b/data/templates/PythonComponent/src/StandAlone/StandalonePYCMPGUI.py index 0712e48..b1e860a 100755 --- a/data/templates/PythonComponent/src/StandAlone/StandalonePYCMPGUI.py +++ b/data/templates/PythonComponent/src/StandAlone/StandalonePYCMPGUI.py @@ -19,4 +19,3 @@ def main(args): if __name__ == "__main__": main(sys.argv) - pass diff --git a/data/templates/PythonComponent/src/View/CircleGraphicsScene.py b/data/templates/PythonComponent/src/View/CircleGraphicsScene.py index edc3a3c..fceb280 100755 --- a/data/templates/PythonComponent/src/View/CircleGraphicsScene.py +++ b/data/templates/PythonComponent/src/View/CircleGraphicsScene.py @@ -6,11 +6,10 @@ from GraphicsRectItem import GraphicsRectItem class CircleGraphicsScene(GraphicsScene): def __init__(self, controller): GraphicsScene.__init__(self, controller) - pass def draw(self): - import math + pass center = self._model.getCenter() radius = float(self._model.getRadius()) @@ -25,7 +24,5 @@ class CircleGraphicsScene(GraphicsScene): circleItem = QGraphicsEllipseItem() circleItem.setRect(rect) self.addItem(circleItem) - pass -pass diff --git a/data/templates/PythonComponent/src/View/CircleTreeWidgetItem.py b/data/templates/PythonComponent/src/View/CircleTreeWidgetItem.py index 59d4aee..2227efb 100755 --- a/data/templates/PythonComponent/src/View/CircleTreeWidgetItem.py +++ b/data/templates/PythonComponent/src/View/CircleTreeWidgetItem.py @@ -8,7 +8,6 @@ class CircleTreeWidgetItem(TreeWidgetItem): """Constructor""" TreeWidgetItem.__init__(self, name, controller, actionsList) - pass def editInGlobalTree(self, treeWidgetItem): name = self.getModel().getName() @@ -22,7 +21,5 @@ class CircleTreeWidgetItem(TreeWidgetItem): radius = self._model.getRadius() relatedItem = treeWidgetItem.child(1) relatedItem.setText(0, str(radius)) - pass -pass diff --git a/data/templates/PythonComponent/src/View/GraphicsRectItem.py b/data/templates/PythonComponent/src/View/GraphicsRectItem.py index 449d2c0..04e0200 100755 --- a/data/templates/PythonComponent/src/View/GraphicsRectItem.py +++ b/data/templates/PythonComponent/src/View/GraphicsRectItem.py @@ -7,10 +7,8 @@ class GraphicsRectItem(QGraphicsRectItem): self._index = index self.setFlag(self.ItemIsMovable, True) self.setFlag(self.ItemIsSelectable, True) - pass def getIndex(self): return self._index -pass diff --git a/data/templates/PythonComponent/src/View/GraphicsScene.py b/data/templates/PythonComponent/src/View/GraphicsScene.py index 42723d4..1d5f1f7 100755 --- a/data/templates/PythonComponent/src/View/GraphicsScene.py +++ b/data/templates/PythonComponent/src/View/GraphicsScene.py @@ -8,7 +8,6 @@ class GraphicsScene(View, QGraphicsScene): View.__init__(self, controller) QGraphicsScene.__init__(self) - pass def getRect(self): rect = QRectF(0, 0, self.width(), self.height()) @@ -17,52 +16,40 @@ class GraphicsScene(View, QGraphicsScene): def editPoint(self, oldPoint, newPoint): polyline = self.getModel() self.getController().editPoint(polyline, oldPoint, newPoint) - pass def editCenter(self, center): circle = self.getModel() self.getController().editCenter(circle, center) - pass def editRadius(self, radius): circle = self.getModel() self.getController().editRadius(circle, radius) - pass def update(self, mode): if mode == "creation": self.showInGlobalGraphicsView() - pass elif mode == "showing": self.showInGlobalGraphicsView() elif mode == "modification": self.undraw() self.showInGlobalGraphicsView() - pass elif mode == "supression": self.removeFromGlobalGraphicsView() - pass else: return def showInGlobalGraphicsView(self): self.draw() self.getController().getMainFrame().updateGlobalGraphicsView(self) - pass def removeFromGlobalGraphicsView(self): self.getController().getMainFrame().updateGlobalGraphicsView(None) - pass def draw(self): print("Virtual method") - pass def undraw(self): for item in self.items(): self.removeItem(item) - pass - pass -pass diff --git a/data/templates/PythonComponent/src/View/GraphicsView.py b/data/templates/PythonComponent/src/View/GraphicsView.py index 24a394e..72a7a32 100755 --- a/data/templates/PythonComponent/src/View/GraphicsView.py +++ b/data/templates/PythonComponent/src/View/GraphicsView.py @@ -14,21 +14,18 @@ class GraphicsView(QGraphicsView): self._selectedItem = None self.moved[QPointF].connect(self.execMouseMoveEvent) self.released[QPointF].connect(self.execMouseReleaseEvent) - pass def mousePressEvent(self, mouseEvent): QGraphicsView.mousePressEvent(self, mouseEvent) if self.scene() is None: return self._selectedItem = self.scene().mouseGrabberItem() - pass def mouseMoveEvent(self, mouseEvent): QGraphicsView.mouseMoveEvent(self, mouseEvent) pt = mouseEvent.pos() currentPos = self.mapToScene(pt) self.moved.emit(currentPos) - pass def mouseReleaseEvent(self, mouseEvent): QGraphicsView.mouseReleaseEvent(self, mouseEvent) @@ -37,8 +34,6 @@ class GraphicsView(QGraphicsView): newPos = self.mapToScene(pt) self.released.emit(newPos) self._selectedItem = None - pass - pass def execMouseMoveEvent(self, currentPos): if self._selectedItem is None: @@ -46,7 +41,7 @@ class GraphicsView(QGraphicsView): selectedIndex = self._selectedItem.getIndex() newX = currentPos.x() newY = currentPos.y() - newPoint = newX, newY + newX, newY model = self.scene().getModel() pen = QPen(QColor("red")) if isinstance(model, Polyline): @@ -56,13 +51,11 @@ class GraphicsView(QGraphicsView): xNext = nextPoint[0] yNext = nextPoint[1] self.scene().addLine(newX, newY, xNext, yNext, pen) - pass elif selectedIndex == len(model.getPoints()) - 1: previousPoint = model.getPoints()[selectedIndex - 1] xPrevious = previousPoint[0] yPrevious = previousPoint[1] self.scene().addLine(xPrevious, yPrevious, newX, newY, pen) - pass else: previousPoint = model.getPoints()[selectedIndex - 1] xPrevious = previousPoint[0] @@ -72,8 +65,6 @@ class GraphicsView(QGraphicsView): xNext = nextPoint[0] yNext = nextPoint[1] self.scene().addLine(newX, newY, xNext, yNext, pen) - pass - pass elif isinstance(model, Circle): # Previsualisation radius = float(model.getRadius()) @@ -82,8 +73,6 @@ class GraphicsView(QGraphicsView): circleItem.setPen(pen) circleItem.setRect(rect) self.scene().addItem(circleItem) - pass - pass def execMouseReleaseEvent(self, newPos): if self._selectedItem is None: @@ -95,11 +84,7 @@ class GraphicsView(QGraphicsView): model = self.scene().getModel() if isinstance(model, Polyline): self.scene().getController().editPoint(model, newPoint, selectedIndex) - pass elif isinstance(model, Circle): self.scene().getController().editCenter(model, newPoint) - pass - pass -pass diff --git a/data/templates/PythonComponent/src/View/Menu.py b/data/templates/PythonComponent/src/View/Menu.py index 87a912e..edf7a27 100755 --- a/data/templates/PythonComponent/src/View/Menu.py +++ b/data/templates/PythonComponent/src/View/Menu.py @@ -7,10 +7,8 @@ class Menu(QMenu): QMenu.__init__(self) self._item = item - pass def getItem(self): return self._item -pass diff --git a/data/templates/PythonComponent/src/View/PolyGraphicsScene.py b/data/templates/PythonComponent/src/View/PolyGraphicsScene.py index c68fc67..3d29eca 100755 --- a/data/templates/PythonComponent/src/View/PolyGraphicsScene.py +++ b/data/templates/PythonComponent/src/View/PolyGraphicsScene.py @@ -6,7 +6,6 @@ from GraphicsRectItem import GraphicsRectItem class PolyGraphicsScene(GraphicsScene): def __init__(self, controller): GraphicsScene.__init__(self, controller) - pass def draw(self): points = self.getModel().getPoints() @@ -19,7 +18,6 @@ class PolyGraphicsScene(GraphicsScene): # Constructing a rectangle centered on point pointItem = GraphicsRectItem(xPoint - 0.1, yPoint - 0.1, 0.2, 0.2, i) self.addItem(pointItem) - pass # Linking the points with lines for i in range(len(points) - 1): @@ -33,8 +31,5 @@ class PolyGraphicsScene(GraphicsScene): lineItem = QGraphicsLineItem() lineItem.setLine(line) self.addItem(lineItem) - pass - pass -pass diff --git a/data/templates/PythonComponent/src/View/PolyTreeWidgetItem.py b/data/templates/PythonComponent/src/View/PolyTreeWidgetItem.py index 8369f90..a15b0db 100755 --- a/data/templates/PythonComponent/src/View/PolyTreeWidgetItem.py +++ b/data/templates/PythonComponent/src/View/PolyTreeWidgetItem.py @@ -8,7 +8,6 @@ class PolyTreeWidgetItem(TreeWidgetItem): """Constructor""" TreeWidgetItem.__init__(self, name, controller, actionsList) - pass def editInGlobalTree(self, treeWidgetItem): name = self.getModel().getName() @@ -21,8 +20,5 @@ class PolyTreeWidgetItem(TreeWidgetItem): yPoint = point[1] relatedItem = treeWidgetItem.child(i) relatedItem.setText(0, str(xPoint) + ":" + str(yPoint)) - pass - pass -pass diff --git a/data/templates/PythonComponent/src/View/TreeWidget.py b/data/templates/PythonComponent/src/View/TreeWidget.py index 1cd30c5..ea4b440 100755 --- a/data/templates/PythonComponent/src/View/TreeWidget.py +++ b/data/templates/PythonComponent/src/View/TreeWidget.py @@ -30,7 +30,6 @@ class TreeWidget(QTreeWidget): # Creating popup menu self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested[QPoint].connect(self.createPopups) - pass def createPopups(self, point): item = self.itemAt(point) @@ -40,25 +39,18 @@ class TreeWidget(QTreeWidget): for action in item.getActionsList(): if action == "Show": self.menu.addAction(action).triggered.connect(self.show) - pass elif action == "Rename": self.menu.addAction(action).triggered.connect(self.showRenameDialog) - pass elif action == "Delete": self.menu.addAction(action).triggered.connect(self.delete) - pass else: self.menu.addAction(action).triggered.connect(self.showEditDialog) - pass - pass self.menu.exec_(QCursor.pos()) - pass def show(self): model = self.menu.getItem().getModel() controller = self._desktop.getController() controller.showModel(model) - pass def showRenameDialog(self): model = self.menu.getItem().getModel() @@ -75,7 +67,6 @@ class TreeWidget(QTreeWidget): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Object renaming") sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def delete(self): answer = QMessageBox.question( @@ -88,8 +79,6 @@ class TreeWidget(QTreeWidget): model = self.menu.getItem().getModel() controller = self._desktop.getController() controller.removeModel(model) - pass - pass def showEditDialog(self): item = self.menu.getItem() @@ -107,7 +96,6 @@ class TreeWidget(QTreeWidget): oldPoint, pointRange, ) - pass elif isinstance(parentModel, Circle): selectedRange = parentItem.indexOfChild(item) oldSelected = item.text(0) @@ -129,7 +117,6 @@ class TreeWidget(QTreeWidget): ) else: pass - pass else: pass @@ -137,7 +124,5 @@ class TreeWidget(QTreeWidget): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Object edition") sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass -pass diff --git a/data/templates/PythonComponent/src/View/TreeWidgetItem.py b/data/templates/PythonComponent/src/View/TreeWidgetItem.py index e70758b..81fcc31 100755 --- a/data/templates/PythonComponent/src/View/TreeWidgetItem.py +++ b/data/templates/PythonComponent/src/View/TreeWidgetItem.py @@ -10,7 +10,6 @@ class TreeWidgetItem(View, QTreeWidgetItem): self._name = [name] QTreeWidgetItem.__init__(self, self._name) self._actionsList = actionsList - pass def getActionsList(self): return self._actionsList @@ -18,39 +17,30 @@ class TreeWidgetItem(View, QTreeWidgetItem): def editCenter(self, center): circle = self.getModel() self.getController().editCenter(circle, center) - pass def editRadius(self, radius): circle = self.getModel() self.getController().editRadius(circle, radius) - pass def update(self, mode): if mode == "creation": self.addToGlobalTree(self) - pass elif mode == "modification": self.editInGlobalTree(self) - pass elif mode == "supression": self.removeFromGlobalTree(self) - pass else: return def addToGlobalTree(self, treeWidgetItem): globalTree = self.getController().getMainFrame().getGlobalTree() globalTree.addTopLevelItem(treeWidgetItem) - pass def editInGlobalTree(self, treeWidgetItem): print("Virtual") - pass def removeFromGlobalTree(self, treeWidgetItem): globalTree = self.getController().getMainFrame().getGlobalTree() globalTree.takeTopLevelItem(globalTree.indexOfTopLevelItem(treeWidgetItem)) - pass -pass diff --git a/data/templates/PythonComponent/src/View/View.py b/data/templates/PythonComponent/src/View/View.py index 0f22580..2a1d2d5 100755 --- a/data/templates/PythonComponent/src/View/View.py +++ b/data/templates/PythonComponent/src/View/View.py @@ -4,30 +4,24 @@ class View: self._model = None self._controller = controller - pass def getModel(self): return self._model def setModel(self, model): self._model = model - pass def getController(self): return self._controller def setController(self, controller): self._controller = controller - pass def editName(self, name): model = self.getModel() self._controller.editName(model, name) - pass def update(self, mode): print("Virtual method") - pass -pass diff --git a/data/templates/PythonComponent8/src/Controller/Controller.py b/data/templates/PythonComponent8/src/Controller/Controller.py index 81db591..7dc2e6c 100755 --- a/data/templates/PythonComponent8/src/Controller/Controller.py +++ b/data/templates/PythonComponent8/src/Controller/Controller.py @@ -12,7 +12,6 @@ class Controller: self._mainFrame = MainFrame self._nbPolylines = 0 self._nbCircles = 0 - pass def getModels(self): return self._models @@ -25,14 +24,12 @@ class Controller: def setNbPolylines(self, n): self._nbPolylines = n - pass def getNbCircles(self): return self._nbCircles def setNbCircles(self, n): self._nbCircles = n - pass def createPolyline(self, name, randomNumberOfPoints): """Creates a Polyline object nammed name with randomNumberOfPoints points""" @@ -47,7 +44,6 @@ class Controller: y = random.uniform(0, x) point = x, y points.append(point) - pass myPolyline = Polyline(name, points, self) self._models.append(myPolyline) @@ -68,7 +64,6 @@ class Controller: def showModel(self, model): model.updateViews(mode="showing") - pass def editName(self, model, name): model.setName(name) @@ -92,15 +87,11 @@ class Controller: def removeModel(self, model): model.updateViews(mode="supression") - index = self._models.index(model) + self._models.index(model) del model - pass def saveListOfModels(self): for model in self._models: model.save() - pass - pass -pass diff --git a/data/templates/PythonComponent8/src/Dialog/CreateCircleDialog.py b/data/templates/PythonComponent8/src/Dialog/CreateCircleDialog.py index 1cc1818..67f10cc 100755 --- a/data/templates/PythonComponent8/src/Dialog/CreateCircleDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/CreateCircleDialog.py @@ -12,7 +12,6 @@ class CreateCircleDialog(Dialog): # Setting default name nbCircles = controller.getNbCircles() self.entryName.setText("circle_" + str(nbCircles + 1)) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -36,7 +35,6 @@ class CreateCircleDialog(Dialog): self.entryRadius.setValidator(floatValidator) self.entryRadius.setText("10") self.v12.addWidget(self.entryRadius) - pass def execApply(self): name = self.name @@ -51,7 +49,6 @@ class CreateCircleDialog(Dialog): self.xCenter = str(self.entryxCenter.text()) self.yCenter = str(self.entryyCenter.text()) self.radius = str(self.entryRadius.text()) - pass def checkUserEntries(self): if ( @@ -70,7 +67,5 @@ class CreateCircleDialog(Dialog): self.entryxCenter.setText("0") self.entryyCenter.setText("0") self.entryRadius.setText("10") - pass -pass diff --git a/data/templates/PythonComponent8/src/Dialog/CreatePolylineDialog.py b/data/templates/PythonComponent8/src/Dialog/CreatePolylineDialog.py index e09946a..e6d953c 100755 --- a/data/templates/PythonComponent8/src/Dialog/CreatePolylineDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/CreatePolylineDialog.py @@ -12,7 +12,6 @@ class CreatePolylineDialog(Dialog): # Setting default name nbPolylines = controller.getNbPolylines() self.entryName.setText("polyline_" + str(nbPolylines + 1)) - pass def addSpecialWidgets(self): @@ -25,7 +24,6 @@ class CreatePolylineDialog(Dialog): self.entryNbPoints.setValidator(intValidator) self.entryNbPoints.setText("10") self.v12.addWidget(self.entryNbPoints) - pass def execApply(self): name = self.name @@ -37,7 +35,6 @@ class CreatePolylineDialog(Dialog): def retrieveUserEntries(self): self.name = str(self.entryName.text()) self.nbPoints = str(self.entryNbPoints.text()) - pass def checkUserEntries(self): if self.name == "" or self.nbPoints == "": @@ -52,7 +49,5 @@ class CreatePolylineDialog(Dialog): nbPolylines = self.getController().getNbPolylines() self.entryName.setText("polyline_" + str(nbPolylines + 1)) self.entryNbPoints.setText("10") - pass -pass diff --git a/data/templates/PythonComponent8/src/Dialog/Dialog.py b/data/templates/PythonComponent8/src/Dialog/Dialog.py index 0feb345..643ea15 100755 --- a/data/templates/PythonComponent8/src/Dialog/Dialog.py +++ b/data/templates/PythonComponent8/src/Dialog/Dialog.py @@ -33,7 +33,6 @@ class Dialog( QDialog ) : # Connecting widgets to slots self.connectSlots() - pass def getController( self ) : return self._controller @@ -53,17 +52,14 @@ class Dialog( QDialog ) : self.h2.addWidget( self.bClose ) self.bHelp = QPushButton( "Help", self ) self.h2.addWidget( self.bHelp ) - pass def addSpecialWidgets( self ) : print 'Virtual method' - pass def connectSlots( self ) : self.bApply.clicked.connect(self.apply) self.bHelp.clicked.connect(self.help) self.bClose.clicked.connect(self.close) - pass def apply( self ) : @@ -76,7 +72,6 @@ class Dialog( QDialog ) : def retrieveUserEntries( self ) : self.name = str( self.entryName.text() ) - pass def checkUserEntries( self ) : if self.name == "" : @@ -86,19 +81,14 @@ class Dialog( QDialog ) : def execApply( self ) : print 'Virtual method' - pass def reInitializeDialog( self ) : print 'Virtual method' - pass def help( self ) : import os os.system( 'firefox ' + self._helpFile + '&' ) - pass def close( self ) : self._widgetDialogBox.close() - pass -pass diff --git a/data/templates/PythonComponent8/src/Dialog/DialogEdit.py b/data/templates/PythonComponent8/src/Dialog/DialogEdit.py index 0d2d884..c81adfd 100755 --- a/data/templates/PythonComponent8/src/Dialog/DialogEdit.py +++ b/data/templates/PythonComponent8/src/Dialog/DialogEdit.py @@ -33,7 +33,6 @@ class DialogEdit( QDialog ) : # Connecting widgets to slots self.connectSlots() - pass def getController( self ) : return self._controller @@ -47,17 +46,14 @@ class DialogEdit( QDialog ) : self.h2.addWidget( self.bCancel ) self.bHelp = QPushButton( "Help", self ) self.h2.addWidget( self.bHelp ) - pass def addSpecialWidgets( self ) : print 'Virtual method' - pass def connectSlots( self ) : self.bOk.clicked.connect(self.apply) self.bHelp.clicked.connect(self.help) self.bCancel.clicked.connect(self.close) - pass def apply( self ) : self.retrieveUserEntries() @@ -70,7 +66,6 @@ class DialogEdit( QDialog ) : def retrieveUserEntries( self ) : print 'Virtual method' - pass def checkUserEntries( self ) : print 'Virtual method' @@ -78,15 +73,11 @@ class DialogEdit( QDialog ) : def execApply( self ) : print 'Virtual method' - pass def help( self ) : import os os.system( 'firefox ' + self._helpFile + '&' ) - pass def close( self ) : self._widgetDialogBox.close() - pass -pass diff --git a/data/templates/PythonComponent8/src/Dialog/EditCenterDialog.py b/data/templates/PythonComponent8/src/Dialog/EditCenterDialog.py index d6a9d03..b410191 100755 --- a/data/templates/PythonComponent8/src/Dialog/EditCenterDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/EditCenterDialog.py @@ -18,13 +18,10 @@ class EditCenterDialog(DialogEdit): while oldCenter[i] != ":": oldX += oldCenter[i] i += 1 - pass for j in range(i + 1, len(oldCenter)): oldY += oldCenter[j] - pass self.entryX.setText(oldX) self.entryY.setText(oldY) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -40,7 +37,6 @@ class EditCenterDialog(DialogEdit): self.entryY = QLineEdit(self) self.entryY.setValidator(floatValidator) self.v12.addWidget(self.entryY) - pass def execApply(self): newX = float(self.newX) @@ -52,7 +48,6 @@ class EditCenterDialog(DialogEdit): def retrieveUserEntries(self): self.newX = str(self.entryX.text()) self.newY = str(self.entryY.text()) - pass def checkUserEntries(self): if self.newX == "" or self.newY == "": @@ -61,4 +56,3 @@ class EditCenterDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent8/src/Dialog/EditPointDialog.py b/data/templates/PythonComponent8/src/Dialog/EditPointDialog.py index 1c83890..7936f3f 100755 --- a/data/templates/PythonComponent8/src/Dialog/EditPointDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/EditPointDialog.py @@ -20,14 +20,11 @@ class EditPointDialog(DialogEdit): while oldPoint[i] != ":": oldX += oldPoint[i] i += 1 - pass for j in range(i + 1, len(oldPoint)): oldY += oldPoint[j] - pass self.pointRange = pointRange self.entryX.setText(oldX) self.entryY.setText(oldY) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -43,7 +40,6 @@ class EditPointDialog(DialogEdit): self.entryY = QLineEdit(self) self.entryY.setValidator(floatValidator) self.v12.addWidget(self.entryY) - pass def execApply(self): pointRange = self.pointRange @@ -56,7 +52,6 @@ class EditPointDialog(DialogEdit): def retrieveUserEntries(self): self.newX = str(self.entryX.text()) self.newY = str(self.entryY.text()) - pass def checkUserEntries(self): if self.newX == "" or self.newY == "": @@ -65,4 +60,3 @@ class EditPointDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent8/src/Dialog/EditRadiusDialog.py b/data/templates/PythonComponent8/src/Dialog/EditRadiusDialog.py index a9c43c8..4374704 100755 --- a/data/templates/PythonComponent8/src/Dialog/EditRadiusDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/EditRadiusDialog.py @@ -11,7 +11,6 @@ class EditRadiusDialog(DialogEdit): self._model = model self.entryRadius.setText(oldRadius) - pass def addSpecialWidgets(self): floatValidator = QDoubleValidator(self) @@ -21,7 +20,6 @@ class EditRadiusDialog(DialogEdit): self.entryRadius = QLineEdit(self) self.entryRadius.setValidator(floatValidator) self.v12.addWidget(self.entryRadius) - pass def execApply(self): newRadius = self.newRadius @@ -30,7 +28,6 @@ class EditRadiusDialog(DialogEdit): def retrieveUserEntries(self): self.newRadius = str(self.entryRadius.text()) - pass def checkUserEntries(self): if self.newRadius == "": @@ -39,4 +36,3 @@ class EditRadiusDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent8/src/Dialog/RenameDialog.py b/data/templates/PythonComponent8/src/Dialog/RenameDialog.py index 6ff291b..4347690 100755 --- a/data/templates/PythonComponent8/src/Dialog/RenameDialog.py +++ b/data/templates/PythonComponent8/src/Dialog/RenameDialog.py @@ -11,14 +11,12 @@ class RenameDialog(DialogEdit): self._model = model self.entryName.setText(oldName) - pass def addSpecialWidgets(self): lName = QLabel("Name", self) self.v11.addWidget(lName) self.entryName = QLineEdit(self) self.v12.addWidget(self.entryName) - pass def execApply(self): newName = self.newName @@ -27,7 +25,6 @@ class RenameDialog(DialogEdit): def retrieveUserEntries(self): self.newName = str(self.entryName.text()) - pass def checkUserEntries(self): if self.newName == "": @@ -36,4 +33,3 @@ class RenameDialog(DialogEdit): return True -pass diff --git a/data/templates/PythonComponent8/src/Model/Circle.py b/data/templates/PythonComponent8/src/Model/Circle.py index 0f252b8..89a662d 100755 --- a/data/templates/PythonComponent8/src/Model/Circle.py +++ b/data/templates/PythonComponent8/src/Model/Circle.py @@ -16,14 +16,12 @@ class Circle(Model): self._radius = radius self.addTreeWidgetItem(self.getName(), controller) self.addGraphicScene(controller) - pass def getCenter(self): return self._center[0], self._center[1] def setCenter(self, center): self._center = center - pass def getRadius(self): return self._radius @@ -62,4 +60,3 @@ class Circle(Model): pass -pass diff --git a/data/templates/PythonComponent8/src/Model/Model.py b/data/templates/PythonComponent8/src/Model/Model.py index 7b5d4e9..87564d0 100755 --- a/data/templates/PythonComponent8/src/Model/Model.py +++ b/data/templates/PythonComponent8/src/Model/Model.py @@ -7,14 +7,12 @@ class Model: self._name = None self._views = [] - pass def getName( self ): return self._name def setName( self, name ): self._name = name - pass def getViews( self ) : return self._views @@ -29,6 +27,4 @@ class Model: def save( self ) : print 'Virtual method' - pass -pass diff --git a/data/templates/PythonComponent8/src/Model/Polyline.py b/data/templates/PythonComponent8/src/Model/Polyline.py index 810ffcb..2641dd7 100755 --- a/data/templates/PythonComponent8/src/Model/Polyline.py +++ b/data/templates/PythonComponent8/src/Model/Polyline.py @@ -11,18 +11,15 @@ class Polyline(Model): self._points = points self.addTreeWidgetItem(self.getName(), controller) self.addGraphicScene(controller) - pass def getPoints(self): return self._points def setPoints(self, points): self._points = points - pass def editPoint(self, pointRange, newPoint): self._points[pointRange] = newPoint - pass def addTreeWidgetItem(self, name, controller): from PolyTreeWidgetItem import PolyTreeWidgetItem @@ -39,7 +36,6 @@ class Polyline(Model): str(x) + ":" + str(y), controller, ["Edit"] ) myTreeWidgetItem.addChild(newTreeWidgetItem) - pass myTreeWidgetItem.setModel(self) self.getViews().append(myTreeWidgetItem) return myTreeWidgetItem @@ -56,4 +52,3 @@ class Polyline(Model): pass -pass diff --git a/data/templates/PythonComponent8/src/PYCMP/PYCMP.py b/data/templates/PythonComponent8/src/PYCMP/PYCMP.py index 51afc58..47d43f9 100755 --- a/data/templates/PythonComponent8/src/PYCMP/PYCMP.py +++ b/data/templates/PythonComponent8/src/PYCMP/PYCMP.py @@ -49,7 +49,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, # self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb ) # - pass """ Touch the component @@ -69,7 +68,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, attr.SetValue( name ) attr = builder.FindOrCreateAttribute( object, "AttributeLocalID" ) attr.SetValue( objectID() ) - pass """ Dump module data to the Python script. @@ -85,8 +83,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, name = iter.Value().GetName() if name: names.append( name ) iter.Next() - pass - pass if names: abuffer += [ " from batchmode_salome import lcc" ] abuffer += [ " import :sat:{PYCMP}_ORB" ] @@ -94,7 +90,6 @@ class :sat:{PYCMP}(:sat:{PYCMP}_ORB__POA.:sat:{PYCMP}_Gen, abuffer += [ " myCompo = lcc.FindOrLoadComponent( 'FactoryServerPy', '%s' )" % moduleName() ] abuffer += [ " " ] abuffer += [ " myCompo.createObject( theStudy, '%s' )" % name for name in names ] - pass abuffer += [ " " ] abuffer.append( " pass" ) abuffer.append( "\0" ) diff --git a/data/templates/PythonComponent8/src/PYCMP/PYCMP_utils.py b/data/templates/PythonComponent8/src/PYCMP/PYCMP_utils.py index 56e1557..e9d9171 100755 --- a/data/templates/PythonComponent8/src/PYCMP/PYCMP_utils.py +++ b/data/templates/PythonComponent8/src/PYCMP/PYCMP_utils.py @@ -90,8 +90,6 @@ def verbose(): __verbose__ = int( os.getenv( 'SALOME_VERBOSE', 0 ) ) except: __verbose__ = 0 - pass - pass return __verbose__ ### @@ -102,7 +100,6 @@ def getORB(): global __orb__ if __orb__ is None: __orb__ = CORBA.ORB_init( [''], CORBA.ORB_ID ) - pass return __orb__ ### @@ -113,7 +110,6 @@ def getNS(): global __naming_service__ if __naming_service__ is None: __naming_service__ = SALOME_NamingServicePy_i( getORB() ) - pass return __naming_service__ ## @@ -124,7 +120,6 @@ def getLCC(): global __lcc__ if __lcc__ is None: __lcc__ = LifeCycleCORBA( getORB() ) - pass return __lcc__ ## @@ -136,7 +131,6 @@ def getStudyManager(): if __study_manager__ is None: obj = getNS().Resolve( '/myStudyManager' ) __study_manager__ = obj._narrow( SALOMEDS.StudyManager ) - pass return __study_manager__ ### @@ -147,7 +141,6 @@ def getEngine(): global __engine__ if __engine__ is None: __engine__ = getLCC().FindOrLoadComponent( "FactoryServerPy", moduleName() ) - pass return __engine__ ### @@ -157,7 +150,6 @@ def getEngineIOR(): IOR = "" if getORB() and getEngine(): IOR = getORB().object_to_string( getEngine() ) - pass return IOR ### @@ -176,10 +168,8 @@ def findOrCreateComponent( study ): attr.SetValue( moduleID() ) try: builder.DefineComponentInstance( father, getEngine() ) - pass except: pass - pass return father ### @@ -192,6 +182,4 @@ def getObjectID( study, entry ): if sobj is not None: test, anAttr = sobj.FindAttribute( "AttributeLocalID" ) if test: ID = anAttr._narrow( SALOMEDS.AttributeLocalID ).Value() - pass - pass return ID diff --git a/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPDesktop.py b/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPDesktop.py index dcc57f7..58940d8 100755 --- a/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPDesktop.py +++ b/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPDesktop.py @@ -25,7 +25,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self.createTreeView() self.createGraphicsView() - pass def createTreeView( self ) : self._globalTree= TreeWidget( self ) @@ -35,19 +34,16 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._dockGlobalTree.setAllowedAreas( Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea ) self._dockGlobalTree.setWidget( self._globalTree ) self._sgDesktop.addDockWidget( Qt.LeftDockWidgetArea, self._dockGlobalTree ) - pass def createGraphicsView( self ) : scene = GraphicsScene( self._controller ) self._globalGraphicsView = GraphicsView( scene ) self._globalGraphicsViewID = self._sgPyQt.createView( "ViewCurve", self._globalGraphicsView ) - pass def createActions( self ) : self.createPolylineAction = self._sgPyQt.createAction( self._polylineID, "Polyline", "Create Polyline", "Show Polyline dialog box", "ExecPolyline.png" ) self.createCircleAction = self._sgPyQt.createAction( self._circleID, "Circle", "Create Circle", "Show Circle dialog box", "ExecCircle.png" ) self.deleteAllAction = self._sgPyQt.createAction( self._deleteAllID, "Delete all", "Delete all", "Delete all objects", "ExecDelAll.png" ) - pass def createMenus( self ) : curveMenu = self._sgPyQt.createMenu( " Curve", -1, self._curveMenuID, self._sgPyQt.defaultMenuGroup() ) @@ -56,7 +52,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._sgPyQt.createMenu( self.createPolylineAction, curveMenu ) self._sgPyQt.createMenu( self.createCircleAction, curveMenu ) self._sgPyQt.createMenu( self.deleteAllAction, advancedMenu ) - pass def createToolBars( self ) : createPolylineTB = self._sgPyQt.createTool("New polyline") @@ -66,7 +61,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : self._sgPyQt.createTool( self.createPolylineAction, createPolylineTB ) self._sgPyQt.createTool( self.createCircleAction, createCircleTB ) self._sgPyQt.createTool( self.deleteAllAction, deleteAllTB ) - pass def createPopups( self ) : pass @@ -76,7 +70,6 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : def setController( self, controller ) : self._controller = controller - pass def getGlobalTree( self ) : return self._globalTree @@ -96,6 +89,4 @@ class :sat:{PYCMP}Desktop( QMainWindow ) : #Resizing the globalGraphicView sceneRect = scene.getRect() self._globalGraphicsView.fitInView ( sceneRect, Qt.KeepAspectRatio ) - pass -pass diff --git a/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPGUI.py b/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPGUI.py index 71a4e0f..995ae08 100755 --- a/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPGUI.py +++ b/data/templates/PythonComponent8/src/PYCMPGUI/PYCMPGUI.py @@ -91,7 +91,6 @@ def setDesktop( studyID ): moduleDesktop[studyID] = :sat:{PYCMP}Desktop( sgPyQt, sg ) objectsManager = Controller( moduleDesktop[studyID] ) moduleDesktop[studyID].setController( objectsManager ) - pass currentDesktop = moduleDesktop[studyID] return currentDesktop @@ -100,7 +99,6 @@ def incObjToMap( m, id ): if id not in m: m[id] = 0 m[id] += 1 - pass def getSelection(): """This method analyses selection""" @@ -109,7 +107,6 @@ def getSelection(): seltypes = {} for i in range( selcount ): incObjToMap( seltypes, getObjectID( getStudy(), sg.getSelected( i ) ) ) - pass return selcount, seltypes ################################################ @@ -120,7 +117,6 @@ def initialize(): """This method is called when module is initialized. It performs initialization actions""" setDesktop( getStudyId() ) - pass def windows(): """This method is called when module is initialized. It returns a map of popup windows to be used by the module""" @@ -136,7 +132,6 @@ def views(): def createPreferences(): """This method is called when module is initialized. It exports module preferences""" - pass def activate(): """This method is called when module is initialized. It returns True if activating is successfull, False otherwise""" @@ -155,7 +150,6 @@ def activate(): def viewTryClose( wid ): sgPyQt.setViewClosable(wid, True) - pass def deactivate(): """This method is called when module is deactivated""" @@ -166,41 +160,32 @@ def deactivate(): moduleDesktop[getStudyId()].getDockGlobalTree().hide() moduleDesktop[getStudyId()].updateGlobalGraphicsView( None ) moduleDesktop[getStudyId()].getGlobalGraphicsView().hide() - pass def activeStudyChanged( studyID ): """This method is called when active study is changed""" setDesktop( getStudyId() ) - pass def createPopupMenu( popup, context ): """This method is called when popup menu is invocked""" - pass def OnGUIEvent( commandID ): """This method is called when a GUI action is activated""" if commandID in dict_command: dict_command[commandID]() - pass - pass def preferenceChanged( section, setting ): """This method is called when module's preferences are changed""" - pass def activeViewChanged( viewID ): """This method is called when active view is changed""" - pass def viewCloned( viewID ): """This method is called when active view is cloned""" - pass def viewClosed( viewID ): """This method is called when active view viewClosed""" - pass def engineIOR(): """This method is called when study is opened. It returns engine IOR""" @@ -220,7 +205,6 @@ def showCreatePolylineDialog() : widgetDialogBox.setWidget( myDialog ) widgetDialogBox.setWindowTitle( "Polyline definition" ) sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def showCreateCircleDialog() : from CreateCircleDialog import CreateCircleDialog @@ -231,7 +215,6 @@ def showCreateCircleDialog() : widgetDialogBox.setWidget( myDialog ) widgetDialogBox.setWindowTitle( "Circle definition" ) sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def deleteAll() : models = moduleDesktop[getStudyId()].getController().getModels() @@ -240,9 +223,6 @@ def deleteAll() : if answer == QMessageBox.Yes : for model in models : moduleDesktop[getStudyId()].getController().removeModel( model ) - pass - pass - pass ######################################################## # Commands dictionary diff --git a/data/templates/PythonComponent8/src/StandAlone/Desktop.py b/data/templates/PythonComponent8/src/StandAlone/Desktop.py index be011f9..4a85a87 100755 --- a/data/templates/PythonComponent8/src/StandAlone/Desktop.py +++ b/data/templates/PythonComponent8/src/StandAlone/Desktop.py @@ -33,14 +33,12 @@ class Desktop(QMainWindow): # Creating menus and toolbars self.createMenus() self.createToolBars() - pass def getController(self): return self._controller def setController(self, controller): self._controller = controller - pass def getGlobalTree(self): return self._globalTree @@ -61,7 +59,6 @@ class Desktop(QMainWindow): createPolylineAction.triggered.connect(self.showCreatePolylineDialog) createCircleAction.triggered.connect(self.showCreateCircleDialog) deleteAllAction.triggered.connect(self.deleteAll) - pass def createToolBars(self): # Creating toolBars @@ -75,7 +72,6 @@ class Desktop(QMainWindow): # Connecting slots createPolylineAction.triggered.connect(self.showCreatePolylineDialog) createCircleAction.triggered.connect(self.showCreateCircleDialog) - pass def showCreatePolylineDialog(self): from CreatePolylineDialog import CreatePolylineDialog @@ -88,7 +84,6 @@ class Desktop(QMainWindow): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Polyline definition") self.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def showCreateCircleDialog(self): from CreateCircleDialog import CreateCircleDialog @@ -99,7 +94,6 @@ class Desktop(QMainWindow): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Polyline definition") self.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def deleteAll(self): models = self.getController().getModels() @@ -114,9 +108,6 @@ class Desktop(QMainWindow): if answer == QMessageBox.Yes: for model in models: self.getController().removeModel(model) - pass - pass - pass def updateGlobalGraphicsView(self, scene): self._globalGraphicsView.setScene(scene) @@ -133,7 +124,5 @@ class Desktop(QMainWindow): topLeft.x(), topLeft.y(), 2 * sceneRect.width(), 2 * sceneRect.height() ) self._globalGraphicsView.fitInView(viewRect, Qt.IgnoreAspectRatio) - pass -pass diff --git a/data/templates/PythonComponent8/src/StandAlone/StandalonePYCMPGUI.py b/data/templates/PythonComponent8/src/StandAlone/StandalonePYCMPGUI.py index 0712e48..b1e860a 100755 --- a/data/templates/PythonComponent8/src/StandAlone/StandalonePYCMPGUI.py +++ b/data/templates/PythonComponent8/src/StandAlone/StandalonePYCMPGUI.py @@ -19,4 +19,3 @@ def main(args): if __name__ == "__main__": main(sys.argv) - pass diff --git a/data/templates/PythonComponent8/src/View/CircleGraphicsScene.py b/data/templates/PythonComponent8/src/View/CircleGraphicsScene.py index edc3a3c..fceb280 100755 --- a/data/templates/PythonComponent8/src/View/CircleGraphicsScene.py +++ b/data/templates/PythonComponent8/src/View/CircleGraphicsScene.py @@ -6,11 +6,10 @@ from GraphicsRectItem import GraphicsRectItem class CircleGraphicsScene(GraphicsScene): def __init__(self, controller): GraphicsScene.__init__(self, controller) - pass def draw(self): - import math + pass center = self._model.getCenter() radius = float(self._model.getRadius()) @@ -25,7 +24,5 @@ class CircleGraphicsScene(GraphicsScene): circleItem = QGraphicsEllipseItem() circleItem.setRect(rect) self.addItem(circleItem) - pass -pass diff --git a/data/templates/PythonComponent8/src/View/CircleTreeWidgetItem.py b/data/templates/PythonComponent8/src/View/CircleTreeWidgetItem.py index 59d4aee..2227efb 100755 --- a/data/templates/PythonComponent8/src/View/CircleTreeWidgetItem.py +++ b/data/templates/PythonComponent8/src/View/CircleTreeWidgetItem.py @@ -8,7 +8,6 @@ class CircleTreeWidgetItem(TreeWidgetItem): """Constructor""" TreeWidgetItem.__init__(self, name, controller, actionsList) - pass def editInGlobalTree(self, treeWidgetItem): name = self.getModel().getName() @@ -22,7 +21,5 @@ class CircleTreeWidgetItem(TreeWidgetItem): radius = self._model.getRadius() relatedItem = treeWidgetItem.child(1) relatedItem.setText(0, str(radius)) - pass -pass diff --git a/data/templates/PythonComponent8/src/View/GraphicsRectItem.py b/data/templates/PythonComponent8/src/View/GraphicsRectItem.py index 449d2c0..04e0200 100755 --- a/data/templates/PythonComponent8/src/View/GraphicsRectItem.py +++ b/data/templates/PythonComponent8/src/View/GraphicsRectItem.py @@ -7,10 +7,8 @@ class GraphicsRectItem(QGraphicsRectItem): self._index = index self.setFlag(self.ItemIsMovable, True) self.setFlag(self.ItemIsSelectable, True) - pass def getIndex(self): return self._index -pass diff --git a/data/templates/PythonComponent8/src/View/GraphicsScene.py b/data/templates/PythonComponent8/src/View/GraphicsScene.py index ca307f4..e50f518 100755 --- a/data/templates/PythonComponent8/src/View/GraphicsScene.py +++ b/data/templates/PythonComponent8/src/View/GraphicsScene.py @@ -8,7 +8,6 @@ class GraphicsScene( View, QGraphicsScene ) : View.__init__( self, controller ) QGraphicsScene.__init__( self ) - pass def getRect( self ) : rect = QRectF( 0, 0, self.width(), self.height() ) @@ -17,51 +16,39 @@ class GraphicsScene( View, QGraphicsScene ) : def editPoint( self, oldPoint, newPoint ) : polyline = self.getModel() self.getController().editPoint( polyline, oldPoint, newPoint ) - pass def editCenter( self, center ) : circle = self.getModel() self.getController().editCenter( circle, center ) - pass def editRadius( self, radius ) : circle = self.getModel() self.getController().editRadius( circle, radius ) - pass def update( self, mode ) : if mode == 'creation' : self.showInGlobalGraphicsView() - pass elif mode == "showing" : self.showInGlobalGraphicsView() elif mode == 'modification' : self.undraw() self.showInGlobalGraphicsView() - pass elif mode == 'supression' : self.removeFromGlobalGraphicsView() - pass else : return def showInGlobalGraphicsView( self ) : self.draw() self.getController().getMainFrame().updateGlobalGraphicsView( self ) - pass def removeFromGlobalGraphicsView( self ) : self.getController().getMainFrame().updateGlobalGraphicsView( None ) - pass def draw( self ) : print 'Virtual method' - pass def undraw( self ) : for item in self.items() : self.removeItem( item ) - pass - pass -pass diff --git a/data/templates/PythonComponent8/src/View/GraphicsView.py b/data/templates/PythonComponent8/src/View/GraphicsView.py index 24a394e..72a7a32 100755 --- a/data/templates/PythonComponent8/src/View/GraphicsView.py +++ b/data/templates/PythonComponent8/src/View/GraphicsView.py @@ -14,21 +14,18 @@ class GraphicsView(QGraphicsView): self._selectedItem = None self.moved[QPointF].connect(self.execMouseMoveEvent) self.released[QPointF].connect(self.execMouseReleaseEvent) - pass def mousePressEvent(self, mouseEvent): QGraphicsView.mousePressEvent(self, mouseEvent) if self.scene() is None: return self._selectedItem = self.scene().mouseGrabberItem() - pass def mouseMoveEvent(self, mouseEvent): QGraphicsView.mouseMoveEvent(self, mouseEvent) pt = mouseEvent.pos() currentPos = self.mapToScene(pt) self.moved.emit(currentPos) - pass def mouseReleaseEvent(self, mouseEvent): QGraphicsView.mouseReleaseEvent(self, mouseEvent) @@ -37,8 +34,6 @@ class GraphicsView(QGraphicsView): newPos = self.mapToScene(pt) self.released.emit(newPos) self._selectedItem = None - pass - pass def execMouseMoveEvent(self, currentPos): if self._selectedItem is None: @@ -46,7 +41,7 @@ class GraphicsView(QGraphicsView): selectedIndex = self._selectedItem.getIndex() newX = currentPos.x() newY = currentPos.y() - newPoint = newX, newY + newX, newY model = self.scene().getModel() pen = QPen(QColor("red")) if isinstance(model, Polyline): @@ -56,13 +51,11 @@ class GraphicsView(QGraphicsView): xNext = nextPoint[0] yNext = nextPoint[1] self.scene().addLine(newX, newY, xNext, yNext, pen) - pass elif selectedIndex == len(model.getPoints()) - 1: previousPoint = model.getPoints()[selectedIndex - 1] xPrevious = previousPoint[0] yPrevious = previousPoint[1] self.scene().addLine(xPrevious, yPrevious, newX, newY, pen) - pass else: previousPoint = model.getPoints()[selectedIndex - 1] xPrevious = previousPoint[0] @@ -72,8 +65,6 @@ class GraphicsView(QGraphicsView): xNext = nextPoint[0] yNext = nextPoint[1] self.scene().addLine(newX, newY, xNext, yNext, pen) - pass - pass elif isinstance(model, Circle): # Previsualisation radius = float(model.getRadius()) @@ -82,8 +73,6 @@ class GraphicsView(QGraphicsView): circleItem.setPen(pen) circleItem.setRect(rect) self.scene().addItem(circleItem) - pass - pass def execMouseReleaseEvent(self, newPos): if self._selectedItem is None: @@ -95,11 +84,7 @@ class GraphicsView(QGraphicsView): model = self.scene().getModel() if isinstance(model, Polyline): self.scene().getController().editPoint(model, newPoint, selectedIndex) - pass elif isinstance(model, Circle): self.scene().getController().editCenter(model, newPoint) - pass - pass -pass diff --git a/data/templates/PythonComponent8/src/View/Menu.py b/data/templates/PythonComponent8/src/View/Menu.py index 87a912e..edf7a27 100755 --- a/data/templates/PythonComponent8/src/View/Menu.py +++ b/data/templates/PythonComponent8/src/View/Menu.py @@ -7,10 +7,8 @@ class Menu(QMenu): QMenu.__init__(self) self._item = item - pass def getItem(self): return self._item -pass diff --git a/data/templates/PythonComponent8/src/View/PolyGraphicsScene.py b/data/templates/PythonComponent8/src/View/PolyGraphicsScene.py index c68fc67..3d29eca 100755 --- a/data/templates/PythonComponent8/src/View/PolyGraphicsScene.py +++ b/data/templates/PythonComponent8/src/View/PolyGraphicsScene.py @@ -6,7 +6,6 @@ from GraphicsRectItem import GraphicsRectItem class PolyGraphicsScene(GraphicsScene): def __init__(self, controller): GraphicsScene.__init__(self, controller) - pass def draw(self): points = self.getModel().getPoints() @@ -19,7 +18,6 @@ class PolyGraphicsScene(GraphicsScene): # Constructing a rectangle centered on point pointItem = GraphicsRectItem(xPoint - 0.1, yPoint - 0.1, 0.2, 0.2, i) self.addItem(pointItem) - pass # Linking the points with lines for i in range(len(points) - 1): @@ -33,8 +31,5 @@ class PolyGraphicsScene(GraphicsScene): lineItem = QGraphicsLineItem() lineItem.setLine(line) self.addItem(lineItem) - pass - pass -pass diff --git a/data/templates/PythonComponent8/src/View/PolyTreeWidgetItem.py b/data/templates/PythonComponent8/src/View/PolyTreeWidgetItem.py index 8369f90..a15b0db 100755 --- a/data/templates/PythonComponent8/src/View/PolyTreeWidgetItem.py +++ b/data/templates/PythonComponent8/src/View/PolyTreeWidgetItem.py @@ -8,7 +8,6 @@ class PolyTreeWidgetItem(TreeWidgetItem): """Constructor""" TreeWidgetItem.__init__(self, name, controller, actionsList) - pass def editInGlobalTree(self, treeWidgetItem): name = self.getModel().getName() @@ -21,8 +20,5 @@ class PolyTreeWidgetItem(TreeWidgetItem): yPoint = point[1] relatedItem = treeWidgetItem.child(i) relatedItem.setText(0, str(xPoint) + ":" + str(yPoint)) - pass - pass -pass diff --git a/data/templates/PythonComponent8/src/View/TreeWidget.py b/data/templates/PythonComponent8/src/View/TreeWidget.py index 1cd30c5..ea4b440 100755 --- a/data/templates/PythonComponent8/src/View/TreeWidget.py +++ b/data/templates/PythonComponent8/src/View/TreeWidget.py @@ -30,7 +30,6 @@ class TreeWidget(QTreeWidget): # Creating popup menu self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested[QPoint].connect(self.createPopups) - pass def createPopups(self, point): item = self.itemAt(point) @@ -40,25 +39,18 @@ class TreeWidget(QTreeWidget): for action in item.getActionsList(): if action == "Show": self.menu.addAction(action).triggered.connect(self.show) - pass elif action == "Rename": self.menu.addAction(action).triggered.connect(self.showRenameDialog) - pass elif action == "Delete": self.menu.addAction(action).triggered.connect(self.delete) - pass else: self.menu.addAction(action).triggered.connect(self.showEditDialog) - pass - pass self.menu.exec_(QCursor.pos()) - pass def show(self): model = self.menu.getItem().getModel() controller = self._desktop.getController() controller.showModel(model) - pass def showRenameDialog(self): model = self.menu.getItem().getModel() @@ -75,7 +67,6 @@ class TreeWidget(QTreeWidget): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Object renaming") sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass def delete(self): answer = QMessageBox.question( @@ -88,8 +79,6 @@ class TreeWidget(QTreeWidget): model = self.menu.getItem().getModel() controller = self._desktop.getController() controller.removeModel(model) - pass - pass def showEditDialog(self): item = self.menu.getItem() @@ -107,7 +96,6 @@ class TreeWidget(QTreeWidget): oldPoint, pointRange, ) - pass elif isinstance(parentModel, Circle): selectedRange = parentItem.indexOfChild(item) oldSelected = item.text(0) @@ -129,7 +117,6 @@ class TreeWidget(QTreeWidget): ) else: pass - pass else: pass @@ -137,7 +124,5 @@ class TreeWidget(QTreeWidget): widgetDialogBox.setWidget(myDialog) widgetDialogBox.setWindowTitle("Object edition") sgDesktop.addDockWidget(Qt.LeftDockWidgetArea, widgetDialogBox) - pass -pass diff --git a/data/templates/PythonComponent8/src/View/TreeWidgetItem.py b/data/templates/PythonComponent8/src/View/TreeWidgetItem.py index c24bf47..7c15cd9 100755 --- a/data/templates/PythonComponent8/src/View/TreeWidgetItem.py +++ b/data/templates/PythonComponent8/src/View/TreeWidgetItem.py @@ -10,7 +10,6 @@ class TreeWidgetItem( View, QTreeWidgetItem ) : self._name = [ name ] QTreeWidgetItem.__init__( self, self._name ) self._actionsList = actionsList - pass def getActionsList( self ) : return self._actionsList @@ -18,38 +17,29 @@ class TreeWidgetItem( View, QTreeWidgetItem ) : def editCenter( self, center ) : circle = self.getModel() self.getController().editCenter( circle, center ) - pass def editRadius( self, radius ) : circle = self.getModel() self.getController().editRadius( circle, radius ) - pass def update( self, mode ) : if mode == 'creation' : self.addToGlobalTree( self ) - pass elif mode == 'modification' : self.editInGlobalTree( self ) - pass elif mode == 'supression' : self.removeFromGlobalTree( self ) - pass else : return def addToGlobalTree( self, treeWidgetItem ) : globalTree = self.getController().getMainFrame().getGlobalTree() globalTree.addTopLevelItem( treeWidgetItem ) - pass def editInGlobalTree( self, treeWidgetItem ) : print 'Virtual' - pass def removeFromGlobalTree( self, treeWidgetItem ) : globalTree = self.getController().getMainFrame().getGlobalTree() globalTree.takeTopLevelItem( globalTree.indexOfTopLevelItem(treeWidgetItem) ) - pass -pass diff --git a/data/templates/PythonComponent8/src/View/View.py b/data/templates/PythonComponent8/src/View/View.py index 899419d..2560ae4 100755 --- a/data/templates/PythonComponent8/src/View/View.py +++ b/data/templates/PythonComponent8/src/View/View.py @@ -5,29 +5,23 @@ class View() : self._model = None self._controller = controller - pass def getModel( self ) : return self._model def setModel( self, model ) : self._model = model - pass def getController( self ) : return self._controller def setController( self, controller ) : self._controller = controller - pass def editName( self, name ) : model = self.getModel() self._controller.editName( model, name ) - pass def update( self, mode ) : print 'Virtual method' - pass -pass diff --git a/doc/src/conf.py b/doc/src/conf.py index a0efe62..6b59808 100644 --- a/doc/src/conf.py +++ b/doc/src/conf.py @@ -11,8 +11,6 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os # https://stackoverflow.com/questions/23462494/how-to-add-a-custom-css-file-to-sphinx diff --git a/src/ElementTreePython3.py b/src/ElementTreePython3.py index 36dc086..9cf8f23 100644 --- a/src/ElementTreePython3.py +++ b/src/ElementTreePython3.py @@ -117,7 +117,6 @@ class ParseError(SyntaxError): """ - pass # -------------------------------------------------------------------- diff --git a/src/__init__.py b/src/__init__.py index 7f6d7e8..6bae9e4 100644 --- a/src/__init__.py +++ b/src/__init__.py @@ -26,7 +26,6 @@ import shutil import errno import stat import fnmatch -import pprint as PP from ftplib import FTP from . import pyconf diff --git a/src/callerName.py b/src/callerName.py index c42fbcf..dd7d07e 100644 --- a/src/callerName.py +++ b/src/callerName.py @@ -8,8 +8,6 @@ import os import sys import inspect -import logging -import pprint as PP ############################################################################## diff --git a/src/colorama/win32.py b/src/colorama/win32.py index 34c13ab..919c3e1 100644 --- a/src/colorama/win32.py +++ b/src/colorama/win32.py @@ -110,7 +110,7 @@ else: def GetConsoleScreenBufferInfo(stream_id=STDOUT): handle = handles[stream_id] csbi = CONSOLE_SCREEN_BUFFER_INFO() - success = _GetConsoleScreenBufferInfo(handle, byref(csbi)) + _GetConsoleScreenBufferInfo(handle, byref(csbi)) return csbi def SetConsoleTextAttribute(stream_id, attrs): diff --git a/src/debug.py b/src/debug.py index 8c15427..70166a2 100755 --- a/src/debug.py +++ b/src/debug.py @@ -225,7 +225,6 @@ class OutStream(StringIO): class InStream(StringIO): """utility class for pyconf.Config input iostream""" - pass def getLocalEnv(): @@ -301,7 +300,7 @@ def _saveConfigRecursiveDbg(config, aStream, indent, path, nb): """ try: # type config, mapping - order = object.__getattribute__(config, "order") + object.__getattribute__(config, "order") data = object.__getattribute__(config, "data") except: aStream.write("%s%s : '%s'\n" % (indstr, path, str(config))) diff --git a/src/environment.py b/src/environment.py index 9df274b..77eab3b 100644 --- a/src/environment.py +++ b/src/environment.py @@ -66,7 +66,7 @@ class Environ: zt.delimiter = delim try: value = zt.substitute(self.environ) - except KeyError as exc: + except KeyError: pass # raise src.SatException(_("Missing definition " # "in environment: %s") % str(exc)) diff --git a/src/fork.py b/src/fork.py index 3ed0565..feec41d 100644 --- a/src/fork.py +++ b/src/fork.py @@ -19,7 +19,6 @@ import os import sys import time -import pickle import subprocess # OP diff --git a/src/i18n/i18nTest.py b/src/i18n/i18nTest.py index f779b67..089d916 100755 --- a/src/i18n/i18nTest.py +++ b/src/i18n/i18nTest.py @@ -56,4 +56,3 @@ class TestCase(unittest.TestCase): if __name__ == "__main__": verbose = False unittest.main() - pass diff --git a/src/loggingSimple.py b/src/loggingSimple.py index 3667a0d..e53f6c3 100755 --- a/src/loggingSimple.py +++ b/src/loggingSimple.py @@ -16,11 +16,8 @@ salomeTools logger. using logging package import os import sys -import time -import random import logging as LOGI -from logging.handlers import BufferingHandler import pprint as PP import src.debug as DBG # Easy print stderr (for DEBUG only) @@ -181,7 +178,7 @@ def getMessage(self): if self.args: try: # better message on format error msg = msg % self.args - except Exception as e: + except Exception: msg = "ERROR: %s with args %s" % (msg, PP.pformat(self.args)) log(msg, True) return msg diff --git a/src/product.py b/src/product.py index 40f740c..b714511 100644 --- a/src/product.py +++ b/src/product.py @@ -807,7 +807,6 @@ def check_config_exists(config, prod_dir, prod_info, verbose=False): if prod_name == prod_info.name: if prod_info.version == compile_cfg[prod_name]: DBG.write("check_config_exists OK 333", compile_cfg, verbose) - pass else: # no correspondence with newer with prod_name sat-config.pyconf files config_corresponds = False break diff --git a/src/pyconf.py b/src/pyconf.py index c73558b..2b83bf9 100644 --- a/src/pyconf.py +++ b/src/pyconf.py @@ -307,7 +307,6 @@ class ConfigError(Exception): This is the base class of exceptions raised by this module. """ - pass class ConfigFormatError(ConfigError): @@ -316,7 +315,6 @@ class ConfigFormatError(ConfigError): configurations. """ - pass class ConfigResolutionError(ConfigError): @@ -325,7 +323,6 @@ class ConfigResolutionError(ConfigError): configurations. """ - pass def isWord(s): @@ -990,7 +987,6 @@ class Reference(object): break except: rv = None - pass current = object.__getattribute__(current, "parent") if current is None: raise ConfigResolutionError( diff --git a/src/salomeTools.py b/src/salomeTools.py index e166b89..a6040ab 100755 --- a/src/salomeTools.py +++ b/src/salomeTools.py @@ -48,7 +48,6 @@ import tempfile import imp import types import gettext -import traceback import src import src.debug as DBG # Easy print stderr (for DEBUG only) @@ -534,7 +533,7 @@ class Sat(object): if self.options.debug_mode: logger_command.write("\n" + DBG.format_exception("") + "\n", 1) - except Exception as e: + except Exception: # here we print the stack in addition logger_command.write("\n***** ", 1) logger_command.write( diff --git a/src/test/TOOLS.py b/src/test/TOOLS.py index df17cc6..c083c5e 100644 --- a/src/test/TOOLS.py +++ b/src/test/TOOLS.py @@ -143,7 +143,6 @@ class TOOLS_class(object): self.base_ressources_dir = base_ressources_dir self.tmp_dir = tmp_dir self.test_ressources_dir = test_ressources_dir - pass def init(self): self.inFiles = [] diff --git a/src/test/scriptTemplate.py b/src/test/scriptTemplate.py index 256a1c0..2ee3627 100644 --- a/src/test/scriptTemplate.py +++ b/src/test/scriptTemplate.py @@ -100,7 +100,6 @@ with open(r'${resultFile}', 'w') as exec_result: pylog.write('status = "OK"\n') pylog.write('time = "' + timeTest.__str__() + '"\n') - pass # print("here testout.flush") testout.flush() # testout.close() @@ -109,12 +108,10 @@ with open(r'${resultFile}', 'w') as exec_result: sys.stdout = __stdout__ sys.stderr = __stderr__ my_tools.writeInFiles(pylog) - pass pylog.flush() # pylog.close() exec_result.write('Close\n') - pass # exec_result.close() if 'PY' not in '${sessionName}': diff --git a/src/test_module.py b/src/test_module.py index e56dd7f..43aa2eb 100644 --- a/src/test_module.py +++ b/src/test_module.py @@ -34,7 +34,6 @@ import shutil import string import imp import subprocess -import glob import pprint as PP verbose = False @@ -380,7 +379,6 @@ class Test: if verbose: print("--- CRASH ldic\n%s" % PP.pformat(ldic)) # cvw TODO print("--- CRASH gdic\n%s" % PP.pformat(gdic)) - pass exec_time = -1 if "time" in ldic: @@ -505,12 +503,10 @@ echo -e 'import os\nprint(os.environ[\"KERNEL_ROOT_DIR\"])' > tmpscript.py subproc_res = subprocess.Popen( cmd, stdout=subprocess.PIPE, shell=True ).communicate() - pass else: subproc_res = subprocess.Popen( cmd, stdout=subprocess.PIPE, shell=True, executable="/bin/bash" ).communicate() - pass root_dir = subproc_res[0].split()[-1] @@ -547,7 +543,7 @@ echo -e 'import os\nprint(os.environ[\"KERNEL_ROOT_DIR\"])' > tmpscript.py if len(self.launcher) > 0: # There are two cases : The old application (runAppli) # and the new one - launcherName = os.path.basename(self.launcher) + os.path.basename(self.launcher) launcherDir = os.path.dirname(self.launcher) if os.path.basename(launcherDir) == "APPLI": # Old application diff --git a/src/utilsSat.py b/src/utilsSat.py index 7a4c070..6b26bb9 100644 --- a/src/utilsSat.py +++ b/src/utilsSat.py @@ -27,14 +27,9 @@ all-in-one import srs.utilsSat as UTS | >> UTS.Popen('ls && etc...', ...) """ -import os -import shutil import errno -import stat import time -import re -import tempfile import subprocess as SP import src.returnCode as RCO diff --git a/src/versionMinorMajorPatch.py b/src/versionMinorMajorPatch.py index 9746cfd..be092f8 100755 --- a/src/versionMinorMajorPatch.py +++ b/src/versionMinorMajorPatch.py @@ -29,8 +29,6 @@ and range of versions | PATCH version when you make backwards-compatible bug fixes. """ -import os -import sys verbose = False # True diff --git a/src/xmlManager.py b/src/xmlManager.py index 8e55cf2..62a01a9 100644 --- a/src/xmlManager.py +++ b/src/xmlManager.py @@ -71,7 +71,6 @@ class XmlLogFile(object): f.write( "\n" % stylesheet ) - pass res = etree.tostring(self.xmlroot, encoding="utf-8") f.write(res) except IOError: diff --git a/test/test_020_debug.py b/test/test_020_debug.py index 9d09ca8..fb7e173 100755 --- a/test/test_020_debug.py +++ b/test/test_020_debug.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import unittest import initializeTest # set PATH etc for test @@ -121,4 +119,3 @@ class TestCase(unittest.TestCase): if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_021_versionMinorMajorPatch.py b/test/test_021_versionMinorMajorPatch.py index 0da8c69..a268e6f 100755 --- a/test/test_021_versionMinorMajorPatch.py +++ b/test/test_021_versionMinorMajorPatch.py @@ -29,8 +29,6 @@ and range of versions | PATCH version when you make backwards-compatible bug fixes. """ -import os -import sys import unittest import pprint as PP @@ -255,4 +253,3 @@ toto_from_2""".split( if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_024_logging.py b/test/test_024_logging.py index 3d4d0c1..6713cc6 100755 --- a/test/test_024_logging.py +++ b/test/test_024_logging.py @@ -46,12 +46,8 @@ see: http://sametmax.com/ecrire-des-logs-en-python | logger.warning('Testing %s', 'foo') """ -import os -import sys import unittest -import pprint as PP import logging as LOGI -from logging.handlers import BufferingHandler import src.debug as DBG @@ -104,7 +100,6 @@ class TestCase(unittest.TestCase): if verbose: DBG.push_debug(True) # DBG.write("assert unittest", [a for a in dir(self) if "assert" in a]) - pass def test_999(self): # one shot tearDown() for this TestCase @@ -156,4 +151,3 @@ class TestCase(unittest.TestCase): if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_035_pyconf.py b/test/test_035_pyconf.py index a62f149..c465937 100755 --- a/test/test_035_pyconf.py +++ b/test/test_035_pyconf.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import unittest import initializeTest # set PATH etc for test @@ -256,4 +254,3 @@ Bienvenue, Yves if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_100_satHelp.py b/test/test_100_satHelp.py index d092136..18d3a6d 100755 --- a/test/test_100_satHelp.py +++ b/test/test_100_satHelp.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import unittest import initializeTest # set PATH etc for test @@ -43,7 +41,7 @@ class TestCase(unittest.TestCase): self.assertFalse("CRITICAL" in logs) def test_000(self): - logger = LOG.getUnittestLogger() + LOG.getUnittestLogger() # one shot setUp() for this TestCase if self.debug: DBG.push_debug(True) @@ -145,4 +143,3 @@ class TestCase(unittest.TestCase): if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_500_APPLI_TEST.py b/test/test_500_APPLI_TEST.py index 8c246fb..d928526 100755 --- a/test/test_500_APPLI_TEST.py +++ b/test/test_500_APPLI_TEST.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import unittest import initializeTest # set PATH etc for test @@ -65,7 +63,7 @@ class TestCase(unittest.TestCase): self.assertFalse("CRITICAL ::" in logs) def test_000(self): - logger = LOG.getUnittestLogger() + LOG.getUnittestLogger() # one shot setUp() for this TestCase if self.debug: DBG.push_debug(True) @@ -123,11 +121,10 @@ class TestCase(unittest.TestCase): s = SAT.Sat(logger) DBG.write("test_120 'sat %s'" % cmd, "expected raise", dbg) with self.assertRaises(Exception): - returnCode = s.execute_cli(cmd) + s.execute_cli(cmd) logs = logger.getLogsAndClear() DBG.write("logs", logs, dbg) if __name__ == "__main__": unittest.main(exit=False) - pass diff --git a/test/test_501_paramiko.py b/test/test_501_paramiko.py index 9e2308f..db18987 100755 --- a/test/test_501_paramiko.py +++ b/test/test_501_paramiko.py @@ -92,7 +92,6 @@ to set id_rsa from/to reflexive on local machine: """ import os -import sys import unittest import getpass @@ -203,4 +202,3 @@ class TestCase(unittest.TestCase): if __name__ == "__main__": # verbose = True # human eyes unittest.main(exit=False) - pass diff --git a/test/test_sat5_0/compilation/test_compilation.py b/test/test_sat5_0/compilation/test_compilation.py index 807b1d7..0a48ae3 100755 --- a/test/test_sat5_0/compilation/test_compilation.py +++ b/test/test_sat5_0/compilation/test_compilation.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest import src.product @@ -269,4 +268,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/compilation/test_configure.py b/test/test_sat5_0/compilation/test_configure.py index c9ac3d7..54be010 100755 --- a/test/test_sat5_0/compilation/test_configure.py +++ b/test/test_sat5_0/compilation/test_configure.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest import src.product @@ -118,4 +117,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/compilation/test_make.py b/test/test_sat5_0/compilation/test_make.py index b00fd8d..fc5b5b5 100755 --- a/test/test_sat5_0/compilation/test_make.py +++ b/test/test_sat5_0/compilation/test_make.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest import src.product @@ -111,4 +110,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/compilation/test_makeinstall.py b/test/test_sat5_0/compilation/test_makeinstall.py index 6793b0a..842c1cf 100755 --- a/test/test_sat5_0/compilation/test_makeinstall.py +++ b/test/test_sat5_0/compilation/test_makeinstall.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest import src.product @@ -73,4 +72,3 @@ class TestMakeinstall(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/config/test_create_user_pyconf.py b/test/test_sat5_0/config/test_create_user_pyconf.py index 882124a..d6a8f2d 100755 --- a/test/test_sat5_0/config/test_create_user_pyconf.py +++ b/test/test_sat5_0/config/test_create_user_pyconf.py @@ -119,4 +119,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == '__main__': unittest.main() - pass diff --git a/test/test_sat5_0/config/test_option_copy.py b/test/test_sat5_0/config/test_option_copy.py index 08b4f5d..0a283db 100755 --- a/test/test_sat5_0/config/test_option_copy.py +++ b/test/test_sat5_0/config/test_option_copy.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -56,4 +55,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/config/test_option_edit.py b/test/test_sat5_0/config/test_option_edit.py index b7e2653..5290d3a 100755 --- a/test/test_sat5_0/config/test_option_edit.py +++ b/test/test_sat5_0/config/test_option_edit.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import threading import time import unittest @@ -76,4 +74,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/config/test_option_value.py b/test/test_sat5_0/config/test_option_value.py index 5557fc0..7db29c7 100755 --- a/test/test_sat5_0/config/test_option_value.py +++ b/test/test_sat5_0/config/test_option_value.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import platform import unittest @@ -108,4 +106,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/config/test_option_value_2.py b/test/test_sat5_0/config/test_option_value_2.py index cf7119d..a16623d 100755 --- a/test/test_sat5_0/config/test_option_value_2.py +++ b/test/test_sat5_0/config/test_option_value_2.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import platform import unittest @@ -99,4 +97,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/environ/test_environ.py b/test/test_sat5_0/environ/test_environ.py index 8689574..b2a822c 100755 --- a/test/test_sat5_0/environ/test_environ.py +++ b/test/test_sat5_0/environ/test_environ.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -149,4 +148,3 @@ class TestSource(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/job/test_job.py b/test/test_sat5_0/job/test_job.py index d255fd0..32e9d93 100755 --- a/test/test_sat5_0/job/test_job.py +++ b/test/test_sat5_0/job/test_job.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -125,4 +124,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/jobs/test_jobs.py b/test/test_sat5_0/jobs/test_jobs.py index aa2f1ad..9937f7f 100755 --- a/test/test_sat5_0/jobs/test_jobs.py +++ b/test/test_sat5_0/jobs/test_jobs.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -161,4 +160,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/log/test_launch_browser.py b/test/test_sat5_0/log/test_launch_browser.py index 2a45cd0..9f635fe 100755 --- a/test/test_sat5_0/log/test_launch_browser.py +++ b/test/test_sat5_0/log/test_launch_browser.py @@ -234,7 +234,7 @@ class TestCase(unittest.TestCase): sat.config("-v VARS.user") - nb_logs_t0 = len(os.listdir(sat.cfg.USER.log_dir)) + len(os.listdir(sat.cfg.USER.log_dir)) if os.path.exists(sat.cfg.USER.log_dir + "_save"): shutil.rmtree(sat.cfg.USER.log_dir + "_save") @@ -297,4 +297,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/log/test_launch_browser2.py b/test/test_sat5_0/log/test_launch_browser2.py index 76b7b51..ea65991 100755 --- a/test/test_sat5_0/log/test_launch_browser2.py +++ b/test/test_sat5_0/log/test_launch_browser2.py @@ -17,8 +17,6 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import os -import sys import threading import time import unittest @@ -55,4 +53,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/prepare/test_clean.py b/test/test_sat5_0/prepare/test_clean.py index 3203654..7ef9c5f 100755 --- a/test/test_sat5_0/prepare/test_clean.py +++ b/test/test_sat5_0/prepare/test_clean.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -201,4 +200,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/prepare/test_patch.py b/test/test_sat5_0/prepare/test_patch.py index af7a375..76c0548 100755 --- a/test/test_sat5_0/prepare/test_patch.py +++ b/test/test_sat5_0/prepare/test_patch.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import shutil import unittest @@ -173,4 +172,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/prepare/test_prepare.py b/test/test_sat5_0/prepare/test_prepare.py index 92f5e04..f25c4dd 100755 --- a/test/test_sat5_0/prepare/test_prepare.py +++ b/test/test_sat5_0/prepare/test_prepare.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import shutil import unittest @@ -114,4 +113,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/prepare/test_source.py b/test/test_sat5_0/prepare/test_source.py index ac09fe3..5427732 100755 --- a/test/test_sat5_0/prepare/test_source.py +++ b/test/test_sat5_0/prepare/test_source.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -184,4 +183,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/shell/test_shell.py b/test/test_sat5_0/shell/test_shell.py index 65521be..860af29 100755 --- a/test/test_sat5_0/shell/test_shell.py +++ b/test/test_sat5_0/shell/test_shell.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -90,4 +89,3 @@ class TestCase(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/test/test_sat5_0/test/test_command.py b/test/test_sat5_0/test/test_command.py index 8ea743f..db76f1e 100755 --- a/test/test_sat5_0/test/test_command.py +++ b/test/test_sat5_0/test/test_command.py @@ -18,7 +18,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import os -import sys import unittest from src.salomeTools import Sat @@ -94,4 +93,3 @@ class TestTest(unittest.TestCase): # test launch if __name__ == "__main__": unittest.main() - pass diff --git a/unittestpy/HTMLTestRunner.py b/unittestpy/HTMLTestRunner.py index 012f36b..724dfb9 100644 --- a/unittestpy/HTMLTestRunner.py +++ b/unittestpy/HTMLTestRunner.py @@ -93,7 +93,6 @@ Version in 0.7.1 import datetime import StringIO import sys -import time import unittest from xml.sax import saxutils -- 2.39.2