Support single callback that do not get any number

This commit is contained in:
Florian Festi 2016-07-13 13:35:08 +02:00
parent 4dd61691d2
commit a2a2695c03
1 changed files with 4 additions and 1 deletions

View File

@ -391,6 +391,9 @@ class Boxes:
self.ctx.save() self.ctx.save()
self.moveTo(x, y) self.moveTo(x, y)
if callable(callback): if callable(callback):
if number is None:
callback()
else:
callback(number) callback(number)
elif hasattr(callback, '__getitem__'): elif hasattr(callback, '__getitem__'):
try: try: