示例#1
0
文件: condense.py 项目: papagr/TheLMA
 def __create_zip_archive(self):
     # Creates and fills the zip archive (adds files).
     self.add_info('Writes files into zip stream ...')
     self.__zip_stream = StringIO()
     zip_map = dict()
     zip_map[self.WORKLIST_FILE_NAME] = self.__worklist_stream
     zip_map[self.REPORT_FILE_NAME] = self.__report_stream
     create_zip_archive(zip_stream=self.__zip_stream, stream_map=zip_map)
示例#2
0
 def __create_zip_archive(self):
     # Creates and fills the zip archive (adds files).
     self.add_info('Writes files into zip stream ...')
     self.__zip_stream = StringIO()
     zip_map = dict()
     zip_map[self.WORKLIST_FILE_NAME] = self.__worklist_stream
     zip_map[self.REPORT_FILE_NAME] = self.__report_stream
     create_zip_archive(zip_stream=self.__zip_stream, stream_map=zip_map)
示例#3
0
文件: batch.py 项目: helixyte/TheLMA
    def __summarize_streams(self):
        # Reads the zip streams and generates a new common archive.
        self.add_debug('Summarize zip archives ...')

        zip_map = dict()
        for zip_stream in self.__zip_streams:
            file_map = read_zip_archive(zip_stream)
            for fn, stream in file_map.iteritems(): zip_map[fn] = stream

        final_stream = StringIO()
        create_zip_archive(final_stream, zip_map)
        return final_stream
示例#4
0
文件: batch.py 项目: papagr/TheLMA
    def __summarize_streams(self):
        # Reads the zip streams and generates a new common archive.
        self.add_debug('Summarize zip archives ...')

        zip_map = dict()
        for zip_stream in self.__zip_streams:
            file_map = read_zip_archive(zip_stream)
            for fn, stream in file_map.iteritems():
                zip_map[fn] = stream

        final_stream = StringIO()
        create_zip_archive(final_stream, zip_map)
        return final_stream
示例#5
0
文件: series.py 项目: papagr/TheLMA
 def __print_worklists(self):
     # Called in printing mode (:attr:`MODE_PRINT_WORKLISTS`). Non-rack
     # worklist for the same worklist label are merged by default.
     stream_map = self.__run_serial_writer()
     if not self.has_errors():
         merge_map = self._merge_streams(stream_map)
         rack_transfer_stream = self._get_rack_transfer_stream(stream_map)
     if not self.has_errors():
         file_map = self._get_file_map(merge_map, rack_transfer_stream)
     if not self.has_errors():
         zip_stream = StringIO()
         create_zip_archive(zip_stream, file_map)
         self.return_value = zip_stream
         self.add_info('Serial working print completed.')
示例#6
0
文件: series.py 项目: helixyte/TheLMA
 def __print_worklists(self):
     # Called in printing mode (:attr:`MODE_PRINT_WORKLISTS`). Non-rack
     # worklist for the same worklist label are merged by default.
     stream_map = self.__run_serial_writer()
     if not self.has_errors():
         merge_map = self._merge_streams(stream_map)
         rack_transfer_stream = self._get_rack_transfer_stream(stream_map)
     if not self.has_errors():
         file_map = self._get_file_map(merge_map, rack_transfer_stream)
     if not self.has_errors():
         zip_stream = StringIO()
         create_zip_archive(zip_stream, file_map)
         self.return_value = zip_stream
         self.add_info('Serial working print completed.')