components/policy/tools/template_writers/template_formatter.py
def _ParseVersionFile(version_path):
  '''Parse version file, return the version if it exists.

  Args:
    version_path: The path of Chrome VERSION file containing the major version
                  number.
  '''
  version = {}
  with open(version_path) as fp:
    for line in fp:
      key, _, value = line.partition('=')
      if key.strip() == 'MAJOR':
        version['major'] = value.strip()
      elif key.strip() == 'MINOR':
        version['minor'] = value.strip()
      elif key.strip() == 'BUILD':
        version['build'] = value.strip()
      elif key.strip() == 'PATCH':
        version['patch'] = value.strip()

    version_found = len(version) == 4
  return version if version_found else None
Parse version file, return the version if it exists.

  Args:
    version_path: The path of Chrome VERSION file containing the major version
                  number.
  
Parse version file, return the version if it exists.
Parse version file return the version if it exists .
def _ParseVersionFile(version_path):
  version = {}
  with open(version_path) as fp:
    for line in fp:
      key, _, value = line.partition('=')
      if key.strip() == 'MAJOR':
        version['major'] = value.strip()
      elif key.strip() == 'MINOR':
        version['minor'] = value.strip()
      elif key.strip() == 'BUILD':
        version['build'] = value.strip()
      elif key.strip() == 'PATCH':
        version['patch'] = value.strip()
    version_found = len(version) == 4
  return version if version_found else None
def _ParseVersionFile ( version_path ) : version = { } with open ( version_path ) as fp : for line in fp : key , _ , value = line . partition ( '=' ) if key . strip ( ) == 'MAJOR' : version [ 'major' ] = value . strip ( ) elif key . strip ( ) == 'MINOR' : version [ 'minor' ] = value . strip ( ) elif key . strip ( ) == 'BUILD' : version [ 'build' ] = value . strip ( ) elif key . strip ( ) == 'PATCH' : version [ 'patch' ] = value . strip ( ) version_found = len ( version ) == 4 return version if version_found else None
Parse version file, return the version if it exists.
Parse version file return the version if it exists .
'''Parse version file, return the version if it exists.

  Args:
    version_path: The path of Chrome VERSION file containing the major version
                  number.
  '''
version_path
The path of Chrome VERSION file containing the major version
number.
The path of Chrome VERSION file containing the major version number .