Gentoo Archives: gentoo-commits

From: Gilles Dartiguelongue <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gnome:gen_archlist_cleanup commit in: scripts/
Date: Fri, 26 Jun 2015 22:32:12
Message-Id: 1435236355.e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4.eva@gentoo
1 commit: e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4
2 Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 24 11:23:40 2015 +0000
4 Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 25 12:45:55 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=e7d972f0
7
8 scripts/gen_archlist: create a clear main function
9
10 scripts/gen_archlist.py | 11 +++++++----
11 1 file changed, 7 insertions(+), 4 deletions(-)
12
13 diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
14 index 407ebbd..6369aa2 100755
15 --- a/scripts/gen_archlist.py
16 +++ b/scripts/gen_archlist.py
17 @@ -493,10 +493,9 @@ def prettify(cpv_kws):
18 # Use the Functions #
19 #####################
20 # cpvs that will make it to the final list
21 -if __name__ == "__main__":
22 - index = 0
23 - array = []
24 -
25 +def main():
26 + """Where the magic happens!"""
27 + ALL_CPV_KWS = []
28 for i in open(CP_FILE).readlines():
29 cp = i[:-1]
30 if cp.startswith('#') or cp.isspace() or not cp:
31 @@ -535,3 +534,7 @@ if __name__ == "__main__":
32
33 for i in prettify(ALL_CPV_KWS):
34 print i[0], flatten(i[1])
35 +
36 +
37 +if __name__ == '__main__':
38 + main()