mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 16:58:12 +00:00
Add simple notifications on job errors, completion and start. (#46)
This commit is contained in:
@@ -4,10 +4,11 @@ import socket
|
||||
import time
|
||||
import zipfile
|
||||
|
||||
from plyer import notification
|
||||
from pubsub import pub
|
||||
|
||||
from src.render_queue import RenderQueue
|
||||
from src.api.server_proxy import RenderServerProxy
|
||||
from src.render_queue import RenderQueue
|
||||
from src.utilities.misc_helper import get_file_size_human
|
||||
from src.utilities.status_utils import RenderStatus, string_to_status
|
||||
from src.utilities.zeroconf_server import ZeroconfServer
|
||||
@@ -55,6 +56,29 @@ class DistributedJobManager:
|
||||
# todo: handle cancelling all the children
|
||||
pass
|
||||
|
||||
# UI Notifications
|
||||
if new_status == RenderStatus.COMPLETED:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Complete',
|
||||
message=f'Render completed for {render_job.name}',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.ERROR:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Failed',
|
||||
message=f'Failed rendering {render_job.name}',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
elif new_status == RenderStatus.RUNNING:
|
||||
logger.debug("show render complete notification")
|
||||
notification.notify(
|
||||
title='Render Job Started',
|
||||
message=f'Render started for {render_job.name}',
|
||||
timeout=10 # Display time in seconds
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def handle_subjob_status_change(cls, local_job, subjob_data):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user