1 # This file is part of Indico.
2 # Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
4 # Indico is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License as
6 # published by the Free Software Foundation; either version 3 of the
7 # License, or (at your option) any later version.
9 # Indico is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with Indico; if not, see <http://www.gnu.org/licenses/>.
17 from __future__
import unicode_literals
19 from celery
.signals
import import_modules
21 from indico
.core
import signals
22 from indico
.core
.celery
.core
import IndicoCelery
23 from indico
.util
.i18n
import _
24 from indico
.web
.flask
.util
import url_for
29 #: The Celery instance for all Indico tasks
30 celery
= IndicoCelery('indico')
33 @signals.app_created
.connect
34 def _load_default_modules(app
, **kwargs
):
35 celery
.loader
.import_default_modules() # load all tasks
38 @import_modules.connect
39 def _import_modules(*args
, **kwargs
):
40 signals
.import_tasks
.send()
43 @signals.admin_sidemenu
.connect
44 def _extend_admin_menu(sender
, **kwargs
):
45 from MaKaC
.webinterface
.wcomponents
import SideMenuItem
46 return 'celery', SideMenuItem(_("Tasks"), url_for('celery.index'))