chapisha/helpers/updatezipfile.py
def write(self, filename: str, 
              arcname: Optional[str]=None, 
              compress_type: Optional[int]=None, 
              compresslevel: Optional[int]=None):
        """
        Put the bytes from filename into the archive under the name arcname.
        
        Parameters
        ----------
        filename: str
            Complete path to source file
        arcname: str
            Name of destination file. If not provided, filename and arname are the same.
        compress_type: int
            The numeric constant for an uncompressed archive member.
        compresslevel: int
            
        """
        arcname = arcname or filename
        # If the file exits, and needs to be overridden,
        # mark the entry, and create a temp-file for it
        # we allow this only if the with statement is used
        if self._allow_updates and arcname in self.namelist():
            temp_file = self._replace[arcname] = self._replace.get(arcname,
                                                                   tempfile.TemporaryFile())
            with open(filename, "rb") as source:
                shutil.copyfileobj(source, temp_file)
        # Otherwise just act normally
        else:
            super().write(filename, arcname=arcname, compress_type=compress_type, compresslevel=compresslevel)

        Put the bytes from filename into the archive under the name arcname.
        
        Parameters
        ----------
        filename: str
            Complete path to source file
        arcname: str
            Name of destination file. If not provided, filename and arname are the same.
        compress_type: int
            The numeric constant for an uncompressed archive member.
        compresslevel: int
            
        
Put the bytes from filename into the archive under the name arcname.
Parameters

str
Complete path to source file
arcname: str
Name of destination file. If not provided, filename and arname are the same.
compress_type: int
The numeric constant for an uncompressed archive member.
compresslevel: int
Put the bytes from filename into the archive under the name arcname . Parameters str Complete path to source file arcname : str Name of destination file . If not provided filename and arname are the same . compress_type : int The numeric constant for an uncompressed archive member . compresslevel : int
def write(self, filename: str, 
              arcname: Optional[str]=None, 
              compress_type: Optional[int]=None, 
              compresslevel: Optional[int]=None):
        arcname = arcname or filename
        if self._allow_updates and arcname in self.namelist():
            temp_file = self._replace[arcname] = self._replace.get(arcname,
                                                                   tempfile.TemporaryFile())
            with open(filename, "rb") as source:
                shutil.copyfileobj(source, temp_file)
        else:
            super().write(filename, arcname=arcname, compress_type=compress_type, compresslevel=compresslevel)
def write ( self , filename : str , arcname : Optional [ str ] = None , compress_type : Optional [ int ] = None , compresslevel : Optional [ int ] = None ) : arcname = arcname or filename if self . _allow_updates and arcname in self . namelist ( ) : temp_file = self . _replace [ arcname ] = self . _replace . get ( arcname , tempfile . TemporaryFile ( ) ) with open ( filename , "rb" ) as source : shutil . copyfileobj ( source , temp_file ) else : super ( ) . write ( filename , arcname = arcname , compress_type = compress_type , compresslevel = compresslevel )
Put the bytes from filename into the archive under the name arcname.
Put the bytes from filename into the archive under the name arcname .
"""
        Put the bytes from filename into the archive under the name arcname.
        
        Parameters
        ----------
        filename: str
            Complete path to source file
        arcname: str
            Name of destination file. If not provided, filename and arname are the same.
        compress_type: int
            The numeric constant for an uncompressed archive member.
        compresslevel: int
            
        """ # If the file exits, and needs to be overridden, # mark the entry, and create a temp-file for it # we allow this only if the with statement is used # Otherwise just act normally
self
filename
str
arcname
Optional[str]
compress_type
Optional[int]
compresslevel
Optional[int]