'Create a ZIP package deterministically from a directory.
We need to sort the files in an OS-independent way before adding to the archive.'

def write_from_directory(self, directory, exclusions=None, compress_type=None, date_time=DEFAULT_DATE):

    file_dict = {}
    for (root, subfolders, files) in os.walk(directory):
        for fi in files:
            filename = os.path.join(root, fi)
            if (filename not in exclusions):
                file_dict.update({standardize_filename(filename): filename})
    for (new_filename, old_filename) in sorted(file_dict.items()):
        self.write(old_filename, compress_type=compress_type, date_time=date_time)
