Skip to content

Commit

Permalink
Move outside-of-Nuke testing code out of main
Browse files Browse the repository at this point in the history
Also raise_ the window so it becomes active in OS X (again, outside of Nuke)
  • Loading branch information
dbr committed Jan 9, 2012
1 parent 1856b3c commit 021420e
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions tabtabtab.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,9 @@ def main():

_tabtabtab_instance.under_cursor()
_tabtabtab_instance.show()
_tabtabtab_instance.raise_()
return

try:
# For testing outside Nuke
app = QtGui.QApplication(sys.argv)
except RuntimeError:
app = None

def on_create(menupath):
try:
import nuke
Expand All @@ -485,14 +480,18 @@ def on_create(menupath):

_tabtabtab_instance = t

if app is not None:
app.exec_()


if __name__ == '__main__':
try:
import nuke
m_edit = nuke.menu("Nuke").findItem("Edit")
m_edit.addCommand("Tabtabtab", main, "Tab")
except ImportError:
main()
# For testing outside Nuke
app = QtGui.QApplication(sys.argv)
while True:
main()
r = raw_input()
if r.strip() == "q":
break
app.exec_()

0 comments on commit 021420e

Please sign in to comment.