Exemplo n.º 1
0
    # This is never executed, but tricks static analyzers (PyDev, PyCharm,
    # pylint, etc.) into knowing the types of these symbols, and what
    # they contain.
    from celery.canvas import group, chord, subtask
    from .base import BaseTask, Task, PeriodicTask, task, periodic_task
    from .sets import TaskSet


class module(MagicModule):
    def __call__(self, *args, **kwargs):
        return self.task(*args, **kwargs)


old_module, new_module = recreate_module(
    __name__,  # pragma: no cover
    by_module={
        'celery.task.base':
        ['BaseTask', 'Task', 'PeriodicTask', 'task', 'periodic_task'],
        'celery.canvas': ['group', 'chord', 'subtask'],
        'celery.task.sets': ['TaskSet'],
    },
    base=module,
    __package__='celery.task',
    __file__=__file__,
    __path__=__path__,
    __doc__=__doc__,
    current=current,
    discard_all=Proxy(lambda: current_app.control.purge),
    backend_cleanup=Proxy(lambda: current_app.tasks['celery.backend_cleanup']),
)
Exemplo n.º 2
0
# Lazy loading
from celery import five  # noqa

old_module, new_module = five.recreate_module(  # pragma: no cover
    __name__,
    by_module={
        'celery.app': ['Celery', 'bugreport', 'shared_task'],
        'celery.app.task': ['Task'],
        'celery._state': ['current_app', 'current_task'],
        'celery.canvas': [
            'Signature', 'chain', 'chord', 'chunks', 'group',
            'signature', 'maybe_signature', 'subtask',
            'xmap', 'xstarmap',
        ],
        'celery.utils': ['uuid'],
    },
    direct={'task': 'celery.task'},
    __package__='celery', __file__=__file__,
    __path__=__path__, __doc__=__doc__, __version__=__version__,
    __author__=__author__, __contact__=__contact__,
    __homepage__=__homepage__, __docformat__=__docformat__, five=five,
    VERSION=VERSION, SERIES=SERIES, VERSION_BANNER=VERSION_BANNER,
    version_info_t=version_info_t,
    version_info=version_info,
    maybe_patch_concurrency=maybe_patch_concurrency,
    _find_option_with_arg=_find_option_with_arg,
    absolute_import=absolute_import,
    unicode_literals=unicode_literals,
    print_function=print_function,
)
Exemplo n.º 3
0
# Lazy loading
from celery import five  # noqa

old_module, new_module = five.recreate_module(  # pragma: no cover
    __name__,
    by_module={
        'celery.app': ['Celery', 'bugreport', 'shared_task'],
        'celery.app.task': ['Task'],
        'celery._state': ['current_app', 'current_task'],
        'celery.canvas': [
            'chain', 'chord', 'chunks', 'group',
            'signature', 'maybe_signature', 'subtask',
            'xmap', 'xstarmap',
        ],
        'celery.utils': ['uuid'],
    },
    direct={'task': 'celery.task'},
    __package__='celery', __file__=__file__,
    __path__=__path__, __doc__=__doc__, __version__=__version__,
    __author__=__author__, __contact__=__contact__,
    __homepage__=__homepage__, __docformat__=__docformat__, five=five,
    VERSION=VERSION, SERIES=SERIES, VERSION_BANNER=VERSION_BANNER,
    version_info_t=version_info_t,
    version_info=version_info,
    maybe_patch_concurrency=maybe_patch_concurrency,
    _find_option_with_arg=_find_option_with_arg,
    absolute_import=absolute_import,
    unicode_literals=unicode_literals,
    print_function=print_function,
)
Exemplo n.º 4
0
    # pylint, etc.) into knowing the types of these symbols, and what
    # they contain.
    from celery.canvas import group, chord, subtask
    from .base import BaseTask, Task, PeriodicTask, task, periodic_task


class module(LazyModule):

    def __call__(self, *args, **kwargs):
        return self.task(*args, **kwargs)


old_module, new_module = recreate_module(  # pragma: no cover
    __name__,
    by_module={
        'celery.task.base': ['BaseTask', 'Task', 'PeriodicTask',
                             'task', 'periodic_task'],
        'celery.canvas': ['group', 'chord', 'subtask'],
    },
    base=module,
    __package__='celery.task',
    __file__=__file__,
    __path__=__path__,
    __doc__=__doc__,
    current=current,
    discard_all=Proxy(lambda: current_app.control.purge),
    backend_cleanup=Proxy(
        lambda: current_app.tasks['celery.backend_cleanup']
    ),
)
Exemplo n.º 5
0
old_module, new_module = five.recreate_module(  # pragma: no cover
    __name__,
    by_module={
        "celery.app": ["Celery", "bugreport", "shared_task"],
        "celery.app.task": ["Task"],
        "celery._state": ["current_app", "current_task"],
        "celery.canvas": [
            "Signature",
            "chain",
            "chord",
            "chunks",
            "group",
            "signature",
            "maybe_signature",
            "subtask",
            "xmap",
            "xstarmap",
        ],
        "celery.utils": ["uuid"],
    },
    direct={"task": "celery.task"},
    __package__="celery",
    __file__=__file__,
    __path__=__path__,
    __doc__=__doc__,
    __version__=__version__,
    __author__=__author__,
    __contact__=__contact__,
    __homepage__=__homepage__,
    __docformat__=__docformat__,
    five=five,
    VERSION=VERSION,
    SERIES=SERIES,
    VERSION_BANNER=VERSION_BANNER,
    version_info_t=version_info_t,
    version_info=version_info,
    maybe_patch_concurrency=maybe_patch_concurrency,
    _find_option_with_arg=_find_option_with_arg,
    absolute_import=absolute_import,
    unicode_literals=unicode_literals,
    print_function=print_function,
)
Exemplo n.º 6
0
STATICA_HACK = True
globals()["kcah_acitats"[::-1].upper()] = False
if STATICA_HACK:  # pragma: no cover
    # This is never executed, but tricks static analyzers (PyDev, PyCharm,
    # pylint, etc.) into knowing the types of these symbols, and what
    # they contain.
    from celery.canvas import group, chord, subtask
    from .base import BaseTask, Task, PeriodicTask, task, periodic_task


class module(LazyModule):
    def __call__(self, *args, **kwargs):
        return self.task(*args, **kwargs)


old_module, new_module = recreate_module(  # pragma: no cover
    __name__,
    by_module={
        "celery.task.base": ["BaseTask", "Task", "PeriodicTask", "task", "periodic_task"],
        "celery.canvas": ["group", "chord", "subtask"],
    },
    base=module,
    __package__="celery.task",
    __file__=__file__,
    __path__=__path__,
    __doc__=__doc__,
    current=current,
    discard_all=Proxy(lambda: current_app.control.purge),
    backend_cleanup=Proxy(lambda: current_app.tasks["celery.backend_cleanup"]),
)
Exemplo n.º 7
0
old_module, new_module = five.recreate_module(  # pragma: no cover
    __name__,
    by_module={
        "celery.app": ["Celery", "bugreport", "shared_task"],
        "celery.app.task": ["Task"],
        "celery._state": ["current_app", "current_task"],
        "celery.canvas": [
            "chain",
            "chord",
            "chunks",
            "group",
            "signature",
            "maybe_signature",
            "subtask",
            "xmap",
            "xstarmap",
        ],
        "celery.utils": ["uuid"],
    },
    direct={"task": "celery.task"},
    __package__="celery",
    __file__=__file__,
    __path__=__path__,
    __doc__=__doc__,
    __version__=__version__,
    __author__=__author__,
    __contact__=__contact__,
    __homepage__=__homepage__,
    __docformat__=__docformat__,
    five=five,
    VERSION=VERSION,
    SERIES=SERIES,
    VERSION_BANNER=VERSION_BANNER,
    version_info_t=version_info_t,
    maybe_patch_concurrency=maybe_patch_concurrency,
    _find_option_with_arg=_find_option_with_arg,
)