third_party/google_input_tools/update.py
def main():
  """The entrypoint for this script."""

  logging.basicConfig(format='update.py: %(message)s', level=logging.INFO)

  usage = 'usage: %prog [options] arg'
  parser = optparse.OptionParser(usage)
  parser.add_option('-i',
                    '--input',
                    dest='input',
                    action='append',
                    help='Path to the google-input-tools sandbox.')
  parser.add_option('-l',
                    '--lib',
                    dest='lib',
                    action='store',
                    help='Path to the closure-library sandbox.')

  (options, _) = parser.parse_args()

  input_path = get_google_input_tools_sandbox_from_options(options)[0]
  closure_library_path = get_closure_library_sandbox_from_options(options)[0]

  if not os.path.isdir(input_path):
    print 'Could not find google-input-tools sandbox.'
    exit(1)
  if not os.path.isdir(closure_library_path):
    print 'Could not find closure-library sandbox.'
    exit(1)

  (providers, requirements) = expand_directories([
      os.path.join(input_path, 'chrome'),
      closure_library_path])

  dependencies = set()
  for name in namespaces:
    extract_dependencies(name, providers, requirements, dependencies)

  target_files = []
  for name in dependencies:
    update_file(name, input_path, closure_library_path, target_files)

  generate_build_file(target_files)

  # Copy resources
  copy_dir(input_path, 'inputview/_locales')
  copy_dir(input_path, 'inputview/images')
  copy_dir(input_path, 'inputview/config')
  copy_dir(input_path, 'inputview/layouts')
  copy_dir(input_path, 'sounds')

  # Copy extra support files.
  for name in extras:
    source = os.path.join(input_path, 'chrome', 'os', 'inputview', name)
    target = os.path.join('src', 'chrome', 'os', 'inputview', name)
    copy_file(source, target)
The entrypoint for this script.
The entrypoint for this script.
The entrypoint for this script .
def main():
  logging.basicConfig(format='update.py: %(message)s', level=logging.INFO)
  usage = 'usage: %prog [options] arg'
  parser = optparse.OptionParser(usage)
  parser.add_option('-i',
                    '--input',
                    dest='input',
                    action='append',
                    help='Path to the google-input-tools sandbox.')
  parser.add_option('-l',
                    '--lib',
                    dest='lib',
                    action='store',
                    help='Path to the closure-library sandbox.')
  (options, _) = parser.parse_args()
  input_path = get_google_input_tools_sandbox_from_options(options)[0]
  closure_library_path = get_closure_library_sandbox_from_options(options)[0]
  if not os.path.isdir(input_path):
    print 'Could not find google-input-tools sandbox.'
    exit(1)
  if not os.path.isdir(closure_library_path):
    print 'Could not find closure-library sandbox.'
    exit(1)
  (providers, requirements) = expand_directories([
      os.path.join(input_path, 'chrome'),
      closure_library_path])
  dependencies = set()
  for name in namespaces:
    extract_dependencies(name, providers, requirements, dependencies)
  target_files = []
  for name in dependencies:
    update_file(name, input_path, closure_library_path, target_files)
  generate_build_file(target_files)
  copy_dir(input_path, 'inputview/_locales')
  copy_dir(input_path, 'inputview/images')
  copy_dir(input_path, 'inputview/config')
  copy_dir(input_path, 'inputview/layouts')
  copy_dir(input_path, 'sounds')
  for name in extras:
    source = os.path.join(input_path, 'chrome', 'os', 'inputview', name)
    target = os.path.join('src', 'chrome', 'os', 'inputview', name)
    copy_file(source, target)
def main ( ) : logging . basicConfig ( format = 'update.py: %(message)s' , level = logging . INFO ) usage = 'usage: %prog [options] arg' parser = optparse . OptionParser ( usage ) parser . add_option ( '-i' , '--input' , dest = 'input' , action = 'append' , help = 'Path to the google-input-tools sandbox.' ) parser . add_option ( '-l' , '--lib' , dest = 'lib' , action = 'store' , help = 'Path to the closure-library sandbox.' ) ( options , _ ) = parser . parse_args ( ) input_path = get_google_input_tools_sandbox_from_options ( options ) [ 0 ] closure_library_path = get_closure_library_sandbox_from_options ( options ) [ 0 ] if not os . path . isdir ( input_path ) : print 'Could not find google-input-tools sandbox.' exit ( 1 ) if not os . path . isdir ( closure_library_path ) : print 'Could not find closure-library sandbox.' exit ( 1 ) ( providers , requirements ) = expand_directories ( [ os . path . join ( input_path , 'chrome' ) , closure_library_path ] ) dependencies = set ( ) for name in namespaces : extract_dependencies ( name , providers , requirements , dependencies ) target_files = [ ] for name in dependencies : update_file ( name , input_path , closure_library_path , target_files ) generate_build_file ( target_files ) copy_dir ( input_path , 'inputview/_locales' ) copy_dir ( input_path , 'inputview/images' ) copy_dir ( input_path , 'inputview/config' ) copy_dir ( input_path , 'inputview/layouts' ) copy_dir ( input_path , 'sounds' ) for name in extras : source = os . path . join ( input_path , 'chrome' , 'os' , 'inputview' , name ) target = os . path . join ( 'src' , 'chrome' , 'os' , 'inputview' , name ) copy_file ( source , target )
The entrypoint for this script.
The entrypoint for this script .
"""The entrypoint for this script.""" # Copy resources # Copy extra support files.