def progressBarIterator(func, items):
    '''Function that displays a progress while looping a list of items through the function'''
    # can't figure out why it doesn't work
    # may convert this to a generator
    progressBar = FBProgress()
    progressBar.Caption = str(func.__name__)
    ret = []
    num = len(items)
    try:
        for i, item in enumerate(items):
            progressBar.Text = str(item)
            progressBar.Percent = int(i/num)
            ret.append(func(item))
    finally:
        progressBar.FBDelete()
    
    return ret

################################
# set up decorators            #
################################
dataset/ETHPy150Open CountZer0/PipelineConstructionSet/python/moBu/site-packages/PyMoBu-0.2/pymobu/core.py/progressBarIterator/original