~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store.py

  • Committer: Aaron Bentley
  • Date: 2005-08-10 17:39:16 UTC
  • mto: (1092.1.41) (1185.3.4) (974.1.47)
  • mto: This revision was merged to the branch mainline in revision 1110.
  • Revision ID: abentley@panoramicfeedback.com-20050810173916-77580019d21a0e82
Removed MergeTree.inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
    def __len__(self):
173
173
        return len(os.listdir(self._basedir))
174
174
 
175
 
 
176
175
    def __getitem__(self, fileid):
177
176
        """Returns a file reading from a particular entry."""
178
177
        p = self._path(fileid)
179
178
        try:
180
179
            return gzip.GzipFile(p + '.gz', 'rb')
181
180
        except IOError, e:
182
 
            if e.errno != errno.ENOENT:
183
 
                raise
184
 
 
185
 
        try:
186
 
            return file(p, 'rb')
187
 
        except IOError, e:
188
 
            if e.errno != errno.ENOENT:
189
 
                raise
190
 
 
191
 
        raise IndexError(fileid)
192
 
 
 
181
            if e.errno == errno.ENOENT:
 
182
                return file(p, 'rb')
 
183
            else:
 
184
                raise e
193
185
 
194
186
    def total_size(self):
195
187
        """Return (count, bytes)