Remove redundant __main__ blocks from packaging modules.
authorÉric Araujo <merwok@netwok.org>
Sun, 6 Nov 2011 10:38:58 +0000 (11:38 +0100)
committerÉric Araujo <merwok@netwok.org>
Sun, 6 Nov 2011 10:38:58 +0000 (11:38 +0100)
The one interface we commit to maintain is the run module
(a.k.a. the pysetup script).

Lib/packaging/create.py
Lib/packaging/depgraph.py
Lib/packaging/install.py

index de05ac8a199b4bc43d68078b0d7baca131a38f3b..5abe47b37ddecffec9b72cbe9233c2fc7c1def7a 100644 (file)
@@ -674,7 +674,3 @@ def main():
     # program.write_setup_script()
     # packaging.util.cfg_to_args()
     program()
-
-
-if __name__ == '__main__':
-    main()
index 843aab47b0804de8fe5bee5d1a4bfe159a5784e0..d633b636ad8c8e11f96e0ca2e9b4022d970ce3a6 100644 (file)
@@ -224,6 +224,7 @@ def dependent_dists(dists, dist):
 
 
 def main():
+    # XXX move to run._graph
     from packaging.database import get_distributions
     tempout = StringIO()
     try:
@@ -267,7 +268,3 @@ def main():
     else:
         print('Supported option: -d [filename]')
         sys.exit(1)
-
-
-if __name__ == '__main__':
-    main()
index b6816e56b29f44ccd195c714307e8d93df20ca69..776ba4014c3cc6355f856ac06e846b293c9bf3a9 100644 (file)
@@ -527,12 +527,3 @@ def install(project):
             logger.info('%r conflicts with %s', project, ','.join(projects))
 
     return True
-
-
-def _main(**attrs):
-    if 'script_args' not in attrs:
-        attrs['requirements'] = sys.argv[1]
-    get_infos(**attrs)
-
-if __name__ == '__main__':
-    _main()