Browse Source

grs/Rotator.py: make glob stricter

Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
master
Matteo Contri 7 years ago
committed by Anthony G. Basile
parent
commit
73b9004664
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      grs/Rotator.py

+ 3
- 2
grs/Rotator.py View File

@ -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()


Loading…
Cancel
Save