(path, project_name)
return boilerplate
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.
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.
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, '.startproject_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, '.startproject_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
def get_boilerplate ( path , project_name ) : defaults = { } defaults_path = os . path . join ( path , '.startproject_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 , '.startproject_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