tools/flags/generate_expired_list.py
def gen_file_body(flags, mstone):
  """Generates the body of the flag expiration list.

  Flags appear in the list only if:
  * Their expiration mstone is not -1
  * Either the chrome version is unknown OR
  * Their expiration mstone is <= the chrome version

  >>> flags = [ { 'name': 'foo', 'expiry_milestone': 1 } ]
  >>> flags.append({ 'name': 'bar', 'expiry_milestone': 2 })
  >>> flags.append({ 'name': 'baz', 'expiry_milestone': -1 })
  >>> gen_file_body(flags, 1)
  '  {"foo", 1},'
  >>> gen_file_body(flags, 2)
  '  {"foo", 1},\\n  {"bar", 2},'
  >>> gen_file_body(flags, None)
  '  {"foo", 1},\\n  {"bar", 2},'
  """
  if mstone != None:
    flags = list_flags.keep_expired_by(flags, mstone)
  output = []
  for f in flags:
    if f['expiry_milestone'] != -1:
      name, expiry = f['name'], f['expiry_milestone']
      output.append('  {"' + name + '", ' + str(expiry) + '},')
  return '\n'.join(output)
Generates the body of the flag expiration list.

  Flags appear in the list only if:
  * Their expiration mstone is not -1
  * Either the chrome version is unknown OR
  * Their expiration mstone is <= the chrome version

  >>> flags = [ { 'name': 'foo', 'expiry_milestone': 1 } ]
  >>> flags.append({ 'name': 'bar', 'expiry_milestone': 2 })
  >>> flags.append({ 'name': 'baz', 'expiry_milestone': -1 })
  >>> gen_file_body(flags, 1)
  '  {"foo", 1},'
  >>> gen_file_body(flags, 2)
  '  {"foo", 1},\\n  {"bar", 2},'
  >>> gen_file_body(flags, None)
  '  {"foo", 1},\\n  {"bar", 2},'
  
Generates the body of the flag expiration list.
Flags appear in the list only if:
Their expiration mstone is not -1
Either the chrome version is unknown OR
Their expiration mstone is <= the chrome version


Generates the body of the flag expiration list . Flags appear in the list only if : Their expiration mstone is not - 1 Either the chrome version is unknown OR Their expiration mstone is < = the chrome version
def gen_file_body(flags, mstone):
  if mstone != None:
    flags = list_flags.keep_expired_by(flags, mstone)
  output = []
  for f in flags:
    if f['expiry_milestone'] != -1:
      name, expiry = f['name'], f['expiry_milestone']
      output.append('  {"' + name + '", ' + str(expiry) + '},')
  return '\n'.join(output)
def gen_file_body ( flags , mstone ) : if mstone != None : flags = list_flags . keep_expired_by ( flags , mstone ) output = [ ] for f in flags : if f [ 'expiry_milestone' ] != - 1 : name , expiry = f [ 'name' ] , f [ 'expiry_milestone' ] output . append ( '  {"' + name + '", ' + str ( expiry ) + '},' ) return '\n' . join ( output )
Generates the body of the flag expiration list.
Generates the body of the flag expiration list .
"""Generates the body of the flag expiration list.

  Flags appear in the list only if:
  * Their expiration mstone is not -1
  * Either the chrome version is unknown OR
  * Their expiration mstone is <= the chrome version

  >>> flags = [ { 'name': 'foo', 'expiry_milestone': 1 } ]
  >>> flags.append({ 'name': 'bar', 'expiry_milestone': 2 })
  >>> flags.append({ 'name': 'baz', 'expiry_milestone': -1 })
  >>> gen_file_body(flags, 1)
  '  {"foo", 1},'
  >>> gen_file_body(flags, 2)
  '  {"foo", 1},\\n  {"bar", 2},'
  >>> gen_file_body(flags, None)
  '  {"foo", 1},\\n  {"bar", 2},'
  """
flags
mstone