Esempio n. 1
0
File: manage.py Progetto: 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,))
Esempio 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)
Esempio 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,))
Esempio 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)
Esempio 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)
Esempio 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
Esempio 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,))
Esempio 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, ))
Esempio 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)
Esempio 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,))
Esempio n. 11
0
def render(dst, **kwargs):
    kwargs.setdefault('quiet', True)
    voodoo.render_skeleton(SKELETON_PATH, dst, data=DATA, **kwargs)
Esempio 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, ))
Esempio 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)
Esempio 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)