From cf5bf6f49c262452b4bd86b719eb884f740c246f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 17 Sep 2021 12:14:49 +0200 Subject: [PATCH] fixed few hounds --- openpype/tools/loader/__main__.py | 10 ++++------ openpype/tools/loader/widgets.py | 8 +++++--- openpype/tools/utils/delegates.py | 3 ++- openpype/tools/utils/widgets.py | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/openpype/tools/loader/__main__.py b/openpype/tools/loader/__main__.py index 27794b9bc5..146ba7fd10 100644 --- a/openpype/tools/loader/__main__.py +++ b/openpype/tools/loader/__main__.py @@ -1,10 +1,12 @@ -"""Main entrypoint for standalone debugging""" -""" +"""Main entrypoint for standalone debugging + Used for running 'avalon.tool.loader.__main__' as a module (-m), useful for debugging without need to start host. Modify AVALON_MONGO accordingly """ +import os +import sys from . import cli @@ -17,7 +19,6 @@ def my_exception_hook(exctype, value, traceback): if __name__ == '__main__': - import os os.environ["AVALON_MONGO"] = "mongodb://localhost:27017" os.environ["OPENPYPE_MONGO"] = "mongodb://localhost:27017" os.environ["AVALON_DB"] = "avalon" @@ -26,9 +27,6 @@ if __name__ == '__main__': os.environ["AVALON_CONFIG"] = "pype" os.environ["AVALON_ASSET"] = "Jungle" - - import sys - # Set the exception hook to our wrapping function sys.excepthook = my_exception_hook diff --git a/openpype/tools/loader/widgets.py b/openpype/tools/loader/widgets.py index 9479558026..91e6f20518 100644 --- a/openpype/tools/loader/widgets.py +++ b/openpype/tools/loader/widgets.py @@ -8,7 +8,7 @@ import collections from Qt import QtWidgets, QtCore, QtGui -from avalon import api, io, pipeline +from avalon import api, pipeline from avalon.lib import HeroVersionType from openpype.tools.utils import lib as tools_lib @@ -1173,8 +1173,10 @@ class RepresentationWidget(QtWidgets.QWidget): repre_context ): if tools_lib.is_sync_loader(loader): - both_unavailable = item["active_site_progress"] <= 0 and \ - item["remote_site_progress"] <= 0 + both_unavailable = ( + item["active_site_progress"] <= 0 + and item["remote_site_progress"] <= 0 + ) if both_unavailable: continue diff --git a/openpype/tools/utils/delegates.py b/openpype/tools/utils/delegates.py index 608762b538..1827bc7e9b 100644 --- a/openpype/tools/utils/delegates.py +++ b/openpype/tools/utils/delegates.py @@ -79,7 +79,8 @@ class AssetDelegate(QtWidgets.QItemDelegate): else: bg_color.setAlpha(0) - # # -- When not needed to do a rounded corners (easier and without painter restore): + # When not needed to do a rounded corners (easier and without + # painter restore): # painter.fillRect( # item_rect, # QtGui.QBrush(bg_color) diff --git a/openpype/tools/utils/widgets.py b/openpype/tools/utils/widgets.py index 153f012ff6..b9b542c123 100644 --- a/openpype/tools/utils/widgets.py +++ b/openpype/tools/utils/widgets.py @@ -6,7 +6,7 @@ from . import lib from Qt import QtWidgets, QtCore, QtGui from avalon.vendor import qtawesome, qargparse -from avalon import style, io +from avalon import style from .models import AssetModel, RecursiveSortFilterProxyModel from .views import AssetsView