(self, zip_path)
Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
        @param zip_path: zip file path
        @return: comparison boolean
Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
Check if the ZIP file contains another file with the same name so it is going to be overwritten .
def is_overwritten(self, zip_path):
        """Check if the ZIP file contains another file with the same name, so it is going to be overwritten.
        @param zip_path: zip file path
        @return: comparison boolean
        """
        with ZipFile(zip_path, "r") as archive:
            try:
                # Test if zip file contains a file named as itself.
                for name in archive.namelist():
                    if name == os.path.basename(zip_path):
                        return True
                return False
            except BadZipfile:
                raise CuckooPackageError("Invalid Zip file")
def is_overwritten ( self , zip_path ) : with ZipFile ( zip_path , "r" ) as archive : try : # Test if zip file contains a file named as itself. for name in archive . namelist ( ) : if name == os . path . basename ( zip_path ) : return True return False except BadZipfile : raise CuckooPackageError ( "Invalid Zip file" )