# Path: topoflow/utils/template_files.py
# def get_replacements( var_names=None, values=None, method='RE'):
# def replace( cfg_template_file, new_cfg_file, dictionary=None,
#              method='RE'):
#     RE_METHOD     = (method == 'RE')
#     STRING_METHOD = not(RE_METHOD)


import os
from topoflow.utils import template_files
#
#-------------------------------------------------------------------------
def get_replacement_dictionary( var_names=None, values=None,
                                method='RE'):

    #-----------------------
    # Defaults for testing
    #-----------------------
    if (var_names == None):
        if (method == 'RE'):
            var_names=['${var1}','${var2}']
        else:
            var_names=['var1','var2']
    if (values == None):
        values = [3.141, 2.718]
        
    #-------------------------------------
    # Store replacements in a dictionary
    #-------------------------------------
    d = dict( zip( var_names, values ) )
    return d

#   get_replacement_dictionary()
#-------------------------------------------------------------------------
def make_test_template( template_file=None ):

    if (template_file == None):
        template_file='Model_config_file_template.cfg.in'
        
    template_unit = open( template_file, 'w' )

# Path: topoflow/utils/template_files.py
# def get_replacements( var_names=None, values=None, method='RE'):
# def replace( cfg_template_file, new_cfg_file, dictionary=None,
#              method='RE'):
#     RE_METHOD     = (method == 'RE')
#     STRING_METHOD = not(RE_METHOD)


# Path: topoflow/utils/tests/test_template_files.py
import os
from topoflow.utils import template_files

#
#-------------------------------------------------------------------------
def get_replacement_dictionary( var_names=None, values=None,
                                method='RE'):

    #-----------------------
    # Defaults for testing
    #-----------------------
    if (var_names == None):
        if (method == 'RE'):
            var_names=['${var1}','${var2}']
        else:
            var_names=['var1','var2']
    if (values == None):
        values = [3.141, 2.718]
        
    #-------------------------------------
    # Store replacements in a dictionary
    #-------------------------------------
    d = dict( zip( var_names, values ) )
    return d

#   get_replacement_dictionary()
#-------------------------------------------------------------------------
def make_test_template( template_file=None ):

    if (template_file == None):
        template_file='Model_config_file_template.cfg.in'
        
    template_unit = open( template_file, 'w' )

    lines = ['Configuration file template for a fake model\n',