Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SG-36838 Python 2 removal #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hooks/tk-alias_scene_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion hooks/tk-vred_scene_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion hooks/ui_config_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion python/tk_multi_breakdown2/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
20 changes: 7 additions & 13 deletions python/tk_multi_breakdown2/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion python/tk_multi_breakdown2/file_history_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down
4 changes: 2 additions & 2 deletions python/tk_multi_breakdown2/file_item_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/tk_multi_breakdown2/file_proxy_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions tests/python/app_test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -72,7 +72,7 @@ def tearDown(self):
if self.engine:
self.engine.destroy()

super(AppTestBase, self).tearDown()
super().tearDown()

@property
def engine(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"})
Expand Down
2 changes: 1 addition & 1 deletion tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def setUp(self):
"""

os.environ["TEST_ENVIRONMENT"] = "test"
super(TestApplication, self).setUp()
super().setUp()

def test_init_app(self):
"""
Expand Down