summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilles Dartiguelongue <eva@gentoo.org>2015-06-24 13:23:40 +0200
committerGilles Dartiguelongue <eva@gentoo.org>2015-06-25 14:45:55 +0200
commite7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4 (patch)
tree708d0f68c908afee253ed9b1103b49a786308faa /scripts
parentscripts/gen_archlist: apply PEP8 rules (diff)
downloadgnome-e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4.tar.gz
gnome-e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4.tar.bz2
gnome-e7d972f07e900247f39cdf0ae0e3b03d6e4f9eb4.zip
scripts/gen_archlist: create a clear main function
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen_archlist.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py
index 407ebbd3..6369aa20 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()