]> scripts.mit.edu Git - wizard.git/blobdiff - bin/wizard
Reduce concurrency; update TODO.
[wizard.git] / bin / wizard
index 1dc3144f529579f263b5dc64086234eb242aa290..daf50c303655c8513ad7b1b00e07c553b35ce05f 100755 (executable)
@@ -9,10 +9,10 @@ import traceback
 # import some non-standard modules to make it fail out early
 import decorator
 
-sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+sys.path.insert(0,os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
 
 import wizard
-from wizard import command
+from wizard import command, prompt
 
 def main():
     usage = """usage: %prog COMMAND [ARGS]
@@ -23,6 +23,7 @@ User commands:
     backup          Backup data not on filesystem (database, etc)
     install         Installs an application
     migrate         Migrate autoinstalls from old format to Git-based format
+    remove          Removes an autoinstall, databases and other files
     restore         Restores files and database to previous version
     upgrade         Upgrades an autoinstall to the latest version
 
@@ -36,10 +37,10 @@ Administrative commands:
     summary         Generate statistics (see help for subcommands)
 
 Utility commands:
-    configure       Configures an autoinstall (database, etc) to work
     prepare-pristine    Downloads and extracts pristine upstream files
     prepare-new     Prepares a new repository
     prepare-config  Prepares configuration files for versioning
+    quota           Prints the usage and available quota of a directory
 
 See '%prog help COMMAND' for more information on a specific command."""
 
@@ -63,7 +64,7 @@ See '%prog help COMMAND' for more information on a specific command."""
     baton.add("--no-parallelize", dest="no_parallelize", action="store_true",
             default=False, help="Turn off parallelization")
     baton.add("--max-processes", dest="max_processes", type="int", metavar="N",
-            default=10, help="Maximum subprocesses to run concurrently")
+            default=5, help="Maximum subprocesses to run concurrently")
     baton.add("--limit", dest="limit", type="int",
             default=None, help="Limit the number of autoinstalls to look at.")
     baton.add("--user", "-u", dest="user",
@@ -89,16 +90,25 @@ See '%prog help COMMAND' for more information on a specific command."""
     command_module = get_command(command_name)
     try:
         command_module.main(rest_argv, baton)
+    except prompt.UserCancel as e:
+        print str(e)
+        sys.exit(1)
     except Exception as e:
         # log the exception
         msg = traceback.format_exc()
         if command.logging_setup:
-            logging.error(msg)
+            outfun = logging.error
         else:
-            sys.stderr.write(msg)
+            outfun = sys.stderr.write
         if isinstance(e, wizard.Error):
+            if e.quiet and not command.debug:
+                msg = str(e)
+                if command.logging_setup:
+                    msg = msg.replace("ERROR: ", "")
+            outfun(msg)
             sys.exit(e.exitcode)
         else:
+            outfun(msg)
             sys.exit(1)
 
 def get_command(name):