abstract the headless command as function in lib.py

This commit is contained in:
Kayla Man 2023-06-22 19:02:18 +08:00
parent b150e0b6a1
commit 56a90a47f5
2 changed files with 11 additions and 1 deletions

View file

@ -3116,3 +3116,12 @@ def get_viewer_config_from_string(input_string):
).format(input_string))
return (display, viewer)
def is_headless():
"""
Returns:
bool: headless
"""
headless = QtWidgets.QApplication.instance() is None
return headless