commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r5028 - trunk/gnue-common


From: jcater
Subject: r5028 - trunk/gnue-common
Date: Thu, 8 Jan 2004 22:24:26 -0600 (CST)

Author: jcater
Date: 2004-01-08 22:24:25 -0600 (Thu, 08 Jan 2004)
New Revision: 5028

Modified:
   trunk/gnue-common/setup-cvs.py
Log:
added --auto support to setup-cvs.py so I can put it on ash nightly

Modified: trunk/gnue-common/setup-cvs.py
===================================================================
--- trunk/gnue-common/setup-cvs.py      2004-01-06 08:46:07 UTC (rev 5027)
+++ trunk/gnue-common/setup-cvs.py      2004-01-09 04:24:25 UTC (rev 5028)
@@ -20,6 +20,17 @@
 # Copyright 2001-2004 Free Software Foundation
 #
 
+
+##########################################################
+#
+#  NOTE: Nightly cron scripts on www.gnuenterprise.org
+#        run this script with --auto, which uses the
+#        defaults passed to getInput.  So, each input
+#        MUST have a sane default or various web functions
+#        might just break.
+#
+
+
 import sys, string, os, glob
 
 
@@ -60,17 +71,22 @@
 
 
 def getInput(message, default, responseSet=None):
+
+  if auto:
+    return default
+
   print ""
   while 1:
-    if default != None:
+    if default:
       print "%s [%s] " % (message, default),
     else:
       print "%s " % (message),
 
+
     val = string.strip(sys.stdin.readline())
     print ""
 
-    if not len(val) and default != None:
+    if not len(val) and default:
       return default
     elif responseSet and string.upper(val) in (responseSet):
       return string.upper(val)
@@ -80,7 +96,11 @@
 
 _getYesNoAllStat = {}
 
-def getYesNo(message, default=None, category=None):
+def getYesNo(message, default, category=None):
+
+  if auto:
+    return default
+
   if category:
     try:
       response = _getYesNoAllStat[category]
@@ -156,6 +176,7 @@
 
 
 restarting = ('--withNewExecutable' in sys.argv)
+auto = ('--auto' in sys.argv)
 
 if not restarting:
   print """
@@ -227,7 +248,7 @@
 each tool separately using it's setup.py script.
   """
 
-  if not getYesNo("Continue installing the CVS-runnable tools? "):
+  if not getYesNo("Continue installing the CVS-runnable tools? ","Y"):
     sys.exit()
 
   exes = findAllPythonExes()
@@ -313,7 +334,7 @@
 do this, enter '-0.1' at the next prompt. Normally, you will
 leave the following option blank."""
 
-SUFFIX = string.strip(getInput ("String to append to script names:",None))
+SUFFIX = string.strip(getInput ("String to append to script names:",""))
 
 while 1:
   CONFDIR = os.path.abspath(
@@ -440,7 +461,7 @@
 
 if getYesNo('Do you have any external/custom packages to setup?','N'):
   while 1:
-    path = getInput("Path to package's directory containing a setup.cvs file? 
(blank line to end)")
+    path = getInput("Path to package's directory containing a setup.cvs file? 
(blank line to end)",None)
     if not path:
       break
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]