Lists file entries in the base path specification.

    Args:
      base_path_specs (list[dfvfs.PathSpec]): source path specification.
      output_writer (StdoutWriter): output writer.
18920
def ListFileEntries(self, base_path_specs, output_writer):
    
    for base_path_spec in base_path_specs:
      file_system = resolver.Resolver.OpenFileSystem(base_path_spec)
      file_entry = resolver.Resolver.OpenFileEntry(base_path_spec)
      if file_entry is None:
        logging.warning(
            'Unable to open base path specification:\n{0:s}'.format(
                base_path_spec.comparable))
        return

      self._ListFileEntry(file_system, file_entry, '', output_writer)
36610
def _show_psrs():
    
    sep = os.linesep

    types = "Supported types: " + ", ".join(API.list_types())
    cids = "IDs: " + ", ".join(c for c, _ps in API.list_by_cid())

    x_vs_ps = ["  %s: %s" % (x, ", ".join(p.cid() for p in ps))
               for x, ps in API.list_by_extension()]
    exts = "File extensions:" + sep + sep.join(x_vs_ps)

    _exit_with_output(sep.join([types, exts, cids]))
597083
def spec_fn(spec_dir='.'):
    
    specs = [f for f in os.listdir(spec_dir)
             if os.path.isfile(f) and f.endswith('.spec')]
    if not specs:
        raise exception.SpecFileNotFound()
    if len(specs) != 1:
        raise exception.MultipleSpecFilesFound()
    return specs[0]
1051633
def write_spec(file_path, force_write = false, dry_run = false, rails_mode = false)
      class_or_module = RSpecKickstarter::RDocFactory.get_rdoc_class_or_module(file_path)
      if class_or_module
        spec_path = get_spec_path(file_path)
        if force_write && File.exist?(spec_path)
          append_to_existing_spec(class_or_module, dry_run, rails_mode, spec_path)
        else
          create_new_spec(class_or_module, dry_run, rails_mode, file_path, spec_path)
        end
      else
        puts "#{file_path} skipped (Class/Module not found)."
      end
    end
748426
def list_files(x, path=""):
    
    logger_directory.info("enter list_files")
    file_list = []
    if path:
        # list files from target directory
        files = os.listdir(path)
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # join the path and basename to create full path
                file_list.append(os.path.join(path, file))
    else:
        # list files from current working directory
        files = os.listdir()
        for file in files:
            if file.endswith(x) and not file.startswith(("$", "~", ".")):
                # append basename. not full path
                file_list.append(file)
    logger_directory.info("exit list_files")
    return file_list
467175
def _EntriesGenerator(self):
    
    location = getattr(self.path_spec, 'location', None)

    if location and location.startswith(self._file_system.PATH_SEPARATOR):
      # The TAR info name does not have the leading path separator as
      # the location string does.
      tar_path = location[1:]

      # Set of top level sub directories that have been yielded.
      processed_directories = set()

      tar_file = self._file_system.GetTARFile()
      for tar_info in iter(tar_file.getmembers()):
        path = tar_info.name

        # Determine if the start of the TAR info name is similar to
        # the location string. If not the file TAR info refers to is not in
        # the same directory.
        if not path or not path.startswith(tar_path):
          continue

        # Ignore the directory itself.
        if path == tar_path:
          continue

        path_segment, suffix = self._file_system.GetPathSegmentAndSuffix(
            tar_path, path)
        if not path_segment:
          continue

        # Sometimes the TAR file lacks directories, therefore we will
        # provide virtual ones.
        if suffix:
          path_spec_location = self._file_system.JoinPath([
              location, path_segment])
          is_directory = True

        else:
          path_spec_location = self._file_system.JoinPath([path])
          is_directory = tar_info.isdir()

        if is_directory:
          if path_spec_location in processed_directories:
            continue
          processed_directories.add(path_spec_location)

        yield tar_path_spec.TARPathSpec(
            location=path_spec_location, parent=self.path_spec.parent)
317461
def from_sources_field(sources, spec_path):
    
    if sources is None:
      return Files(spec_path=spec_path)
    elif isinstance(sources, BaseGlobs):
      return sources
    elif isinstance(sources, string_types):
      return Files(sources, spec_path=spec_path)
    elif isinstance(sources, (MutableSet, MutableSequence, tuple)) and \
         all(isinstance(s, string_types) for s in sources):
      return Files(*sources, spec_path=spec_path)
    else:
      raise ValueError('Expected either a glob or list of literal sources: got: {}'.format(sources))
479218
def listext(self, ext, stream=sys.stdout):
        
        nodes_files = []
        for node in self.iflat_nodes():
            filepath = node.outdir.has_abiext(ext)
            if filepath:
                nodes_files.append((node, File(filepath)))

        if nodes_files:
            print("Found %s files with extension `%s` produced by the flow" % (len(nodes_files), ext), file=stream)

            table = [[f.relpath, "%.2f" % (f.get_stat().st_size / 1024**2),
                      node.node_id, node.__class__.__name__]
                     for node, f in nodes_files]
            print(tabulate(table, headers=["File", "Size [Mb]", "Node_ID", "Node Class"]), file=stream)

        else:
            print("No output file with extension %s has been produced by the flow" % ext, file=stream)
885358
def write_line_list(argname, cmd, basename, filename):
    

    values = getattr(cmd.distribution, argname, None)
    if isinstance(values, list):
        values = '\n'.join(values)
    cmd.write_or_delete_file(argname, filename, values, force=True)
1278912
def listrecursive(path, ext=None):
    
    filenames = set()
    for root, dirs, files in os.walk(path):
        if ext:
            if ext == 'tif' or ext == 'tiff':
                tmp = fnmatch.filter(files, '*.' + 'tiff')
                files = tmp + fnmatch.filter(files, '*.' + 'tif')
            else:
                files = fnmatch.filter(files, '*.' + ext)
        for filename in files:
            filenames.add(os.path.join(root, filename))
    filenames = list(filenames)
    filenames.sort()
    return sorted(filenames)
831157
def RegisterPathSpec(cls, path_spec_type):
    
    type_indicator = path_spec_type.TYPE_INDICATOR
    if type_indicator in cls._path_spec_types:
      raise KeyError(
          'Path specification type: {0:s} already set.'.format(
              type_indicator))

    cls._path_spec_types[type_indicator] = path_spec_type

    if getattr(path_spec_type, '_IS_SYSTEM_LEVEL', False):
      cls._system_level_type_indicators[type_indicator] = path_spec_type
324010
def list(path, ext=None, start=None, stop=None, recursive=False):
        
        files = listflat(path, ext) if not recursive else listrecursive(path, ext)
        if len(files) < 1:
            raise FileNotFoundError('Cannot find files of type "%s" in %s'
                                    % (ext if ext else '*', path))
        files = select(files, start, stop)

        return files
399756
def __load_paths(self, base_path=None):
        
        if base_path is None:
            base_path = dirname(dirname(dirname(__file__)))
        if not base_path.endswith(sep):
            base_path += sep
        self.__paths = {
            'base': base_path,
            'cert': base_path + 'certs' + sep,
            'lib': base_path + 'lib' + sep,
            'extlib': base_path + 'extlib' + sep,
        }
1255230
def list(self, out=sys.stdout):
        

        out.write('-- listing properties --\n')
        for key,value in self._properties.items():
            out.write(''.join((key,'=',value,'\n')))
1083372
def list(self, path=None, with_metadata=False, include_partitions=False):
        ''''''
        return self.upstream.list(
            path,
            with_metadata=with_metadata,
            include_partitions=include_partitions)
331075
def listdir(self, path):
        '''
        
        '''
        for f in os.listdir(path):
            if not f.startswith('.'):
                yield f
1245013
def list(cls, path):
        
        file_info = cls.parse_remote(path)
        connection = cls.connect(path)
        bucket = connection.get_bucket(file_info.bucket)
        region = "@%s" % file_info.region if file_info.region else ""

        output = []
        for key in bucket.get_all_keys(prefix=file_info.key):
            output.append(cls._S3_FILE % {"bucket": file_info.bucket,
                                          "key": key.name,
                                          "region": region})
        return output