commit: e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 24 11:23:40 2015 +0000
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> 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()