handle igniter dialog

This commit is contained in:
Ondrej Samohel 2021-08-20 18:06:57 +02:00 committed by Ondřej Samohel
parent df310da141
commit 2b11e589c5
No known key found for this signature in database
GPG key ID: 02376E18990A97C6
2 changed files with 13 additions and 3 deletions

View file

@ -1,7 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Progress window to show when OpenPype is updating/installing locally.""" """Progress window to show when OpenPype is updating/installing locally."""
import os import os
import sys
from pathlib import Path from pathlib import Path
from .update_thread import UpdateThread from .update_thread import UpdateThread
from Qt import QtCore, QtGui, QtWidgets # noqa from Qt import QtCore, QtGui, QtWidgets # noqa
@ -12,8 +11,8 @@ def load_stylesheet(path: str = None) -> str:
"""Load css style sheet. """Load css style sheet.
Args: Args:
path (str, optional): Path to stylesheet. If none, `stylesheet.css` from path (str, optional): Path to stylesheet. If none, `stylesheet.css`
current package's path is used. from current package's path is used.
Returns: Returns:
str: content of the stylesheet str: content of the stylesheet

View file

@ -397,6 +397,9 @@ def _process_arguments() -> tuple:
# handle igniter # handle igniter
# this is helper to run igniter before anything else # this is helper to run igniter before anything else
if "igniter" in sys.argv: if "igniter" in sys.argv:
if os.getenv("OPENPYPE_HEADLESS"):
_print("!!! Cannot open Igniter dialog in headless mode.")
sys.exit(1)
import igniter import igniter
return_code = igniter.open_dialog() return_code = igniter.open_dialog()
@ -444,6 +447,11 @@ def _determine_mongodb() -> str:
if not openpype_mongo: if not openpype_mongo:
_print("*** No DB connection string specified.") _print("*** No DB connection string specified.")
if os.getenv("OPENPYPE_HEADLESS"):
_print("!!! Cannot open Igniter dialog in headless mode.")
_print(
"!!! Please use `OPENPYPE_MONGO` to specify server address.")
sys.exit(1)
_print("--- launching setup UI ...") _print("--- launching setup UI ...")
result = igniter.open_dialog() result = igniter.open_dialog()
@ -547,6 +555,9 @@ def _find_frozen_openpype(use_version: str = None,
except IndexError: except IndexError:
# no OpenPype version found, run Igniter and ask for them. # no OpenPype version found, run Igniter and ask for them.
_print('*** No OpenPype versions found.') _print('*** No OpenPype versions found.')
if os.getenv("OPENPYPE_HEADLESS"):
_print("!!! Cannot open Igniter dialog in headless mode.")
sys.exit(1)
_print("--- launching setup UI ...") _print("--- launching setup UI ...")
import igniter import igniter
return_code = igniter.open_dialog() return_code = igniter.open_dialog()