# Path: mrq/context.py
# def setup_context(**kwargs):
#     """ Setup MRQ's environment.
# 
#         Note: gevent should probably be initialized too if you want to use concurrency.
#     """
#     set_current_config(get_config(**kwargs))
# 
# def run_task(path, params):
#     """ Runs a task code synchronously """
#     task_class = load_class_by_path(path)
#     return task_class().run_wrapped(params)
# 
# def get_current_config():
#     if not _GLOBAL_CONTEXT["config"]:
#         log.warning("get_current_config was called before setup of MRQ's environment. "
#                     "Use context.setup_context() for setting up MRQ's environment.")
#     return _GLOBAL_CONTEXT["config"]


from mrq.context import setup_context, run_task, get_current_config
from __future__ import print_function

# Autoconfigure MRQ's environment
setup_context()

print(run_task("tests.tasks.general.Add", {"a": 41, "b": 1}))


# Path: mrq/context.py
# def setup_context(**kwargs):
#     """ Setup MRQ's environment.
# 
#         Note: gevent should probably be initialized too if you want to use concurrency.
#     """
#     set_current_config(get_config(**kwargs))
# 
# def run_task(path, params):
#     """ Runs a task code synchronously """
#     task_class = load_class_by_path(path)
#     return task_class().run_wrapped(params)
# 
# def get_current_config():
#     if not _GLOBAL_CONTEXT["config"]:
#         log.warning("get_current_config was called before setup of MRQ's environment. "
#                     "Use context.setup_context() for setting up MRQ's environment.")
#     return _GLOBAL_CONTEXT["config"]


# Path: tests/fixtures/standalone_script1.py
from mrq.context import setup_context, run_task, get_current_config

from __future__ import print_function

# Autoconfigure MRQ's environment
setup_context()

print(run_task("tests.tasks.general.Add", {"a": 41, "b": 1}))


print(get_current_config()["name"])