/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/chunk_writer.py

  • Committer: Martin Pool
  • Date: 2011-05-20 14:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 5923.
  • Revision ID: mbp@canonical.com-20110520144602-bqli0t6dj01gl0pv
Various pyflakes import fixes.

Some modules were used for subclassing or at module load time, so there is no
point loading them lazily.

Some were not imported when they should be.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        bytes that did not fit in the chunk.
123
123
 
124
124
        :return: (compressed_bytes, unused_bytes, num_nulls_needed)
125
 
            compressed_bytes    a list of bytes that were output from the
126
 
                                compressor. If the compressed length was not
127
 
                                exactly chunk_size, the final string will be a
128
 
                                string of all null bytes to pad this to
129
 
                                chunk_size
130
 
            unused_bytes        None, or the last bytes that were added, which
131
 
                                we could not fit.
132
 
            num_nulls_needed    How many nulls are padded at the end
 
125
 
 
126
            * compressed_bytes: a list of bytes that were output from the
 
127
              compressor. If the compressed length was not exactly chunk_size,
 
128
              the final string will be a string of all null bytes to pad this
 
129
              to chunk_size
 
130
            * unused_bytes: None, or the last bytes that were added, which we
 
131
              could not fit.
 
132
            * num_nulls_needed: How many nulls are padded at the end
133
133
        """
134
134
        self.bytes_in = None # Free the data cached so far, we don't need it
135
135
        out = self.compressor.flush(Z_FINISH)
164
164
        :param extra_bytes: Optional, if supplied we will add it with
165
165
            Z_SYNC_FLUSH
166
166
        :return: (bytes_out, bytes_out_len, alt_compressed)
167
 
            bytes_out   is the compressed bytes returned from the compressor
168
 
            bytes_out_len the length of the compressed output
169
 
            compressor  An object with everything packed in so far, and
170
 
                        Z_SYNC_FLUSH called.
 
167
 
 
168
            * bytes_out: is the compressed bytes returned from the compressor
 
169
            * bytes_out_len: the length of the compressed output
 
170
            * compressor: An object with everything packed in so far, and
 
171
              Z_SYNC_FLUSH called.
171
172
        """
172
173
        compressor = zlib.compressobj()
173
174
        bytes_out = []