diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-25 11:33:58 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-25 11:33:58 +0300 |
commit | b710b9d2f674ab0804fa5a40da02b594fe696cee (patch) | |
tree | 2db1f72f3b1a37f2ccb1149d0c15003716f428ff /obnamlib | |
parent | b748775aab837bc8ae352197676bf1aa0479c763 (diff) | |
download | obnam-b710b9d2f674ab0804fa5a40da02b594fe696cee.tar.gz |
Fix: use 'id' instead of 'leaf_id', for backwards compat
Diffstat (limited to 'obnamlib')
-rw-r--r-- | obnamlib/fmt_ga/leaf_list.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/obnamlib/fmt_ga/leaf_list.py b/obnamlib/fmt_ga/leaf_list.py index 11f0db21..a905f2b3 100644 --- a/obnamlib/fmt_ga/leaf_list.py +++ b/obnamlib/fmt_ga/leaf_list.py @@ -29,7 +29,7 @@ class LeafList(object): ll = LeafList() for leaf_info in serialised: ll.add( - leaf_info['leaf_id'], + leaf_info['id'], leaf_info['first_key'], leaf_info['last_key'] ) @@ -39,7 +39,7 @@ class LeafList(object): return len(self._leaves) def leaves(self): - return [leaf_info['leaf_id'] for leaf_info in self._leaves] + return [leaf_info['id'] for leaf_info in self._leaves] def add(self, leaf_id, first_key, last_key): if any(self.find_leaf(k) for k in [first_key, last_key]): @@ -49,12 +49,12 @@ class LeafList(object): self._leaves.append({ 'first_key': first_key, 'last_key': last_key, - 'leaf_id': leaf_id, + 'id': leaf_id, }) self._leaves.sort(key=lambda x: (x['first_key'], x['last_key'])) def find_leaf(self, key): for leaf_info in self._leaves: if leaf_info['first_key'] <= key <= leaf_info['last_key']: - return leaf_info['leaf_id'] + return leaf_info['id'] return None |