From 941a4d51ab9cb626b8d7df4dd9c7acbaf3a1a272 Mon Sep 17 00:00:00 2001 From: Ondrej Samohel Date: Wed, 21 Jul 2021 17:26:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=A9=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openpype/hosts/maya/api/commands.py | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/openpype/hosts/maya/api/commands.py b/openpype/hosts/maya/api/commands.py index 4d37288b4e..d4c2b6a225 100644 --- a/openpype/hosts/maya/api/commands.py +++ b/openpype/hosts/maya/api/commands.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- """OpenPype script commands to be used directly in Maya.""" -import sys class ToolWindows: @@ -8,20 +7,30 @@ class ToolWindows: _windows = {} @classmethod - def get_window(cls, tool, window=None): - # type: (str, QtWidgets.QWidget) -> QtWidgets.QWidget + def get_window(cls, tool): + """Get widget for specific tool. + + Args: + tool (str): Name of the tool. + + Returns: + Stored widget. + + """ try: return cls._windows[tool] except KeyError: - if window: - cls.set_window(tool, window) - return window - else: - return None + return None @classmethod def set_window(cls, tool, window): - # type: (str, QtWidget.QWidget) -> None + """Set widget for the tool. + + Args: + tool (str): Name of the tool. + window (QtWidgets.QWidget): Widget + + """ cls._windows[tool] = window