Update and enable the scheduler app
This commit is contained in:
@@ -4,7 +4,6 @@ import logging
|
|||||||
import atexit
|
import atexit
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from project_tools.api import register_tool
|
|
||||||
from navigation.api import bind_links
|
from navigation.api import bind_links
|
||||||
|
|
||||||
from .links import scheduler_tool_link, scheduler_list, job_list
|
from .links import scheduler_tool_link, scheduler_list, job_list
|
||||||
@@ -28,7 +27,6 @@ if any([command in sys.argv for command in SHUTDOWN_COMMANDS]):
|
|||||||
# Prevent any new scheduler afterwards to start
|
# Prevent any new scheduler afterwards to start
|
||||||
LocalScheduler.lockdown()
|
LocalScheduler.lockdown()
|
||||||
|
|
||||||
register_tool(scheduler_tool_link)
|
|
||||||
atexit.register(schedule_shutdown_on_exit)
|
atexit.register(schedule_shutdown_on_exit)
|
||||||
bind_links([LocalScheduler, 'scheduler_list', 'job_list'], scheduler_list, menu_name='secondary_menu')
|
bind_links([LocalScheduler, 'scheduler_list', 'job_list'], scheduler_list, menu_name='secondary_menu')
|
||||||
bind_links([LocalScheduler], job_list)
|
bind_links([LocalScheduler], job_list)
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from icons.literals import TIME, TIMELINE_MARKER
|
||||||
|
from icons import Icon
|
||||||
|
|
||||||
|
icon_scheduler_tool_link = Icon(TIME)
|
||||||
|
icon_scheduler_list = Icon(TIME)
|
||||||
|
icon_job_list = Icon(TIMELINE_MARKER)
|
||||||
@@ -5,7 +5,8 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from navigation.api import Link
|
from navigation.api import Link
|
||||||
|
|
||||||
from .permissions import PERMISSION_VIEW_JOB_LIST, PERMISSION_VIEW_SCHEDULER_LIST
|
from .permissions import PERMISSION_VIEW_JOB_LIST, PERMISSION_VIEW_SCHEDULER_LIST
|
||||||
|
from .icons import icon_scheduler_tool_link, icon_scheduler_list, icon_job_list
|
||||||
|
|
||||||
scheduler_tool_link = Link(text=_(u'local schedulers'), view='scheduler_list', icon='time.png', permissions=[PERMISSION_VIEW_SCHEDULER_LIST])
|
scheduler_tool_link = Link(text=_(u'local schedulers'), view='scheduler_list', icon=icon_scheduler_tool_link, permissions=[PERMISSION_VIEW_SCHEDULER_LIST])
|
||||||
scheduler_list = Link(text=_(u'scheduler list'), view='scheduler_list', sprite='time', permissions=[PERMISSION_VIEW_SCHEDULER_LIST])
|
scheduler_list = Link(text=_(u'scheduler list'), view='scheduler_list', icon=icon_scheduler_list, permissions=[PERMISSION_VIEW_SCHEDULER_LIST])
|
||||||
job_list = Link(text=_(u'interval job list'), view='job_list', args='object.name', sprite='timeline_marker', permissions=[PERMISSION_VIEW_JOB_LIST])
|
job_list = Link(text=_(u'interval job list'), view='job_list', args='object.name', icon=icon_job_list, permissions=[PERMISSION_VIEW_JOB_LIST])
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
|
from .icons import icon_scheduler_tool_link
|
||||||
|
from .links import scheduler_tool_link
|
||||||
|
|
||||||
|
label = _(u'Scheduler')
|
||||||
|
description = _(u'Executes timed tasks.')
|
||||||
|
dependencies = ['app_registry', 'icons', 'navigation']
|
||||||
|
icon = icon_scheduler_tool_link
|
||||||
|
tool_links = [scheduler_tool_link]
|
||||||
Reference in New Issue
Block a user