INNER CODE UNIT · Python
prefix
vchinnipilli/kubestriker · kubestriker/bars.py:9
def prefix(item):
'''
This function decorates the other functions with bars
'''
def decorator(fun):
@wraps(fun)
def wrapper(*args):
print('\n')
d = (stylize(item, fg("green_1")))
with FillingSquaresBar(d) as bar:
for _ in range(100):
sleep(0.01)
bar.next()
print('\n')
return fun(*args)
return wrapper
return decorator