~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tuned_gzip.py

  • Committer: Vincent Ladeuil
  • Date: 2007-11-04 15:24:27 UTC
  • mto: (2961.1.1 trunk)
  • mto: This revision was merged to the branch mainline in revision 2962.
  • Revision ID: v.ladeuil+lp@free.fr-20071104152427-p9k7e4toywa87wfc
Review feedback.

* doc/en/user-guide/authentication_conf.txt: 
New file. Authentication configuration file documentation.

* doc/en/user-guide/configuration.txt: 
Slight modifications, add authentication.conf reference.

* doc/en/mini-tutorial/index.txt: 
Fix make docs warning.

* doc/developers/authentication-ring.txt: 
Small cleanups noticed during
doc/en/user-guide/authentication_conf.txt redaction.

* bzrlib/transport/http/_urllib.py:
(HttpTransport_urllib._perform): Use a dict() instead of {} syntax.

* bzrlib/tests/blackbox/test_whoami.py:
(TestWhoami.test_whoami_branch): Delete BZREMAIL related tests.

* bzrlib/config.py:
(Config.username): BZREMAIL deleted, has been obsolete for more
than a year.
(AuthenticationConfig.__init__): Review feedback, since keeping a
callback as an attribute is useless, call it now and keep the
filename itself as an attribute.
(AuthenticationConfig.get_credentials): Use a dict() instead of {}
syntax.

* NEWS: 
Updated as per Martin's suggestion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
        if buf == "":
151
151
            self._add_read_data(self.decompress.flush())
152
 
            if len(self.decompress.unused_data) < 8:
153
 
                raise AssertionError("what does flush do?")
 
152
            assert len(self.decompress.unused_data) >= 8, "what does flush do?"
154
153
            self._gzip_tail = self.decompress.unused_data[0:8]
155
154
            self._read_eof()
156
155
            # tell the driving read() call we have stuffed all the data
176
175
                self._gzip_tail = self.decompress.unused_data[0:8]
177
176
            elif seek_length < 0:
178
177
                # we haven't read enough to check the checksum.
179
 
                if not (-8 < seek_length):
180
 
                    raise AssertionError("too great a seek")
 
178
                assert -8 < seek_length, "too great a seek."
181
179
                buf = self.fileobj.read(-seek_length)
182
180
                self._gzip_tail = self.decompress.unused_data + buf
183
181
            else:
202
200
        # We then check the that the computed CRC and size of the
203
201
        # uncompressed data matches the stored values.  Note that the size
204
202
        # stored is the true file size mod 2**32.
205
 
        if not (len(self._gzip_tail) == 8):
206
 
            raise AssertionError("gzip trailer is incorrect length.")
 
203
        assert len(self._gzip_tail) == 8, "gzip trailer is incorrect length."
207
204
        crc32, isize = struct.unpack("<LL", self._gzip_tail)
208
205
        # note that isize is unsigned - it can exceed 2GB
209
206
        if crc32 != U32(self.crc):