Ejemplo n.º 1
0
Archivo: manage.py Proyecto: timka/Clay
def new(path='.', template=None):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    template = template or SKELETON
    render_skeleton(template, path, include_this=['.gitignore'])
    print(SKELETON_HELP % (path,))
Ejemplo n.º 2
0
def new_project(path, tmpl=None, **options):
    data = default_context.copy()
    data['package'] = basename(path)
    tmpl = tmpl or SKELETON_PATH
    print(tmpl, path)
    render_skeleton(tmpl, path, data=data,
                    include_this=['.gittouch'], **options)
Ejemplo n.º 3
0
def new(path='.', template=None):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    template = template or DEFAULT_TEMPLATE_URL
    render_skeleton(template, path, include_this=['.gitignore'])
    print(HELP_MSG % (path,))
Ejemplo n.º 4
0
def render(dst, **kwargs):
    data = {
        'package': 'demo',
        'py3': True,
        'make_secret': lambda: sha1(urandom(48)).hexdigest()
    }
    kwargs.setdefault('quiet', True)
    voodoo.render_skeleton(SKELETON_PATH, dst, data=data, **kwargs)
Ejemplo n.º 5
0
def new_project(path, tmpl=None, **options):
    data = default_context.copy()
    data['package'] = basename(path)
    tmpl = tmpl or SKELETON_PATH
    print(tmpl, path)
    render_skeleton(tmpl,
                    path,
                    data=data,
                    include_this=['.gittouch'],
                    **options)
Ejemplo n.º 6
0
def new_project(path, options):
    data = default_context.copy()

    yaml_filename = options.pop('config')
    print("Loading configuration from %s" % yaml_filename)
    with open(yaml_filename) as f:
        config_dict = yaml.load(f)

    data = get_merged_dict(data, config_dict)    
    #data['project_name'] = prompt("Project name", basename(path))
    #data['project_title'] = prompt("Project title", data['project_name'])
    render_skeleton(SKELETON_PATH, path, data=data, **options)
    return data
Ejemplo n.º 7
0
def new(path='.', template=None):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    template = template or DEFAULT_TEMPLATE_URL
    render_skeleton(
        template, path,
        include_this=['.gitignore'],
        filter_this=[
            '~*', '*.py[co]',
            '__pycache__', '__pycache__/*',
            '.git', '.git/*',
            '.hg', '.hg/*',
            '.svn', '.svn/*',
        ]
    )
    print(HELP_MSG % (path,))
Ejemplo n.º 8
0
def new(path='.', template=None):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    template = template or DEFAULT_TEMPLATE_URL
    render_skeleton(template,
                    path,
                    include_this=['.gitignore'],
                    filter_this=[
                        '~*',
                        '*.py[co]',
                        '__pycache__',
                        '__pycache__/*',
                        '.git',
                        '.git/*',
                        '.hg',
                        '.hg/*',
                        '.svn',
                        '.svn/*',
                    ])
    print(HELP_MSG % (path, ))
Ejemplo n.º 9
0
def test_skeleton_not_found(dst):
    with pytest.raises(ValueError):
        voodoo.render_skeleton('foobar', dst)
    with pytest.raises(ValueError):
        voodoo.render_skeleton(__file__, dst)
Ejemplo n.º 10
0
def new(path='.'):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    render_skeleton(SKELETON, path, include_this=['.gitignore'])
    print(SKELETON_HELP % (path,))
Ejemplo n.º 11
0
def render(dst, **kwargs):
    kwargs.setdefault('quiet', True)
    voodoo.render_skeleton(SKELETON_PATH, dst, data=DATA, **kwargs)
Ejemplo n.º 12
0
def new(path='.'):
    """Creates a new project
    """
    path = abspath(path.rstrip(sep))
    render_skeleton(SKELETON, path, include_this=['.gitignore'])
    print(SKELETON_HELP % (path, ))
Ejemplo n.º 13
0
def test_skeleton_not_found(dst):
    with pytest.raises(ValueError):
        voodoo.render_skeleton('foobar', dst)
    with pytest.raises(ValueError):
        voodoo.render_skeleton(__file__, dst)
Ejemplo n.º 14
0
def new_project(path, options):
    data = default_context.copy()
    data['package'] = basename(path)
    # print(SKELETON_PATH, path, data, options)
    render_skeleton(SKELETON_PATH, path, data=data,
                    include_this=['.gittouch'], **options)