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 #1888 from tokejepsen/feature/disregard_publishing…
Browse files Browse the repository at this point in the history
…_time
  • Loading branch information
mkolar authored Aug 25, 2021
2 parents 53f504c + e5f58b2 commit 869d05d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
15 changes: 15 additions & 0 deletions openpype/plugins/publish/start_timer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import pyblish.api

from openpype.api import get_system_settings
from openpype.lib import change_timer_to_current_context


class StartTimer(pyblish.api.ContextPlugin):
label = "Start Timer"
order = pyblish.api.IntegratorOrder + 1
hosts = ["*"]

def process(self, context):
modules_settings = get_system_settings()["modules"]
if modules_settings["timers_manager"]["disregard_publishing"]:
change_timer_to_current_context()
19 changes: 19 additions & 0 deletions openpype/plugins/publish/stop_timer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import os
import requests

import pyblish.api

from openpype.api import get_system_settings


class StopTimer(pyblish.api.ContextPlugin):
label = "Stop Timer"
order = pyblish.api.ExtractorOrder - 0.5
hosts = ["*"]

def process(self, context):
modules_settings = get_system_settings()["modules"]
if modules_settings["timers_manager"]["disregard_publishing"]:
webserver_url = os.environ.get("OPENPYPE_WEBSERVER_URL")
rest_api_url = "{}/timers_manager/stop_timer".format(webserver_url)
requests.post(rest_api_url)
5 changes: 3 additions & 2 deletions openpype/settings/defaults/system_settings/modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@
"enabled": true,
"auto_stop": true,
"full_time": 15.0,
"message_time": 0.5
"message_time": 0.5,
"disregard_publishing": false
},
"clockify": {
"enabled": false,
Expand Down Expand Up @@ -173,4 +174,4 @@
"slack": {
"enabled": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
"decimal": 2,
"key": "message_time",
"label": "When dialog will show"
},
{
"type": "boolean",
"key": "disregard_publishing",
"label": "Disregard Publishing"
}
]
},
Expand Down

0 comments on commit 869d05d

Please sign in to comment.