diff --git a/hooks/tk-alias_scene_operations.py b/hooks/tk-alias_scene_operations.py index 07b12cda..bfc2cc16 100644 --- a/hooks/tk-alias_scene_operations.py +++ b/hooks/tk-alias_scene_operations.py @@ -27,7 +27,7 @@ class BreakdownSceneOperations(HookBaseClass): def __init__(self, *args, **kwargs): """Class constructor.""" - super(BreakdownSceneOperations, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # Keep track of the scene change callbacks that are registered, so that they can be # disconnected at a later time. diff --git a/hooks/tk-vred_scene_operations.py b/hooks/tk-vred_scene_operations.py index f6c68bfb..e15a0331 100644 --- a/hooks/tk-vred_scene_operations.py +++ b/hooks/tk-vred_scene_operations.py @@ -22,7 +22,7 @@ class BreakdownSceneOperations(HookBaseClass): def __init__(self, *args, **kwargs): """Class constructor.""" - super(BreakdownSceneOperations, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._vredpy = self.parent.engine.vredpy diff --git a/hooks/ui_config_advanced.py b/hooks/ui_config_advanced.py index fd874905..909c6636 100644 --- a/hooks/ui_config_advanced.py +++ b/hooks/ui_config_advanced.py @@ -86,7 +86,7 @@ def __init__(self, *args, **kwargs): :param kwags: The keyword arguments to tpass to the base constructor. """ - super(UIConfigAdvanced, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # The file UI configuration that defines what data to display for a file item file_item_config = self.parent.execute_hook_method( diff --git a/python/tk_multi_breakdown2/actions.py b/python/tk_multi_breakdown2/actions.py index 4ed17a13..bb71e891 100644 --- a/python/tk_multi_breakdown2/actions.py +++ b/python/tk_multi_breakdown2/actions.py @@ -166,7 +166,7 @@ def __init__(self, label, file_items, model): :type model: QtGui.QStandardItemModel """ - super(UpdateToLatestVersionAction, self).__init__(label, file_items, model) + super().__init__(label, file_items, model) @wait_cursor def execute(self): diff --git a/python/tk_multi_breakdown2/dialog.py b/python/tk_multi_breakdown2/dialog.py index d39d6197..a42f60f3 100644 --- a/python/tk_multi_breakdown2/dialog.py +++ b/python/tk_multi_breakdown2/dialog.py @@ -11,7 +11,6 @@ import sgtk from sgtk.platform.qt import QtGui, QtCore from tank.errors import TankHookMethodDoesNotExistError -from tank_vendor import six from .dialog_ui import DialogUI @@ -514,7 +513,7 @@ def showEvent(self, event): self.__update_on_show = False self._reload_file_model() - super(AppDialog, self).showEvent(event) + super().showEvent(event) def closeEvent(self, event): """ @@ -576,7 +575,7 @@ def closeEvent(self, event): self._bg_task_manager.shut_down() self._bg_task_manager = None - super(AppDialog, self).closeEvent(event) + super().closeEvent(event) ###################################################################################################### # Public methods @@ -604,16 +603,11 @@ def save_state(self): self._filter_menu.docked, ) - if six.PY2: - self._settings_manager.store( - self.SPLITTER_STATE, self._ui.details_splitter.saveState() - ) - else: - # For Python 3, store the raw QByteArray object (cannot use the settings manager because it - # will convert QByteArray objects to str when storing). - self._raw_values_settings.setValue( - self.SPLITTER_STATE, self._ui.details_splitter.saveState() - ) + # Store the raw QByteArray object (cannot use the settings manager because it + # will convert QByteArray objects to str when storing). + self._raw_values_settings.setValue( + self.SPLITTER_STATE, self._ui.details_splitter.saveState() + ) self._settings_manager.store( self.FILTER_MENU_STATE, self._filter_menu.save_state() diff --git a/python/tk_multi_breakdown2/file_history_model.py b/python/tk_multi_breakdown2/file_history_model.py index 06d57c88..dbfef37c 100644 --- a/python/tk_multi_breakdown2/file_history_model.py +++ b/python/tk_multi_breakdown2/file_history_model.py @@ -125,7 +125,7 @@ def data(self, index, role=QtCore.Qt.DisplayRole): sg_data = self.data(index, self.SG_DATA_ROLE) return sg_data.get("version_number", -1) - return super(FileHistoryModel, self).data(index, role) + return super().data(index, role) def is_current(self, history_sg_data): """ diff --git a/python/tk_multi_breakdown2/file_item_model.py b/python/tk_multi_breakdown2/file_item_model.py index e1780127..33cd9e43 100644 --- a/python/tk_multi_breakdown2/file_item_model.py +++ b/python/tk_multi_breakdown2/file_item_model.py @@ -122,7 +122,7 @@ def __init__( :type dynamic_loading: bool """ - super(FileTreeItemModel, self).__init__(parent) + super().__init__(parent) # The model data # Create the (invisible) tree root item. All top level file item will be added as @@ -1638,7 +1638,7 @@ class FileTreeModelItem(FileModelItem): def __init__(self, file_item=None, group_id=None, group_display=None): """Initialize the file tree item.""" - super(FileTreeModelItem, self).__init__(file_item) + super().__init__(file_item) self.__group_id = group_id self.__group_display = group_display diff --git a/python/tk_multi_breakdown2/file_proxy_model.py b/python/tk_multi_breakdown2/file_proxy_model.py index a6b7f044..dfd2b105 100644 --- a/python/tk_multi_breakdown2/file_proxy_model.py +++ b/python/tk_multi_breakdown2/file_proxy_model.py @@ -36,7 +36,7 @@ def __init__(self, *args, **kwargs): self._search_text_filter_item = None - super(FileProxyModel, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) @property def search_text_filter_item(self): @@ -85,7 +85,7 @@ def _is_row_accepted(self, src_row, src_parent_idx, parent_accepted): is accepted based on the filters. """ - base_model_accepts = super(FileProxyModel, self)._is_row_accepted( + base_model_accepts = super()._is_row_accepted( src_row, src_parent_idx, parent_accepted ) if not base_model_accepts: diff --git a/tests/python/app_test_base.py b/tests/python/app_test_base.py index e5b28677..f467db27 100644 --- a/tests/python/app_test_base.py +++ b/tests/python/app_test_base.py @@ -26,7 +26,7 @@ def setUp(self): """ # First call the parent TankTestBase constructor to set up the tests base - super(AppTestBase, self).setUp() + super().setUp() self.setup_fixtures() # Set up the python path to import required modules @@ -72,7 +72,7 @@ def tearDown(self): if self.engine: self.engine.destroy() - super(AppTestBase, self).tearDown() + super().tearDown() @property def engine(self): diff --git a/tests/test_api_manager.py b/tests/test_api_manager.py index d34a6ff4..53903efa 100644 --- a/tests/test_api_manager.py +++ b/tests/test_api_manager.py @@ -497,7 +497,7 @@ def setUp(self): """Set up before any tests are executed.""" os.environ["TEST_ENVIRONMENT"] = "test" - super(TestBreakdownManager, self).setUp() + super().setUp() # Set the environment variable for the hook scene operations method 'scan_scene' os.environ["TK_TEST_PROJECT_ROOT_PATHS"] = self.project_root @@ -1064,7 +1064,7 @@ def setUp(self): Set up before any tests are executed. """ - super(TestBreakdownManagerMultipleProjects, self).setUp() + super().setUp() # Create a second project for the test module project2, project2_root = self.create_project({"name": "project 2"}) diff --git a/tests/test_app.py b/tests/test_app.py index d36970d7..b6b2d95b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -99,7 +99,7 @@ def setUp(self): """ os.environ["TEST_ENVIRONMENT"] = "test" - super(TestApplication, self).setUp() + super().setUp() def test_init_app(self): """