always use print_function
[bootmanager.git] / source / steps / ConfirmInstallWithUser.py
index 7d2a6e3..1a18387 100644 (file)
@@ -1,11 +1,13 @@
-#!/usr/bin/python2
-
+#!/usr/bin/python
+#
 # Copyright (c) 2003 Intel Corporation
 # All rights reserved.
 #
 # Copyright (c) 2004-2006 The Trustees of Princeton University
 # All rights reserved.
 
+from __future__ import print_function
+
 from Exceptions import *
 
 welcome_message= \
@@ -36,7 +38,7 @@ WARNING : Installing PlanetLab will remove any existing operating system and
 """
 
 
-def Run( vars, log ):
+def Run(vars, log):
     """
     Ask the user if we really want to wipe this machine.
 
@@ -44,25 +46,25 @@ def Run( vars, log ):
     a BootManagerException if anything unexpected occurred.
     """
 
-    log.write( "\n\nStep: Confirming install with user.\n" )
+    log.write("\n\nStep: Confirming install with user.\n")
     
     try:
-        confirmation= ""
-        install= 0
-        print welcome_message
+        confirmation = ""
+        install = 0
+        print(welcome_message)
         
         while confirmation not in ("yes","no"):
-            confirmation= \
-                raw_input("Are you sure you wish to continue (yes/no):")
-        install= confirmation=="yes"
-    except EOFError, e:
+            confirmation = \
+                raw_input("Are you sure you wish to continue (yes/no): ")
+        install = confirmation=="yes"
+    except EOFError as e:
         pass
-    except KeyboardInterrupt, e:
+    except KeyboardInterrupt as e:
         pass
     
     if install:
-        log.write( "\nUser accepted install.\n" )
+        log.write("\nUser accepted install.\n")
     else:
-        log.write( "\nUser canceled install.\n" )
+        log.write("\nUser canceled install.\n")
         
     return install