import sublime, string, platform

def expand_variables(the_dict, the_vars):
    return _expand_variables_recursive(the_dict, the_vars)

def _expand_variables_recursive(the_dict, the_vars):
    for key, value in the_dict.items():
        if isinstance(value, dict):
            value = expand_variables(value, the_vars)
        elif isinstance(value, str):
            the_dict[key] = string.Template(value).substitute(the_vars)
        else:
            continue
    return the_dict


import sublime, string, platform

def expand_variables(the_dict, the_vars):
    the_vars['machine'] = platform.machine()
    the_vars['processor'] = platform.processor()
    return _expand_variables_recursive(the_dict, the_vars)

def _expand_variables_recursive(the_dict, the_vars):
    for key, value in the_dict.items():
        if isinstance(value, dict):
            value = expand_variables(value, the_vars)
        elif isinstance(value, str):
            the_dict[key] = string.Template(value).substitute(the_vars)
        else:
            continue
    return the_dict


Add extra vars "machine" and "processor" for the cmake dictionary.
Add extra vars "machine" and "processor" for the cmake dictionary.

  import sublime, string, platform
  
  def expand_variables(the_dict, the_vars):
+     the_vars['machine'] = platform.machine()
+     the_vars['processor'] = platform.processor()
      return _expand_variables_recursive(the_dict, the_vars)
  
  def _expand_variables_recursive(the_dict, the_vars):
      for key, value in the_dict.items():
          if isinstance(value, dict):
              value = expand_variables(value, the_vars)
          elif isinstance(value, str):
              the_dict[key] = string.Template(value).substitute(the_vars)
          else:
              continue
      return the_dict
  
  
Add extra vars "machine" and "processor" for the cmake dictionary.
## Code Before:
import sublime, string, platform

def expand_variables(the_dict, the_vars):
    return _expand_variables_recursive(the_dict, the_vars)

def _expand_variables_recursive(the_dict, the_vars):
    for key, value in the_dict.items():
        if isinstance(value, dict):
            value = expand_variables(value, the_vars)
        elif isinstance(value, str):
            the_dict[key] = string.Template(value).substitute(the_vars)
        else:
            continue
    return the_dict


## Instruction:
Add extra vars "machine" and "processor" for the cmake dictionary.
## Code After:
import sublime, string, platform

def expand_variables(the_dict, the_vars):
    the_vars['machine'] = platform.machine()
    the_vars['processor'] = platform.processor()
    return _expand_variables_recursive(the_dict, the_vars)

def _expand_variables_recursive(the_dict, the_vars):
    for key, value in the_dict.items():
        if isinstance(value, dict):
            value = expand_variables(value, the_vars)
        elif isinstance(value, str):
            the_dict[key] = string.Template(value).substitute(the_vars)
        else:
            continue
    return the_dict

