Changeset - ed4a3c0fe61a
[Not reviewed]
default
0 1 0
Mads Kiilerich - 11 years ago 2014-12-15 13:47:36
madski@unity3d.com
files: remove redundant zip try/except
1 file changed with 0 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/files.py
Show inline comments
 
@@ -560,27 +560,22 @@ class FilesController(BaseRepoController
 
                use_cached_archive = True
 
            else:
 
                log.debug('Archive %s is not yet cached' % (archive_name))
 

	
 
        if not use_cached_archive:
 
            # generate new archive
 
            temp_stream = None
 
            try:
 
                fd, archive = tempfile.mkstemp()
 
                temp_stream = open(archive, 'wb')
 
                log.debug('Creating new temp archive in %s' % archive)
 
                cs.fill_archive(stream=temp_stream, kind=fileformat, subrepos=subrepos)
 
                temp_stream.close()
 
                if not subrepos and archive_cache_enabled:
 
                    #if we generated the archive and use cache rename that
 
                    log.debug('Storing new archive in %s' % cached_archive_path)
 
                    shutil.move(archive, cached_archive_path)
 
                    archive = cached_archive_path
 
            finally:
 
                if temp_stream:
 
                    temp_stream.close()
 

	
 
        def get_chunked_archive(archive):
 
            stream = open(archive, 'rb')
 
            while True:
 
                data = stream.read(16 * 1024)
 
                if not data:
0 comments (0 inline, 0 general)