summaryrefslogtreecommitdiff
path: root/obnamlib/repo_interface.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-01-18 21:07:06 +0200
committerLars Wirzenius <liw@liw.fi>2015-01-18 21:07:06 +0200
commitd70ac6ce86ee53275710854af21d9501960d4c0c (patch)
tree62749e46856254bae130b80cee42df0d6f559569 /obnamlib/repo_interface.py
parent1436c0d54605f23a6891cbc07f37455ef1481fd4 (diff)
downloadobnam-d70ac6ce86ee53275710854af21d9501960d4c0c.tar.gz
Return integer timestamps for generations
Diffstat (limited to 'obnamlib/repo_interface.py')
-rw-r--r--obnamlib/repo_interface.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/obnamlib/repo_interface.py b/obnamlib/repo_interface.py
index f41f6114..f8057fef 100644
--- a/obnamlib/repo_interface.py
+++ b/obnamlib/repo_interface.py
@@ -73,11 +73,13 @@ _integer_keys = [
for i, name in enumerate(_string_keys + _integer_keys):
globals()[name] = i
-REPO_FILE_INTEGER_KEYS = [
- globals()[name]
- for name in _integer_keys
- if name.startswith('REPO_FILE_')
- ]
+def _filter_integer_keys(prefix):
+ return [globals()[name]
+ for name in _integer_keys
+ if name.startswith(prefix)]
+
+REPO_GENERATION_INTEGER_KEYS = _filter_integer_keys('REPO_GENERATION_')
+REPO_FILE_INTEGER_KEYS = _filter_integer_keys('REPO_FILE_')
def repo_key_name(key_value):