# Path: termicoder/utils/logging.py



import click
import subprocess
from .logging import logger
        subprocess.run(args, check=True)


# returns (is_subsituted, args)
# substitute the markup strings ie {{..}}; in arguments
def substitute(args, keymap):
    logger.debug('in substitute args')
    logger.debug(args)
    logger.debug(keymap)
    if args not in [None, '', []]:
        if(not (isinstance(args, list))):
            logger.debug('executed base')
            final_args = args[:]
            for key in keymap:
                value = keymap[key]
                final_args = final_args.replace("{{%s}}" % key, str(value))
                logger.debug('final_args')
                logger.debug(final_args)
            status = final_args != args
        else:
            status1, temp_arg = substitute(args[0], keymap)
            status2, temp_arg1 = substitute(args[1:], keymap)
            if(temp_arg1 not in [None, '', []]):
                final_args = [temp_arg]
                final_args.extend(temp_arg1)
            else:
                final_args = [temp_arg]
            status = status1 or status2
            logger.debug('ran for')
            logger.debug(args[0])

# Path: termicoder/utils/logging.py



# Path: termicoder/utils/launch.py
import click
import subprocess
from .logging import logger

        subprocess.run(args, check=True)


# returns (is_subsituted, args)
# substitute the markup strings ie {{..}}; in arguments
def substitute(args, keymap):
    logger.debug('in substitute args')
    logger.debug(args)
    logger.debug(keymap)
    if args not in [None, '', []]:
        if(not (isinstance(args, list))):
            logger.debug('executed base')
            final_args = args[:]
            for key in keymap:
                value = keymap[key]
                final_args = final_args.replace("{{%s}}" % key, str(value))
                logger.debug('final_args')
                logger.debug(final_args)
            status = final_args != args
        else:
            status1, temp_arg = substitute(args[0], keymap)
            status2, temp_arg1 = substitute(args[1:], keymap)
            if(temp_arg1 not in [None, '', []]):
                final_args = [temp_arg]
                final_args.extend(temp_arg1)
            else:
                final_args = [temp_arg]
            status = status1 or status2
            logger.debug('ran for')
            logger.debug(args[0])

            logger.debug(args[1:])