build/apple/tweak_info_plist.py
def _AddVersionKeys(plist, version_format_for_key, version=None,
                    overrides=None):
  """Adds the product version number into the plist. Returns True on success and
  False on error. The error will be printed to stderr."""
  if not version:
    # Pull in the Chrome version number.
    VERSION_TOOL = os.path.join(TOP, 'build/util/version.py')
    VERSION_FILE = os.path.join(TOP, 'chrome/VERSION')
    (stdout, retval) = _GetOutput([
        VERSION_TOOL, '-f', VERSION_FILE, '-t',
        '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'
    ])

    # If the command finished with a non-zero return code, then report the
    # error up.
    if retval != 0:
      return False

    version = stdout.strip()

  # Parse the given version number, that should be in MAJOR.MINOR.BUILD.PATCH
  # format (where each value is a number). Note that str.isdigit() returns
  # True if the string is composed only of digits (and thus match \d+ regexp).
  groups = version.split('.')
  if len(groups) != 4 or not all(element.isdigit() for element in groups):
    print('Invalid version string specified: "%s"' % version, file=sys.stderr)
    return False
  values = dict(zip(('MAJOR', 'MINOR', 'BUILD', 'PATCH'), groups))

  for key in version_format_for_key:
    plist[key] = _GetVersion(version_format_for_key[key], values, overrides)

  # Return with no error.
  return True
Adds the product version number into the plist. Returns True on success and
  False on error. The error will be printed to stderr.
Adds the product version number into the plist. Returns True on success and
False on error. The error will be printed to stderr.
Adds the product version number into the plist . Returns True on success and False on error . The error will be printed to stderr .
def _AddVersionKeys(plist, version_format_for_key, version=None,
                    overrides=None):
  if not version:
    VERSION_TOOL = os.path.join(TOP, 'build/util/version.py')
    VERSION_FILE = os.path.join(TOP, 'chrome/VERSION')
    (stdout, retval) = _GetOutput([
        VERSION_TOOL, '-f', VERSION_FILE, '-t',
        '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'
    ])
    if retval != 0:
      return False
    version = stdout.strip()
  groups = version.split('.')
  if len(groups) != 4 or not all(element.isdigit() for element in groups):
    print('Invalid version string specified: "%s"' % version, file=sys.stderr)
    return False
  values = dict(zip(('MAJOR', 'MINOR', 'BUILD', 'PATCH'), groups))
  for key in version_format_for_key:
    plist[key] = _GetVersion(version_format_for_key[key], values, overrides)
  return True
def _AddVersionKeys ( plist , version_format_for_key , version = None , overrides = None ) : if not version : VERSION_TOOL = os . path . join ( TOP , 'build/util/version.py' ) VERSION_FILE = os . path . join ( TOP , 'chrome/VERSION' ) ( stdout , retval ) = _GetOutput ( [ VERSION_TOOL , '-f' , VERSION_FILE , '-t' , '@MAJOR@.@MINOR@.@BUILD@.@PATCH@' ] ) if retval != 0 : return False version = stdout . strip ( ) groups = version . split ( '.' ) if len ( groups ) != 4 or not all ( element . isdigit ( ) for element in groups ) : print ( 'Invalid version string specified: "%s"' % version , file = sys . stderr ) return False values = dict ( zip ( ( 'MAJOR' , 'MINOR' , 'BUILD' , 'PATCH' ) , groups ) ) for key in version_format_for_key : plist [ key ] = _GetVersion ( version_format_for_key [ key ] , values , overrides ) return True
Adds the product version number into the plist.
Adds the product version number into the plist .
"""Adds the product version number into the plist. Returns True on success and
  False on error. The error will be printed to stderr.""" # Pull in the Chrome version number. # If the command finished with a non-zero return code, then report the # error up. # Parse the given version number, that should be in MAJOR.MINOR.BUILD.PATCH # format (where each value is a number). Note that str.isdigit() returns # True if the string is composed only of digits (and thus match \d+ regexp). # Return with no error.
plist
version_format_for_key
version
overrides