Write manifest files
        :param files_list: list
        :return:
324287
def _set_manifest_data(self, files_list):
        
        if files_list:
            data = ",".join(files_list)
            self.s3.put_object(Bucket=self.sitename,
                               Key=self.manifest_file,
                               Body=data,
                               ACL='private')
42825
public static void populateFilesList(File dir, List<File> filesListInDir) {
		File[] files = dir.listFiles();
		for(File file : files){
			if(file.isFile()){
				filesListInDir.add(file);
			}else{
				populateFilesList(file, filesListInDir);
			}
		}
	}
488543
def files(files_list, with_options: Elm::Options.new)
      Files.new @make, files_list, with_options
    end
694079
def list(self):
        
        before, after = self.filename_template.split('%s', 1)
        filename_re = re.compile(r'%s(.{5,})%s$' % (re.escape(before),
                                                    re.escape(after)))
        result = []
        for filename in os.listdir(self.path):
            #: this is a session that is still being saved.
            if filename.endswith(_fs_transaction_suffix):
                continue
            match = filename_re.match(filename)
            if match is not None:
                result.append(match.group(1))
        return result
1291553
def all_files_exist(file_list):
    
    all_exist = True
    for filename in file_list:
        all_exist = all_exist and os.path.isfile(filename)
    return all_exist
570403
private void writeListFile(final File inputfile, final String relativeRootFile) {
        try (Writer bufferedWriter = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(inputfile)))) {
            bufferedWriter.write(relativeRootFile);
            bufferedWriter.flush();
        } catch (final IOException e) {
            logger.error(e.getMessage(), e) ;
        }
    }
330749
def cmd_fw_manifest(self, args):
        ''''''
        if len(args) == 0:
            print(self.fw_manifest_usage())
            return
        rest = args[1:]
        if args[0] == "download":
            return self.manifest_download()
        if args[0] == "list":
            return self.cmd_fw_manifest_list()
        if args[0] == "load":
            return self.cmd_fw_manifest_load()
        if args[0] == "purge":
            return self.cmd_fw_manifest_purge()
        if args[0] == "help":
            return self.cmd_fw_manifest_help()
        else:
            print("fw: Unknown manifest option (%s)" % args[0])
            print(fw_manifest_usage())
538012
function(target, filelist) {
    var buster = config.timestamp ? '# Time: ' + (new Date()) + '\n' : '';
    var content = [header, buster, section, filelist, network, settings];
    fss.writeFile(target, content.join('\n'));
}
1280924
def list_files(path, extension=".cpp", exclude="S.cpp"):
    """"""
    return ["%s/%s" % (path, f) for f in listdir(path) if f.endswith(extension) and (not f.endswith(exclude))]
458925
def write_file(filename, contents):
    
    contents = "\n".join(contents)

    # assuming the contents has been vetted for utf-8 encoding
    contents = contents.encode("utf-8")

    with open(filename, "wb") as f:  # always write POSIX-style manifest
        f.write(contents)
600417
def write_graph(self, outfile, manifest):
        
        out_graph = _updated_graph(self.graph, manifest)
        nx.write_gpickle(out_graph, outfile)
1113029
def write_manifest(self, module_directory=""):
        
        # First validate the spec
        self.validate()

        # Open the manifest file for writing
        manifest_file = open(os.path.join(module_directory, "manifest"), "w")

        # Write the header
        manifest_file.write("# " + self.name + "\n")
        manifest_file.write("# " + str(datetime.now()) + "\n")
        manifest_file.write("# Generated by Python Module Creator v" + __version__ + "\n")

        # Write initial attributes
        manifest_file.write("JVMLevel=\n")
        manifest_file.write("LSID=" + self.manifest_escape(self.lsid) + ':' + str(self.version) + "\n")
        manifest_file.write("author=" + self._author_line() + "\n")
        manifest_file.write("categories=" + ';'.join(self.categories) + "\n")
        manifest_file.write("commandLine=" + self.command_line + "\n")
        manifest_file.write("cpuType=" + str(self.cpu.value) + "\n")
        manifest_file.write("description=" + self.description + "\n")
        manifest_file.write("fileFormat=" + ';'.join(self.file_format) + "\n")
        manifest_file.write("language=" + self.language + "\n")
        manifest_file.write("license=" + self.license + "\n")
        manifest_file.write("name=" + self.name + "\n")
        manifest_file.write("os=" + str(self.os.value) + "\n")

        # Write parameter attributes
        for index, param in enumerate(self.parameters):
            manifest_file.write(param.manifest_repr(index+1))

        # Write footer attributes
        manifest_file.write("privacy=" + str(self.privacy.value) + "\n")
        manifest_file.write("publicationDate=" + self._publication_date() + "\n")
        manifest_file.write("quality=" + str(self.quality.value) + "\n")
        manifest_file.write("taskDoc=" + self.documentation + "\n")
        manifest_file.write("taskType=" + self._task_type() + "\n")
        manifest_file.write("userid=" + self.user + "\n")
        manifest_file.write("version=" + self.version_comment + "\n")

        # Close the file
        manifest_file.close()
1208123
def parse_manifest(template_lines):
    """"""
    manifest_files = distutils.filelist.FileList()
    for line in template_lines:
        if line.strip():
            manifest_files.process_template_line(line)
    return manifest_files.files
1374777
def _write_files(s3, app, static_url_loc, static_folder, files, bucket,
                 ex_keys=None, hashes=None):
    
    should_gzip = app.config.get('FLASKS3_GZIP')
    add_mime = app.config.get('FLASKS3_FORCE_MIMETYPE')
    gzip_include_only = app.config.get('FLASKS3_GZIP_ONLY_EXTS')
    new_hashes = []
    static_folder_rel = _path_to_relative_url(static_folder)
    for file_path in files:
        per_file_should_gzip = should_gzip
        asset_loc = _path_to_relative_url(file_path)
        full_key_name = _static_folder_path(static_url_loc, static_folder_rel,
                                            asset_loc)
        key_name = full_key_name.lstrip("/")
        logger.debug("Uploading {} to {} as {}".format(file_path, bucket, key_name))

        exclude = False
        if app.config.get('FLASKS3_ONLY_MODIFIED', False):
            file_hash = hash_file(file_path)
            new_hashes.append((full_key_name, file_hash))

            if hashes and hashes.get(full_key_name, None) == file_hash:
                exclude = True

        if ex_keys and full_key_name in ex_keys or exclude:
            logger.debug("%s excluded from upload" % key_name)
        else:
            h = {}
            # Set more custom headers if the filepath matches certain
            # configured regular expressions.
            filepath_headers = app.config.get('FLASKS3_FILEPATH_HEADERS')
            if filepath_headers:
                for filepath_regex, headers in six.iteritems(filepath_headers):
                    if re.search(filepath_regex, file_path):
                        for header, value in six.iteritems(headers):
                            h[header] = value

            # check for extension, only if there are extensions provided
            if per_file_should_gzip and gzip_include_only:
                if os.path.splitext(file_path)[1] not in gzip_include_only:
                    per_file_should_gzip = False

            if per_file_should_gzip:
                h["content-encoding"] = "gzip"

            if (add_mime or per_file_should_gzip) and "content-type" not in h:
                # When we use GZIP we have to explicitly set the content type
                # or if the mime flag is True
                (mimetype, encoding) = mimetypes.guess_type(file_path,
                                                            False)
                if mimetype:
                    h["content-type"] = mimetype
                else:
                    logger.warn("Unable to detect mimetype for %s" %
                                file_path)

            file_mode = 'rb' if six.PY3 else 'r'
            with open(file_path, file_mode) as fp:
                merged_dicts = merge_two_dicts(get_setting('FLASKS3_HEADERS', app), h)
                metadata, params = split_metadata_params(merged_dicts)
                if per_file_should_gzip:
                    compressed = six.BytesIO()
                    z = gzip.GzipFile(os.path.basename(file_path), 'wb', 9,
                                      compressed)
                    z.write(fp.read())
                    z.close()

                    data = compressed.getvalue()
                else:
                    data = fp.read()

                s3.put_object(Bucket=bucket,
                              Key=key_name,
                              Body=data,
                              ACL="public-read",
                              Metadata=metadata,
                              **params)

    return new_hashes
1361259
def write(self, file_handle):
        
        for k, v in self.inputs.write_values().items():
            self.set('config', k, v)
        self.set('config', 'namespace', self.namespace)
        self.manifest.write(file_handle)
13359
def list_files_in_directory(full_directory_path):
    
    files = list()
    for file_name in __os.listdir(full_directory_path):
        if __os.path.isfile(__os.path.join(full_directory_path, file_name)):
            files.append(file_name)
    return files
802908
def manifest(self, entry):
        
        entries = []
        for fname in self._sorted_nicely(os.listdir(entry.directory)):
            if fname == 'manifest.json':
                continue
            fpath = os.path.abspath(os.path.join(entry.directory, fname))
            metadata = self.metadata_from_fname(fname)
            entries.append({"filename": fpath,
                            "series": metadata.s,
                            "channel": metadata.c,
                            "zslice": metadata.z,
                            "timepoint": metadata.t})
        return entries