Beispiel #1
0
def celery_beat(ctx, level='debug', schedule=None):
    """Run the Celery process."""
    # beat sets up a cron like scheduler, refer to website/settings
    cmd = 'celery beat -A framework.celery_tasks -l {0} --pidfile='.format(level)
    if schedule:
        cmd = cmd + ' --schedule={}'.format(schedule)
    ctx.run(bin_prefix(cmd), pty=True)
Beispiel #2
0
def celery_beat(level="debug", schedule=None):
    """Run the Celery process."""
    # beat sets up a cron like scheduler, refer to website/settings
    cmd = 'celery beat -A framework.celery_tasks -l {0}'.format(level)
    if schedule:
        cmd = cmd + ' --schedule={}'.format(schedule)
    run(bin_prefix(cmd), pty=True)
Beispiel #3
0
def test_module(module=None, verbosity=2):
    """Helper for running tests.
    """
    # Allow selecting specific submodule
    module_fmt = ' '.join(module) if isinstance(module, list) else module
    args = " --verbosity={0} -s {1}".format(verbosity, module_fmt)
    # Use pty so the process buffers "correctly"
    run(bin_prefix(TEST_CMD) + args, pty=True)
Beispiel #4
0
def test_module(ctx, module=None, verbosity=2):
    """Helper for running tests.
    """
    # Allow selecting specific submodule
    module_fmt = ' '.join(module) if isinstance(module, list) else module
    args = ' --verbosity={0} -s {1}'.format(verbosity, module_fmt)
    # Use pty so the process buffers "correctly"
    ctx.run(bin_prefix(TEST_CMD) + args, pty=True)
Beispiel #5
0
def celery_worker(level="debug", hostname=None, beat=False):
    """Run the Celery process."""
    cmd = 'celery worker -A framework.celery_tasks -l {0}'.format(level)
    if hostname:
        cmd = cmd + ' --hostname={}'.format(hostname)
    # beat sets up a cron like scheduler, refer to website/settings
    if beat:
        cmd = cmd + ' --beat'
    run(bin_prefix(cmd), pty=True)
Beispiel #6
0
def celery_worker(ctx, level='debug', hostname=None, beat=False):
    """Run the Celery process."""
    cmd = 'celery worker -A framework.celery_tasks -l {0}'.format(level)
    if hostname:
        cmd = cmd + ' --hostname={}'.format(hostname)
    # beat sets up a cron like scheduler, refer to website/settings
    if beat:
        cmd = cmd + ' --beat'
    ctx.run(bin_prefix(cmd), pty=True)
Beispiel #7
0
def addon_requirements():
    """Install all addon requirements."""
    for directory in os.listdir(settings.ADDON_PATH):
        path = os.path.join(settings.ADDON_PATH, directory)
        if os.path.isdir(path):
            try:
                requirements_file = os.path.join(path, 'requirements.txt')
                open(requirements_file)
                print('Installing requirements for {0}'.format(directory))
                cmd = 'pip install --exists-action w --upgrade -r {0}'.format(requirements_file)
                if WHEELHOUSE_PATH:
                    cmd += ' --no-index --find-links={}'.format(WHEELHOUSE_PATH)
                run(bin_prefix(cmd))
            except IOError:
                pass
    print('Finished')
Beispiel #8
0
def mailserver(port=1025):
    """Run a SMTP test server."""
    cmd = 'python -m smtpd -n -c DebuggingServer localhost:{port}'.format(
        port=port)
    run(bin_prefix(cmd), pty=True)
Beispiel #9
0
def mailserver(ctx, port=1025):
    """Run a SMTP test server."""
    cmd = 'python -m smtpd -n -c DebuggingServer localhost:{port}'.format(port=port)
    ctx.run(bin_prefix(cmd), pty=True)