Skip to content

Commit

Permalink
Merge pull request #142 from ynput/enhancement/AY-1411_add_plug_in_de…
Browse files Browse the repository at this point in the history
…tails_tab

Publisher: Add plugin details widget
  • Loading branch information
iLLiCiTiT authored Aug 21, 2024
2 parents 84b8880 + a871c7b commit 200e04c
Show file tree
Hide file tree
Showing 7 changed files with 488 additions and 19 deletions.
9 changes: 9 additions & 0 deletions client/ayon_core/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1245,6 +1245,15 @@ ValidationArtistMessage QLabel {
background: transparent;
}

#PluginDetailsContent {
background: {color:bg-inputs};
border-radius: 0.2em;
}
#PluginDetailsContent #PluginLabel {
font-size: 14pt;
font-weight: bold;
}

CreateNextPageOverlay {
font-size: 32pt;
}
Expand Down
14 changes: 13 additions & 1 deletion client/ayon_core/tools/publisher/models/publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def get_report(
"crashed_file_paths": crashed_file_paths,
"id": uuid.uuid4().hex,
"created_at": now.isoformat(),
"report_version": "1.0.1",
"report_version": "1.1.0",
}

def _add_plugin_data_item(self, plugin: pyblish.api.Plugin):
Expand All @@ -194,11 +194,23 @@ def _create_plugin_data_item(
if hasattr(plugin, "label"):
label = plugin.label

plugin_type = "instance" if plugin.__instanceEnabled__ else "context"
# Get docstring
# NOTE we do care only about docstring from the plugin so we can't
# use 'inspect.getdoc' which also looks for docstring in parent
# classes.
docstring = getattr(plugin, "__doc__", None)
if docstring:
docstring = inspect.cleandoc(docstring)
return {
"id": plugin.id,
"name": plugin.__name__,
"label": label,
"order": plugin.order,
"filepath": inspect.getfile(plugin),
"docstring": docstring,
"plugin_type": plugin_type,
"families": list(plugin.families),
"targets": list(plugin.targets),
"instances_data": [],
"actions_data": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ def __init__(self, plugin_data):
self.skipped = plugin_data["skipped"]
self.passed = plugin_data["passed"]

# Introduced in report '1.1.0'
self.docstring = plugin_data.get("docstring")
self.filepath = plugin_data.get("filepath")
self.plugin_type = plugin_data.get("plugin_type")
self.families = plugin_data.get("families")

errored = False
process_time = 0.0
for instance_data in plugin_data["instances_data"]:
process_time += instance_data["process_time"]
for log_item in instance_data["logs"]:
errored = log_item["type"] == "error"
if errored:
break
if errored:
break

self.process_time = process_time
self.errored = errored

@property
Expand Down
Loading

0 comments on commit 200e04c

Please sign in to comment.