1. Eric Larson
  2. Dad

Source

Dad / pavement.py

import os

from paver.easy import *
from paver.setuputils import setup

import cherrypy


install_requirements = [
    'cherrypy>=3.2',
    'pyyaml',
    'mako',
    'requests',
]

setup(
    name='Dad',
    version='0.1',
    author='Eric Larson',
    author_email='eric@ionrock.org',
    packages=['dad'],
    install_requires=install_requirements,
    entry_points={
        'console_scripts': [
            'dad.web = dad.web.control.root:run_base',
            'dad.master = dad.web.control.root:run_master',
            'dad.client = dad.client.cli:run_cli',
        ]
    }
)


@task
def dev():
    '''Start up a dad server with a single process being managed which
    is the GrandDad server'''
    from pkg_resources import load_entry_point
    dad_web = load_entry_point('dad', 'console_scripts', 'dad.web')
    
    from dad.web.control.root import run
    from dad.lib.config import Config, AppConfig, AppCommand

    run(['-m', 'http://localhost:9000/',
         '-i', 'configs/dev.conf'])


@task
def web():
    from pkg_resources import load_entry_point
    dad_web = load_entry_point('dad', 'console_scripts', 'dad.web')
    os.environ['DAD_MASTER'] = 'http://localhost:9000/register'
    dad_web()

@task
def master():
    from pkg_resources import load_entry_point
    dad_master = load_entry_point('dad', 'console_scripts', 'dad.master')
    dad_master()


@task
def deploy_hello_world():
    bin_dir = path('dad_sandboxes') / 'hello_world' / 'bin'
    bin_dir.makedirs()
    server = path('example') / 'hello_world'
    server.copy(bin_dir)