mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-23 19:19:53 +02:00
Updated printWaiter()
This commit is contained in:
1 parent
6e592f793d
commit
cd93f815bd
1 file changed
+16
-2
+16
-2
@@ -9,6 +9,8 @@ SLEEP = 3
|
|||||||
DEBUG = False
|
DEBUG = False
|
||||||
VERBOSE = False
|
VERBOSE = False
|
||||||
SILENT = False
|
SILENT = False
|
||||||
|
WAITER_N = 0
|
||||||
|
WAITER_I = 0
|
||||||
UMASK= os.umask(0)
|
UMASK= os.umask(0)
|
||||||
os.umask(UMASK)
|
os.umask(UMASK)
|
||||||
|
|
||||||
@@ -64,15 +66,27 @@ def verbose_std(msg = "", n = None):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def printWaiter(force = False):
|
def printWaiter(force = False):
|
||||||
|
global WAITER_N, WAITER_I
|
||||||
if not DEBUG and (not SILENT or force):
|
if not DEBUG and (not SILENT or force):
|
||||||
print('.', end='', flush=True)
|
if WAITER_N > 0:
|
||||||
|
WAITER_I = (WAITER_I+1) % WAITER_N
|
||||||
|
if WAITER_I == 0:
|
||||||
|
print('.', end='', flush=True)
|
||||||
|
else:
|
||||||
|
print('.', end='', flush=True)
|
||||||
|
|
||||||
|
def setWaiter(n: int):
|
||||||
|
global WAITER_N
|
||||||
|
if n > -1:
|
||||||
|
WAITER_N = n
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
def wait(sec : int):
|
def wait(sec : int):
|
||||||
for i in range(0, sec):
|
for i in range(0, sec):
|
||||||
i=i ## to get rid of the warning...
|
i=i ## to get rid of the warning...
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
printWaiter()
|
printWaiter(True)
|
||||||
print('', flush=True)
|
print('', flush=True)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user