Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4010 from pypeclub/feature/publish_report_viewer_…
Browse files Browse the repository at this point in the history
…tool

Publish report viewer tool
  • Loading branch information
iLLiCiTiT authored Oct 20, 2022
2 parents 71a5045 + 8fb9dd4 commit 2728069
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openpype/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ def projectmanager():
PypeCommands().launch_project_manager()


@main.command(context_settings={"ignore_unknown_options": True})
def publish_report_viewer():
from openpype.tools.publisher.publish_report_viewer import main

sys.exit(main())


@main.command()
@click.argument("output_path")
@click.option("--project", help="Define project context")
Expand Down
11 changes: 11 additions & 0 deletions openpype/tools/publisher/publish_report_viewer/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from Qt import QtWidgets

from .report_items import (
PublishReport
)
Expand All @@ -16,4 +18,13 @@
"PublishReportViewerWidget",

"PublishReportViewerWindow",

"main",
)


def main():
app = QtWidgets.QApplication([])
window = PublishReportViewerWindow()
window.show()
return app.exec_()
40 changes: 40 additions & 0 deletions tools/run_publish_report_viewer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<#
.SYNOPSIS
Helper script OpenPype Tray.
.DESCRIPTION
.EXAMPLE
PS> .\run_tray.ps1
#>
$current_dir = Get-Location
$script_dir = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
$openpype_root = (Get-Item $script_dir).parent.FullName

# Install PSWriteColor to support colorized output to terminal
$env:PSModulePath = $env:PSModulePath + ";$($openpype_root)\tools\modules\powershell"

$env:_INSIDE_OPENPYPE_TOOL = "1"

# make sure Poetry is in PATH
if (-not (Test-Path 'env:POETRY_HOME')) {
$env:POETRY_HOME = "$openpype_root\.poetry"
}
$env:PATH = "$($env:PATH);$($env:POETRY_HOME)\bin"

Set-Location -Path $openpype_root

Write-Color -Text ">>> ", "Reading Poetry ... " -Color Green, Gray -NoNewline
if (-not (Test-Path -PathType Container -Path "$($env:POETRY_HOME)\bin")) {
Write-Color -Text "NOT FOUND" -Color Yellow
Write-Color -Text "*** ", "We need to install Poetry create virtual env first ..." -Color Yellow, Gray
& "$openpype_root\tools\create_env.ps1"
} else {
Write-Color -Text "OK" -Color Green
}

& "$($env:POETRY_HOME)\bin\poetry" run python "$($openpype_root)\start.py" publish-report-viewer --debug
Set-Location -Path $current_dir

0 comments on commit 2728069

Please sign in to comment.