tools/cr/cr/base/client.py
def WriteConfig(use_build_dir, data):
  """Writes a configuration out to a file.

  This writes all the key value pairs in data out to a config file.

  Args:
    use_build_dir: True if the config file should be written to the build
        directory. Otherwise it will be written to the root config directory.
    data: The key value pairs to write.
  """
  config_dir = _GetConfigDir(use_build_dir)
  filename = _GetConfigFile(config_dir)
  if cr.context.dry_run:
    print('makedirs', config_dir)
    print('Write config to', filename)
    _WriteConfig(sys.stdout, data)
  else:
    try:
      os.makedirs(config_dir)
    except OSError:
      if not os.path.isdir(config_dir):
        raise
    with open(filename, 'w') as writer:
      _WriteConfig(writer, data)
Writes a configuration out to a file.

  This writes all the key value pairs in data out to a config file.

  Args:
    use_build_dir: True if the config file should be written to the build
        directory. Otherwise it will be written to the root config directory.
    data: The key value pairs to write.
  
Writes a configuration out to a file.
This writes all the key value pairs in data out to a config file.
Writes a configuration out to a file . This writes all the key value pairs in data out to a config file .
def WriteConfig(use_build_dir, data):
  config_dir = _GetConfigDir(use_build_dir)
  filename = _GetConfigFile(config_dir)
  if cr.context.dry_run:
    print('makedirs', config_dir)
    print('Write config to', filename)
    _WriteConfig(sys.stdout, data)
  else:
    try:
      os.makedirs(config_dir)
    except OSError:
      if not os.path.isdir(config_dir):
        raise
    with open(filename, 'w') as writer:
      _WriteConfig(writer, data)
def WriteConfig ( use_build_dir , data ) : config_dir = _GetConfigDir ( use_build_dir ) filename = _GetConfigFile ( config_dir ) if cr . context . dry_run : print ( 'makedirs' , config_dir ) print ( 'Write config to' , filename ) _WriteConfig ( sys . stdout , data ) else : try : os . makedirs ( config_dir ) except OSError : if not os . path . isdir ( config_dir ) : raise with open ( filename , 'w' ) as writer : _WriteConfig ( writer , data )
Writes a configuration out to a file.
Writes a configuration out to a file .
"""Writes a configuration out to a file.

  This writes all the key value pairs in data out to a config file.

  Args:
    use_build_dir: True if the config file should be written to the build
        directory. Otherwise it will be written to the root config directory.
    data: The key value pairs to write.
  """
use_build_dir
True if the config file should be written to the build
directory. Otherwise it will be written to the root config directory.
True if the config file should be written to the build directory . Otherwise it will be written to the root config directory .
data
The key value pairs to write.
The key value pairs to write .