added module command to openpype cli

This commit is contained in:
iLLiCiTiT 2021-10-12 10:11:54 +02:00
parent 41bb148cae
commit 55c25452cc
2 changed files with 18 additions and 1 deletions

View file

@ -57,7 +57,13 @@ def tray(debug=False):
PypeCommands().launch_tray(debug)
@main.command()
@PypeCommands.add_modules
@main.group(help="Run command line arguments of OpenPype modules")
@click.pass_context
def module(ctx):
pass
@click.option("-d", "--debug", is_flag=True, help="Print debug messages")
@click.option("--ftrack-url", envvar="FTRACK_SERVER",
help="Ftrack server url")

View file

@ -3,6 +3,7 @@
import os
import sys
import json
import click
from datetime import datetime
from openpype.lib import PypeLogger
@ -33,6 +34,16 @@ class PypeCommands:
user_role = "manager"
settings.main(user_role)
@staticmethod
def add_modules(click_func):
from openpype.modules import ModulesManager
manager = ModulesManager()
for module in manager.modules:
if hasattr(module, "cli"):
module.cli(click_func)
return click_func
@staticmethod
def launch_eventservercli(*args):
from openpype_modules.ftrack.ftrack_server.event_server_cli import (