From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-871777-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 13C9F59CA5 for <garchives@archives.gentoo.org>; Wed, 23 Mar 2016 15:08:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2885C21C018; Wed, 23 Mar 2016 15:08:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 8DB8B21C018 for <gentoo-commits@lists.gentoo.org>; Wed, 23 Mar 2016 15:08:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9405D340BBD for <gentoo-commits@lists.gentoo.org>; Wed, 23 Mar 2016 15:08:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A2A5F1F2 for <gentoo-commits@lists.gentoo.org>; Wed, 23 Mar 2016 15:08:37 +0000 (UTC) From: "Anthony G. Basile" <blueness@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Anthony G. Basile" <blueness@gentoo.org> Message-ID: <1458746110.73b9004664d281b9e8bff36f81bf887d5c941d93.blueness@gentoo> Subject: [gentoo-commits] proj/grss:master commit in: grs/ X-VCS-Repository: proj/grss X-VCS-Files: grs/Rotator.py X-VCS-Directories: grs/ X-VCS-Committer: blueness X-VCS-Committer-Name: Anthony G. Basile X-VCS-Revision: 73b9004664d281b9e8bff36f81bf887d5c941d93 X-VCS-Branch: master Date: Wed, 23 Mar 2016 15:08:37 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 2cf4898b-121d-490b-af9f-5501ebece33d X-Archives-Hash: 2bb8757b54e565f55860274c4fd78f59 commit: 73b9004664d281b9e8bff36f81bf887d5c941d93 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:15:10 2016 +0000 URL: https://gitweb.gentoo.org/proj/grss.git/commit/?id=73b90046 grs/Rotator.py: make glob 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()