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: Wed, 24 Jun 2015 12:14:22
Message-Id: 1435147881.1bd25971019ba10858560e79e3040b5d4101f61a.eva@gentoo
1 commit: 1bd25971019ba10858560e79e3040b5d4101f61a
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: Wed Jun 24 12:11:21 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=1bd25971
7
8 scripts/gen_archlist: Create a clear main function
9
10 scripts/gen_archlist.py | 10 ++++++----
11 1 file changed, 6 insertions(+), 4 deletions(-)
12
13 diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
14 index 407ebbd..e41b20d 100755
15 --- a/scripts/gen_archlist.py
16 +++ b/scripts/gen_archlist.py
17 @@ -493,10 +493,8 @@ 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 for i in open(CP_FILE).readlines():
28 cp = i[:-1]
29 if cp.startswith('#') or cp.isspace() or not cp:
30 @@ -535,3 +533,7 @@ if __name__ == "__main__":
31
32 for i in prettify(ALL_CPV_KWS):
33 print i[0], flatten(i[1])
34 +
35 +
36 +if __name__ == '__main__':
37 + main()