From bf1072c9022cd161b9cc4860e5403a463bc0e05b Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Tue, 9 Aug 2016 13:23:53 -0700 Subject: Make Spack core PEP8 compliant. --- bin/spack | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'bin') diff --git a/bin/spack b/bin/spack index e9307d1485..9fed11f33b 100755 --- a/bin/spack +++ b/bin/spack @@ -1,4 +1,5 @@ #!/usr/bin/env python +# flake8: noqa ############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. @@ -24,9 +25,10 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import sys -if not sys.version_info[:2] >= (2,6): +if not sys.version_info[:2] >= (2, 6): v_info = sys.version_info[:3] - sys.exit("Spack requires Python 2.6 or higher. This is Python %d.%d.%d." % v_info) + sys.exit("Spack requires Python 2.6 or higher. " + "This is Python %d.%d.%d." % v_info) import os @@ -62,7 +64,8 @@ for pyc_file in orphaned_pyc_files: try: os.remove(pyc_file) except OSError as e: - print "WARNING: Spack may fail mysteriously. Couldn't remove orphaned .pyc file: %s" % pyc_file + print ("WARNING: Spack may fail mysteriously. " + "Couldn't remove orphaned .pyc file: %s" % pyc_file) # If there is no working directory, use the spack prefix. try: @@ -128,6 +131,7 @@ if len(sys.argv) == 1: # actually parse the args. args = parser.parse_args() + def main(): # Set up environment based on args. tty.set_verbose(args.verbose) @@ -148,7 +152,7 @@ def main(): # If the user asked for it, don't check ssl certs. if args.insecure: - tty.warn("You asked for --insecure, which does not check SSL certificates.") + tty.warn("You asked for --insecure. Will NOT check SSL certificates.") spack.curl.add_default_arg('-k') # Try to load the particular command asked for and run it @@ -167,7 +171,8 @@ def main(): elif isinstance(return_val, int): sys.exit(return_val) else: - tty.die("Bad return value from command %s: %s" % (args.command, return_val)) + tty.die("Bad return value from command %s: %s" + % (args.command, return_val)) if args.profile: import cProfile -- cgit v1.2.3-60-g2f50