Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
petere opened this issue Oct 17, 2012 · 0 comments
Open

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

petere opened this issue Oct 17, 2012 · 0 comments

Comments

@petere
Copy link

petere commented Oct 17, 2012

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.

nyanshell added a commit to nyanshell/fish that referenced this issue Dec 9, 2014
nyanshell added a commit to nyanshell/fish that referenced this issue Dec 9, 2014
lericson added a commit that referenced this issue Feb 2, 2015
dandavison added a commit to dandavison/music-graph that referenced this issue Nov 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant