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