Move countdown() from catalyst.support to catalyst.util
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 22:15:07 +0000 (16:15 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 22:15:07 +0000 (16:15 -0600)
ChangeLog
modules/catalyst/support.py
modules/catalyst/target/generic_stage.py
modules/catalyst/util.py

index 93503adab1f748ad608a9985f82163bbc5b82f88..4d70f790ed41670a9bd97bf09efbf2e8ae670b1e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,11 @@
 # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 
+  11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+  modules/catalyst/support.py, modules/catalyst/target/generic_stage.py,
+  modules/catalyst/util.py:
+  Move countdown() from catalyst.support to catalyst.util
+
   11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
   modules/catalyst/support.py, modules/catalyst/target/generic_stage.py,
   modules/catalyst/util.py:
index d18e8ae37de2c3b78eea88074b8c355408fef826..923c46637fd0ca25b28deb178f8a0ba6048e1acb 100644 (file)
@@ -551,15 +551,3 @@ def addl_arg_parse(myspec,addlargs,requiredspec,validspec):
                if not x in myspec:
                        raise CatalystError, "Required argument \""+x+"\" not specified."
 
-def countdown(secs=5, doing="Starting"):
-        if secs:
-               print ">>> Waiting",secs,"seconds before starting..."
-               print ">>> (Control-C to abort)...\n"+doing+" in: ",
-               ticks=range(secs)
-               ticks.reverse()
-               for sec in ticks:
-                       sys.stdout.write(str(sec+1)+" ")
-                       sys.stdout.flush()
-                       time.sleep(1)
-               print
-
index d4b7f26126ff808a50e459c16337709aca2d8983..1e18ac51a44b53c17b5f22807c0f95881fe507bf 100644 (file)
@@ -1618,7 +1618,7 @@ class generic_stage_target(generic_target):
                                myf.close()
 
        def purge(self):
-               countdown(10,"Purging Caches ...")
+               catalyst.util.countdown(10, "Purging Caches ...")
                if "PURGE" in self.settings or "PURGEONLY" in self.settings:
                        print "clearing autoresume ..."
                        self.clear_autoresume()
index 74d89e9426455d01d5a41ebb5ad403eb6c42d322..5bc6cb7c2375f2b411dd5a0bcac82ad92274e68e 100644 (file)
@@ -128,3 +128,16 @@ def generate_contents(file, contents_function="auto", verbose=False):
                        "Error generating contents, is appropriate utility (%s) installed on your system?" \
                        % (contents_function, )
 
+def countdown(secs=5, doing="Starting"):
+       if secs:
+               print ">>> Waiting " + secs + " seconds before starting..."
+               print ">>> (Control-C to abort)..."
+               print doing + " in: ",
+               ticks = range(secs)
+               ticks.reverse()
+               for sec in ticks:
+                       sys.stdout.write(str(sec+1) + " ")
+                       sys.stdout.flush()
+                       time.sleep(1)
+               print
+