native_client_sdk/src/tools/oshelpers.py
def Copy(args):
  """A Unix cp style copy.

  Copies multiple sources to a single destination using the normal cp
  semantics.  In addition, it support inclusion and exclusion filters which
  allows the copy to skip certain types of files.
  """
  parser = argparse.ArgumentParser(usage='cp [Options] sources... dest',
                                   description=Copy.__doc__)
  parser.add_argument(
      '-R', '-r', '--recursive', dest='recursive', action='store_true',
      default=False,
      help='copy directories recursively.')
  parser.add_argument(
      '-v', '--verbose', dest='verbose', action='store_true',
      default=False,
      help='verbose output.')
  parser.add_argument(
      '--include', dest='includes', action='append', default=[],
      help='include files matching this expression.')
  parser.add_argument(
      '--exclude', dest='excludes', action='append', default=[],
      help='exclude files matching this expression.')
  parser.add_argument('srcs', nargs='+', help='files to copy')
  parser.add_argument('dest', help='destination')

  options = parser.parse_args(args)

  src_list = []
  for src in options.srcs:
    files = glob.glob(src)
    if not files:
      raise OSError('cp: no such file or directory: ' + src)
    if files:
      src_list.extend(files)

  for src in src_list:
    # If the destination is a directory, then append the basename of the src
    # to the destination.
    if os.path.isdir(options.dest):
      CopyPath(options, src, os.path.join(options.dest, os.path.basename(src)))
    else:
      CopyPath(options, src, options.dest)
A Unix cp style copy.

  Copies multiple sources to a single destination using the normal cp
  semantics.  In addition, it support inclusion and exclusion filters which
  allows the copy to skip certain types of files.
  
A Unix cp style copy.
Copies multiple sources to a single destination using the normal cp
semantics.  In addition, it support inclusion and exclusion filters which
allows the copy to skip certain types of files.
A Unix cp style copy . Copies multiple sources to a single destination using the normal cp semantics . In addition it support inclusion and exclusion filters which allows the copy to skip certain types of files .
def Copy(args):
  parser = argparse.ArgumentParser(usage='cp [Options] sources... dest',
                                   description=Copy.__doc__)
  parser.add_argument(
      '-R', '-r', '--recursive', dest='recursive', action='store_true',
      default=False,
      help='copy directories recursively.')
  parser.add_argument(
      '-v', '--verbose', dest='verbose', action='store_true',
      default=False,
      help='verbose output.')
  parser.add_argument(
      '--include', dest='includes', action='append', default=[],
      help='include files matching this expression.')
  parser.add_argument(
      '--exclude', dest='excludes', action='append', default=[],
      help='exclude files matching this expression.')
  parser.add_argument('srcs', nargs='+', help='files to copy')
  parser.add_argument('dest', help='destination')
  options = parser.parse_args(args)
  src_list = []
  for src in options.srcs:
    files = glob.glob(src)
    if not files:
      raise OSError('cp: no such file or directory: ' + src)
    if files:
      src_list.extend(files)
  for src in src_list:
    if os.path.isdir(options.dest):
      CopyPath(options, src, os.path.join(options.dest, os.path.basename(src)))
    else:
      CopyPath(options, src, options.dest)
def Copy ( args ) : parser = argparse . ArgumentParser ( usage = 'cp [Options] sources... dest' , description = Copy . __doc__ ) parser . add_argument ( '-R' , '-r' , '--recursive' , dest = 'recursive' , action = 'store_true' , default = False , help = 'copy directories recursively.' ) parser . add_argument ( '-v' , '--verbose' , dest = 'verbose' , action = 'store_true' , default = False , help = 'verbose output.' ) parser . add_argument ( '--include' , dest = 'includes' , action = 'append' , default = [ ] , help = 'include files matching this expression.' ) parser . add_argument ( '--exclude' , dest = 'excludes' , action = 'append' , default = [ ] , help = 'exclude files matching this expression.' ) parser . add_argument ( 'srcs' , nargs = '+' , help = 'files to copy' ) parser . add_argument ( 'dest' , help = 'destination' ) options = parser . parse_args ( args ) src_list = [ ] for src in options . srcs : files = glob . glob ( src ) if not files : raise OSError ( 'cp: no such file or directory: ' + src ) if files : src_list . extend ( files ) for src in src_list : if os . path . isdir ( options . dest ) : CopyPath ( options , src , os . path . join ( options . dest , os . path . basename ( src ) ) ) else : CopyPath ( options , src , options . dest )
A Unix cp style copy.
A Unix cp style copy .
"""A Unix cp style copy.

  Copies multiple sources to a single destination using the normal cp
  semantics.  In addition, it support inclusion and exclusion filters which
  allows the copy to skip certain types of files.
  """ # If the destination is a directory, then append the basename of the src # to the destination.
args