Dulwich.io dulwich / 6c15e76
Properly set attributes. Jelmer Vernooń≥ 27 days ago
1 changed file(s) with 9 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
515515 return super(FilePackIndex, self).__eq__(other)
516516
517517 def close(self):
518 self._file.close()
518519 if getattr(self._contents, "close", None) is not None:
519520 self._contents.close()
520 self._file.close()
521521
522522 def __len__(self):
523523 """Return the number of entries in this pack index."""
19211921 self.resolve_ext_ref = resolve_ext_ref
19221922
19231923 @classmethod
1924 def from_lazy_objects(self, data_fn, idx_fn):
1924 def from_lazy_objects(cls, data_fn, idx_fn):
19251925 """Create a new pack object from callables to load pack data and
19261926 index objects."""
1927 ret = Pack('')
1927 ret = cls('')
19281928 ret._data_load = data_fn
19291929 ret._idx_load = idx_fn
19301930 return ret
19311931
19321932 @classmethod
1933 def from_objects(self, data, idx):
1933 def from_objects(cls, data, idx):
19341934 """Create a new pack object from pack data and index objects."""
1935 ret = Pack('')
1935 ret = cls('')
19361936 ret._data = data
1937 ret._data.pack = ret
1938 ret._data_load = None
19371939 ret._idx = idx
1940 ret._idx_load = None
1941 ret.check_length_and_checksum()
19381942 return ret
19391943
19401944 def name(self):