def create_zip(archive, compression, cmd, verbosity, interactive, filenames):
    """Create a ZIP archive with the zipfile Python module."""
    try:
        with zipfile.ZipFile(archive, 'w') as zfile:
            for filename in filenames:
                if os.path.isdir(filename):
                    write_directory(zfile, filename)
                else:
                    zfile.write(filename)
    except Exception as err:
        msg = "error creating %s: %s" % (archive, err)
        raise util.PatoolError(msg)
    return None
def create_zip ( archive , compression , cmd , verbosity , interactive , filenames ) : try : with zipfile . ZipFile ( archive , 'w' ) as zfile : for filename in filenames : if os . path . isdir ( filename ) : write_directory ( zfile , filename ) else : zfile . write ( filename ) except Exception as err : msg = "error creating %s: %s" % ( archive , err ) raise util . PatoolError ( msg ) return None
Create a ZIP archive with the zipfile Python module.