def upgrade_config(config, config_path=os.path.expanduser('~/.jrnl_conf')):
 missing_keys = set(default_config).difference(config)
 if missing_keys:
  for key in missing_keys:
   config[key] = default_config[key]
  with open(config_path, 'w') as f:
   json.dump(config, f, indent=2)
  print '[.jrnl_conf updated to newest version]'

def upgrade_config ( config , config_path = os . path . expanduser ( '~/.jrnl_conf' ) ) : missing_keys = set ( default_config ) . difference ( config ) if missing_keys : for key in missing_keys : config [ key ] = default_config [ key ] with open ( config_path , 'w' ) as f : json . dump ( config , f , indent = 2 ) print '[.jrnl_conf updated to newest version]'
checks if there are keys missing in a given config dict .