Skip to content

example showing current record number does not work without total #4

@petere

Description

@petere

This is based on the example in the README file:

from fish import ProgressFish
fish = ProgressFish()

churning = ['a', 'b', 'c']

def churn_churn():
    pass

for i, x in enumerate(churning):
    churn_churn()
    fish.animate(amount=i)

The output is

Traceback (most recent call last):
  File "./test.py", line 12, in <module>
    fish.animate(amount=i)
  File ".../tmp/fish/fish.py", line 166, in animate
    return super(ProgressableFishBase, self).animate(*args, **kwds)
  File ".../tmp/fish/fish.py", line 91, in animate
    step = self.worldstep.next()
  File ".../tmp/fish/fish.py", line 259, in worldstep_progressive
    part = self.amount / float(self.total)
TypeError: float() argument must be a string or a number

If I add a total to the ProgressFish creation, then it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions