diff options
author | Rakielle <rakielledev@gmail.com> | 2022-10-15 20:19:33 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-10-17 13:32:56 +0200 |
commit | 09ba0057e3d7f8c9d1166269b232a8b2692fa506 (patch) | |
tree | 7daead76f7bb02c8094b6a3160170f10c06817ec /uitest | |
parent | 61f660daef0e9c848087fbc7a8f95395c7093b8f (diff) |
tdf#132293 remove unused imports and variables
I used pyflakes to check for any unused imports and variables in python scripts under sc, sw, uitest directories, and then removed the unused imports and variables
Change-Id: I0690c9366087dc602ee8ea169bc1c9063033fef6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141421
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/demo_ui/checkbox.py | 2 | ||||
-rw-r--r-- | uitest/demo_ui/combobox.py | 2 | ||||
-rw-r--r-- | uitest/demo_ui/edit.py | 2 | ||||
-rw-r--r-- | uitest/demo_ui/handle_multiple_files.py | 6 | ||||
-rw-r--r-- | uitest/demo_ui/hierarchy.py | 2 | ||||
-rw-r--r-- | uitest/demo_ui/listbox.py | 3 | ||||
-rw-r--r-- | uitest/demo_ui/radiobutton.py | 14 | ||||
-rw-r--r-- | uitest/demo_ui/spinfield.py | 4 | ||||
-rw-r--r-- | uitest/demo_ui/tabdialog.py | 3 | ||||
-rw-r--r-- | uitest/demo_ui/treelist.py | 2 | ||||
-rw-r--r-- | uitest/libreoffice/connection.py | 1 | ||||
-rw-r--r-- | uitest/libreoffice/uno/eventlistener.py | 1 | ||||
-rw-r--r-- | uitest/libreoffice/uno/propertyvalue.py | 1 | ||||
-rw-r--r-- | uitest/math_tests/start.py | 4 |
14 files changed, 4 insertions, 43 deletions
diff --git a/uitest/demo_ui/checkbox.py b/uitest/demo_ui/checkbox.py index bb0f1f60a630..7c83d71f0ad8 100644 --- a/uitest/demo_ui/checkbox.py +++ b/uitest/demo_ui/checkbox.py @@ -7,8 +7,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase class CheckBoxTest(UITestCase): diff --git a/uitest/demo_ui/combobox.py b/uitest/demo_ui/combobox.py index 56d4a4e79ae7..1ec4b30d6f1e 100644 --- a/uitest/demo_ui/combobox.py +++ b/uitest/demo_ui/combobox.py @@ -7,8 +7,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase from uitest.uihelper.common import select_pos diff --git a/uitest/demo_ui/edit.py b/uitest/demo_ui/edit.py index 59516b13a701..7a0fbb2b8a7e 100644 --- a/uitest/demo_ui/edit.py +++ b/uitest/demo_ui/edit.py @@ -12,8 +12,6 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.framework import UITestCase from uitest.uihelper.common import type_text, get_state_as_dict, select_text -import time - class EditTest(UITestCase): def test_type_text(self): diff --git a/uitest/demo_ui/handle_multiple_files.py b/uitest/demo_ui/handle_multiple_files.py index 406bb2b519eb..a15b92deeccb 100644 --- a/uitest/demo_ui/handle_multiple_files.py +++ b/uitest/demo_ui/handle_multiple_files.py @@ -7,8 +7,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues -from libreoffice.uno.eventlistener import EventListener from uitest.framework import UITestCase from uitest.uihelper.common import get_url_for_data_file import time @@ -17,7 +15,7 @@ class HandleFiles(UITestCase): def test_load_file(self): - with self.ui_test.load_file(get_url_for_data_file("test.ods")) as calc_file: + with self.ui_test.load_file(get_url_for_data_file("test.ods")): with self.ui_test.load_file(get_url_for_data_file("test2.ods")): @@ -34,7 +32,7 @@ class HandleFiles(UITestCase): time.sleep(1) def test_select_frame(self): - with self.ui_test.load_file(get_url_for_data_file("test.ods")) as calc_file: + with self.ui_test.load_file(get_url_for_data_file("test.ods")): with self.ui_test.load_file(get_url_for_data_file("test2.ods")): frames = self.ui_test.get_frames() diff --git a/uitest/demo_ui/hierarchy.py b/uitest/demo_ui/hierarchy.py index 19cb4c34b54d..a447de563e4a 100644 --- a/uitest/demo_ui/hierarchy.py +++ b/uitest/demo_ui/hierarchy.py @@ -7,8 +7,6 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase import json diff --git a/uitest/demo_ui/listbox.py b/uitest/demo_ui/listbox.py index 9e762c5218d2..b59a7b0a0a8f 100644 --- a/uitest/demo_ui/listbox.py +++ b/uitest/demo_ui/listbox.py @@ -7,10 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase -from uitest.uihelper.common import select_pos class ListBoxTest(UITestCase): diff --git a/uitest/demo_ui/radiobutton.py b/uitest/demo_ui/radiobutton.py index cc5a3b67bf97..268696e56e66 100644 --- a/uitest/demo_ui/radiobutton.py +++ b/uitest/demo_ui/radiobutton.py @@ -7,22 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase -import time - -try: - import pyuno - import uno - import unohelper -except ImportError: - print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables") - print("PYTHONPATH=/installation/opt/program") - print("URE_BOOTSTRAP=file:///installation/opt/program/fundamentalrc") - raise - class RadioButtonTest(UITestCase): def test_toggle_radiobutton(self): diff --git a/uitest/demo_ui/spinfield.py b/uitest/demo_ui/spinfield.py index 5511fec0827e..6b6a3bce0f22 100644 --- a/uitest/demo_ui/spinfield.py +++ b/uitest/demo_ui/spinfield.py @@ -7,10 +7,8 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase -from uitest.uihelper.common import get_state_as_dict, type_text, select_pos +from uitest.uihelper.common import get_state_as_dict, type_text class SpinFieldTest(UITestCase): diff --git a/uitest/demo_ui/tabdialog.py b/uitest/demo_ui/tabdialog.py index 73167ea6524d..6ed5bcc06983 100644 --- a/uitest/demo_ui/tabdialog.py +++ b/uitest/demo_ui/tabdialog.py @@ -7,10 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -from libreoffice.uno.propertyvalue import mkPropertyValues - from uitest.framework import UITestCase -from uitest.uihelper.common import select_pos class TabDialogTest(UITestCase): diff --git a/uitest/demo_ui/treelist.py b/uitest/demo_ui/treelist.py index e80176c52b88..214fc4b08e70 100644 --- a/uitest/demo_ui/treelist.py +++ b/uitest/demo_ui/treelist.py @@ -10,7 +10,7 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.uihelper.calc import enter_text_to_cell -from uitest.uihelper.common import get_state_as_dict, select_pos +from uitest.uihelper.common import select_pos from uitest.framework import UITestCase diff --git a/uitest/libreoffice/connection.py b/uitest/libreoffice/connection.py index 2b0e9c227479..40c4757406ab 100644 --- a/uitest/libreoffice/connection.py +++ b/uitest/libreoffice/connection.py @@ -14,7 +14,6 @@ import os try: import pyuno import uno - import unohelper except ImportError: print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables") print("PYTHONPATH=/installation/opt/program") diff --git a/uitest/libreoffice/uno/eventlistener.py b/uitest/libreoffice/uno/eventlistener.py index b2b834b13d03..54076efe337e 100644 --- a/uitest/libreoffice/uno/eventlistener.py +++ b/uitest/libreoffice/uno/eventlistener.py @@ -6,7 +6,6 @@ # try: - import pyuno import unohelper from com.sun.star.document import XDocumentEventListener except ImportError: diff --git a/uitest/libreoffice/uno/propertyvalue.py b/uitest/libreoffice/uno/propertyvalue.py index 4e5c8964bc60..ce8622113a9a 100644 --- a/uitest/libreoffice/uno/propertyvalue.py +++ b/uitest/libreoffice/uno/propertyvalue.py @@ -6,7 +6,6 @@ # try: - import pyuno import uno except ImportError: print("pyuno not found: try to set PYTHONPATH and URE_BOOTSTRAP variables") diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py index 962d74e686f4..6b3278acf907 100644 --- a/uitest/math_tests/start.py +++ b/uitest/math_tests/start.py @@ -14,9 +14,6 @@ from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.framework import UITestCase from uitest.uihelper.common import type_text, select_pos -import unittest -import platform - class SimpleMathTest(UITestCase): def test_math_unoCommand(self): @@ -39,7 +36,6 @@ class SimpleMathTest(UITestCase): xEditView = xMathDoc.getChild("editview") type_text(xEditView, "E=mc^2") - xMathEdit = xMathDoc.getChild("editview") self.assertEqual("E=mc^2", get_state_as_dict(xEditView)["Text"]) |