From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A1585138CEE for ; Fri, 26 Jun 2015 22:32:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9413EE0855; Fri, 26 Jun 2015 22:32:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D54BBE086F for ; Fri, 26 Jun 2015 22:32:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 180B0340B0C for ; Fri, 26 Jun 2015 22:32:08 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 501C7740 for ; Fri, 26 Jun 2015 22:32:04 +0000 (UTC) From: "Gilles Dartiguelongue" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Gilles Dartiguelongue" Message-ID: <1435356883.86f443210464a83721be581cc00cfe08dc5632bd.eva@gentoo> Subject: [gentoo-commits] proj/gnome:gen_archlist_cleanup commit in: scripts/ X-VCS-Repository: proj/gnome X-VCS-Files: scripts/gen_archlist.py X-VCS-Directories: scripts/ X-VCS-Committer: eva X-VCS-Committer-Name: Gilles Dartiguelongue X-VCS-Revision: 86f443210464a83721be581cc00cfe08dc5632bd X-VCS-Branch: gen_archlist_cleanup Date: Fri, 26 Jun 2015 22:32:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 78b6734d-8703-4001-8c14-f092ca564ed2 X-Archives-Hash: b336a4ffb47939cf3dd071204bd56820 commit: 86f443210464a83721be581cc00cfe08dc5632bd Author: Gilles Dartiguelongue gentoo org> AuthorDate: Fri Jun 26 22:10:42 2015 +0000 Commit: Gilles Dartiguelongue gentoo org> CommitDate: Fri Jun 26 22:14:43 2015 +0000 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=86f44321 scripts/gen_archlist: simplify logic of file parsing scripts/gen_archlist.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py index 1633dfa..21a196f 100755 --- a/scripts/gen_archlist.py +++ b/scripts/gen_archlist.py @@ -486,11 +486,14 @@ def main(): }) ALL_CPV_KWS = [] - for i in open(args.file).readlines(): - cp = i[:-1] - if cp.startswith('#') or cp.isspace() or not cp: + for line in open(args.file).readlines(): + cp = line.strip() + + # Filter useless lines + if not cp or cp.startswith('#'): continue - if cp.find('#') is not -1: + + if '#' in cp: raise Exception('Inline comments are not supported') # Convert line to CPV(s)