diff options
author | 2016-03-23 15:42:19 +0100 | |
---|---|---|
committer | 2016-03-23 11:15:10 -0400 | |
commit | 73b9004664d281b9e8bff36f81bf887d5c941d93 (patch) | |
tree | deabed316c67fae0d6692620ae0bddebc741a9b5 | |
parent | bin/grsup: dereference sym links so you don't clobber /lib -> /lib64 (diff) | |
download | grss-73b9004664d281b9e8bff36f81bf887d5c941d93.tar.gz grss-73b9004664d281b9e8bff36f81bf887d5c941d93.tar.bz2 grss-73b9004664d281b9e8bff36f81bf887d5c941d93.zip |
grs/Rotator.py: make glob stricter
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r-- | grs/Rotator.py | 5 |
1 files 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() |