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 DBFD9138D02 for ; Fri, 26 Jun 2015 22:32:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 50339E085A; Fri, 26 Jun 2015 22:32:07 +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 C4BE6E0844 for ; Fri, 26 Jun 2015 22:32:05 +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 DE453340A27 for ; Fri, 26 Jun 2015 22:32:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 176E872F for ; Fri, 26 Jun 2015 22:32:03 +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: <1435236355.e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4.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: e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4 X-VCS-Branch: gen_archlist_cleanup Date: Fri, 26 Jun 2015 22:32:03 +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: c6520599-706b-42d0-bdb2-92396fe78b14 X-Archives-Hash: 1d9f7d6d7c875d97241326327801c0da commit: e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4 Author: Gilles Dartiguelongue gentoo org> AuthorDate: Wed Jun 24 11:23:40 2015 +0000 Commit: Gilles Dartiguelongue gentoo org> CommitDate: Thu Jun 25 12:45:55 2015 +0000 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=e7d972f0 scripts/gen_archlist: create a clear main function 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 407ebbd..6369aa2 100755 --- a/scripts/gen_archlist.py +++ b/scripts/gen_archlist.py @@ -493,10 +493,9 @@ def prettify(cpv_kws): # Use the Functions # ##################### # cpvs that will make it to the final list -if __name__ == "__main__": - index = 0 - array = [] - +def main(): + """Where the magic happens!""" + ALL_CPV_KWS = [] for i in open(CP_FILE).readlines(): cp = i[:-1] if cp.startswith('#') or cp.isspace() or not cp: @@ -535,3 +534,7 @@ if __name__ == "__main__": for i in prettify(ALL_CPV_KWS): print i[0], flatten(i[1]) + + +if __name__ == '__main__': + main()