1010import time
1111
1212from lib .core .agent import agent
13+ from lib .core .common import clearConsoleLine
1314from lib .core .common import dataToStdout
14- from lib .core .common import getConsoleWidth
1515from lib .core .common import getFileItems
1616from lib .core .common import popValue
1717from lib .core .common import pushValue
@@ -42,8 +42,8 @@ def tableExists(tableFile):
4242 result = Request .queryPage (agent .payload (newValue = query ))
4343
4444 if result :
45- infoMsg = " \r [%s] [INFO] retrieved: %s" % ( time . strftime ( "%X" ), table )
46- infoMsg = "%s %s\n " % (infoMsg , " " * ( getConsoleWidth () - 1 - len ( infoMsg )) )
45+ clearConsoleLine ( True )
46+ infoMsg = "\r [%s] [INFO] retrieved: %s\n " % (time . strftime ( "%X" ), table )
4747 dataToStdout (infoMsg , True )
4848 retVal .append (table )
4949
@@ -53,7 +53,7 @@ def tableExists(tableFile):
5353
5454 conf .verbose = popValue ()
5555
56- dataToStdout ( " \n " , True )
56+ clearConsoleLine ( True )
5757
5858 if not retVal :
5959 warnMsg = "no table found"
@@ -93,8 +93,8 @@ def columnExists(columnFile):
9393 result = Request .queryPage (agent .payload (newValue = query ))
9494
9595 if result :
96- infoMsg = " \r [%s] [INFO] retrieved: %s" % ( time . strftime ( "%X" ), column )
97- infoMsg = "%s %s\n " % (infoMsg , " " * ( getConsoleWidth () - 1 - len ( infoMsg )) )
96+ clearConsoleLine ( True )
97+ infoMsg = "\r [%s] [INFO] retrieved: %s\n " % (time . strftime ( "%X" ), column )
9898 dataToStdout (infoMsg , True )
9999 retVal .append (column )
100100
@@ -104,7 +104,7 @@ def columnExists(columnFile):
104104
105105 conf .verbose = popValue ()
106106
107- dataToStdout ( " \n " , True )
107+ clearConsoleLine ( True )
108108
109109 if not retVal :
110110 warnMsg = "no column found"
0 commit comments