Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Look for a ``.startproject_boilerplate`` file the given path and parse it.

Return a list of 3-part tuples, each containing a boilerplate variable,
optional description and default value.

If no file was found (or no lines contained boilerplate variables), return
an empty list.

        def get_boilerplate(path, project_name):
    """
    Look for a ``.startproject_boilerplate`` file the given path and parse it.
    
    Return a list of 3-part tuples, each containing a boilerplate variable,
    optional description and default value.
    
    If no file was found (or no lines contained boilerplate variables), return
    an empty list.
    
    """
    defaults = {}
    defaults_path = os.path.join(path, '.scaffold_defaults')
    if os.path.isfile(defaults_path):
        defaults_file = open(defaults_path, 'r')
        for line in defaults_file:
            match = re.match(r'\s*(\w+)\s*(.*)$', line)
            if match:
                var, default = match.groups()
                defaults[var] = default
    boilerplate = []
    boilerplate_path = os.path.join(path, '.scaffold_boilerplate')
    if os.path.isfile(boilerplate_path):
        boilerplate_file = open(boilerplate_path, 'r')
        for line in boilerplate_file:
            match = re.match(r'\s*(\w+)\s*(.*)$', line)
            if match:
                var, description = match.groups()
                default = defaults.get(var)
                boilerplate.append((var, description, default))
    return boilerplate
        


src/d/j/dj-scaffold-1.0.6/dj_scaffold/startproject.py   dj-scaffold(Download)
    # Get any boilerplate replacement variables:
    replace = {}
    for var, help, default in utils.get_boilerplate(src, project_name):
        help = help or var
        if default is not None:

src/d/j/dj-scaffold-HEAD/dj_scaffold/startproject.py   dj-scaffold(Download)
    # Get any boilerplate replacement variables:
    replace = {}
    for var, help, default in utils.get_boilerplate(src, project_name):
        help = help or var
        if default is not None: