commit: 53229170dbe506c5542bd9a68d3d909dfa93cc2c
Author: Matteo Contri <matteo.contri <AT> tecem <DOT> it>
AuthorDate: Wed Mar 23 14:42:19 2016 +0000
Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
CommitDate: Wed Mar 23 15:11:41 2016 +0000
URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=53229170
grs/Rotator.py: make glob more stricter
Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
grs/Rotator.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/grs/Rotator.py b/grs/Rotator.py
index a3684a9..f303c14 100644
--- a/grs/Rotator.py
+++ b/grs/Rotator.py
@@ -42,11 +42,12 @@ class Rotator():
obj's paste an upper limit are deleted.
"""
- objs = glob.glob('%s.*' % obj)
+ objs = glob.glob('%s.[0-9]*' % obj)
indexed_obj = {}
for _obj in objs:
_match = re.search(r'^.+\.(\d+)$', _obj)
- indexed_obj[int(_match.group(1))] = _obj
+ if (_match.group(1)):
+ indexed_obj[int(_match.group(1))] = _obj
count = list(indexed_obj.keys())
count.sort()
count.reverse()