Skip to content

Commit 5c4a9d6

Browse files
authored
SG-14619 python 3 port (#3)
General Python 3 updates required to make it work. Added a questionbox to ask the user if they would like to reload the engine after updating. Updated the required core version, to v0.19.9 to include fixes around updating the core and duplicate message box buttons.
1 parent c2f7bac commit 5c4a9d6

7 files changed

Lines changed: 16 additions & 10 deletions

File tree

info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ description: "Tools for development."
1919

2020
# Required minimum versions for this item to run
2121
requires_shotgun_version:
22-
requires_core_version: "v0.18.158"
22+
requires_core_version: "v0.19.9"
2323
requires_engine_version:
2424

2525
# this app works in all engines - it does not contain

python/command_runner/dialog.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def _doit(self):
5959
"""
6060
Execute the tank updates command
6161
"""
62+
6263
self._command_obj = self._bundle.sgtk.get_command(self._command_name)
6364
self._command_obj.set_logger(self._logger)
6465
self._command_obj.execute({}, self._interaction_interface)
@@ -74,6 +75,12 @@ def _doit(self):
7475
self.ui.cancel.setText("Close")
7576
self.ui.cancel.clicked.connect(self.close)
7677

78+
reload = self._interaction_interface.ask_yn_question(
79+
"Would you like to restart the engine to reload your changes?"
80+
)
81+
if reload:
82+
sgtk.platform.restart()
83+
7784
def _cancel(self):
7885
"""
7986
Cancel execution

python/command_runner/interact.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def ask_yna_question(self, message, force_prompt=False):
7777
self._parent,
7878
"Shotgun",
7979
message,
80-
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No | QtGui.QMessageBox.YesToAll,
80+
QtGui.QMessageBox.Yes | QtGui.QMessageBox.YesToAll | QtGui.QMessageBox.No,
8181
)
8282

8383
if res == QtGui.QMessageBox.YesToAll:

python/create_sandbox/dialog.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import datetime
1313
import os
1414
from sgtk.platform.qt import QtCore, QtGui
15+
from tank_vendor import six
1516

1617
from .ui.dialog import Ui_Dialog
1718

@@ -89,9 +90,7 @@ def _process(self):
8990
"""
9091
Creates a new configuration
9192
"""
92-
path = self.ui.path.text()
93-
if isinstance(path, unicode):
94-
path = path.decode("utf-8")
93+
path = six.ensure_str(self.ui.path.text())
9594

9695
# validate the name
9796
if self.ui.config_name.text() == "":

python/create_sandbox/ui/resources_rc.py

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

resources/command_runner/build_resources.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function build_ui {
3232
}
3333

3434
function build_res {
35-
build_qt "${PYTHON_BASE}/pyside-rcc" "$1.qrc" "$1_rc"
35+
build_qt "${PYTHON_BASE}/pyside-rcc -py3" "$1.qrc" "$1_rc"
3636
}
3737

3838

resources/create_sandbox/build_resources.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function build_ui {
3232
}
3333

3434
function build_res {
35-
build_qt "${PYTHON_BASE}/pyside-rcc" "$1.qrc" "$1_rc"
35+
build_qt "${PYTHON_BASE}/pyside-rcc -py3" "$1.qrc" "$1_rc"
3636
}
3737

3838

0 commit comments

Comments
 (0)