mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
allow to enable/disable logs suspending on stard with env variable PYBLISH_SUSPEND_LOGS
This commit is contained in:
parent
c5e1a17b1a
commit
4bf91e026f
2 changed files with 19 additions and 2 deletions
|
|
@ -309,3 +309,12 @@ class OrderGroups:
|
|||
return group_range
|
||||
|
||||
return float(group_range)
|
||||
|
||||
|
||||
def env_variable_to_bool(env_key):
|
||||
value = os.environ.get(env_key)
|
||||
if value is not None:
|
||||
value = value.lower()
|
||||
if value in ("true", "1", "yes"):
|
||||
return True
|
||||
return False
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ class Window(QtWidgets.QDialog):
|
|||
super(Window, self).__init__(parent=parent)
|
||||
|
||||
self._suspend_logs = False
|
||||
|
||||
# Use plastique style for specific ocations
|
||||
# TODO set style name via environment variable
|
||||
low_keys = {
|
||||
|
|
@ -511,6 +512,10 @@ class Window(QtWidgets.QDialog):
|
|||
|
||||
self.tabs[current_page].setChecked(True)
|
||||
|
||||
self.apply_log_suspend_value(
|
||||
util.env_variable_to_bool("PYBLISH_SUSPEND_LOGS")
|
||||
)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
#
|
||||
# Event handlers
|
||||
|
|
@ -633,8 +638,11 @@ class Window(QtWidgets.QDialog):
|
|||
self.footer_button_play.setEnabled(False)
|
||||
self.footer_button_stop.setEnabled(False)
|
||||
|
||||
def on_suspend_clicked(self):
|
||||
self._suspend_logs = not self._suspend_logs
|
||||
def on_suspend_clicked(self, value=None):
|
||||
self.apply_log_suspend_value(not self._suspend_logs)
|
||||
|
||||
def apply_log_suspend_value(self, value):
|
||||
self._suspend_logs = value
|
||||
if self.state["current_page"] == "terminal":
|
||||
self.on_tab_changed("overview")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue