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

Change cairocffi imports for cairo #14

Open
stuaxo opened this issue Feb 25, 2021 · 2 comments
Open

Change cairocffi imports for cairo #14

stuaxo opened this issue Feb 25, 2021 · 2 comments
Assignees

Comments

@stuaxo
Copy link
Contributor

stuaxo commented Feb 25, 2021

Some of the notebooks use import cairocffi as cairo they can just use import cairo

@rlafuente
Copy link
Contributor

With this change there are no more ImportErrors, but when running other bits of code, this chokes on the bot.show() call:

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-3-957b8292ff5e> in <module>
      4 bot.fill(0.8)
      5 bot.rect(40, 50, 50, 30, .4)
----> 6 bot.show()

~/.virtualenvs/jupytershoebot/lib/python3.9/site-packages/shoebot-1.3.1-py3.9.egg/shoebot/grammar/bot.py in show(self, format, as_data)
    398 
    399             surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, self.WIDTH, self.HEIGHT)
--> 400             self.snapshot(surface)
    401             surface.write_to_png(b)
    402             b.seek(0)

~/.virtualenvs/jupytershoebot/lib/python3.9/site-packages/shoebot-1.3.1-py3.9.egg/shoebot/grammar/bot.py in snapshot(self, target, defer, autonumber)
    363             # snapshot to Cairo surface
    364             if defer is None:
--> 365                 self._canvas.snapshot(target, defer)
    366                 defer = False
    367             ctx = cairo.Context(target)

~/.virtualenvs/jupytershoebot/lib/python3.9/site-packages/shoebot-1.3.1-py3.9.egg/shoebot/core/canvas.py in snapshot(self, target, defer, file_number)
    168             self._drawqueue.append(output_func)
    169         else:
--> 170             self._drawqueue.append_immediate(output_func)
    171 
    172     def flush(self, frame):

~/.virtualenvs/jupytershoebot/lib/python3.9/site-packages/shoebot-1.3.1-py3.9.egg/shoebot/core/drawqueue.py in append_immediate(self, render_func)
     47         this will run the whole queue up to this point
     48         """
---> 49         raise NotImplementedError("Not supported in DrawQueue")
     50 
     51     def append(self, render_func):

NotImplementedError: Not supported in DrawQueue

But this is a separate issue i suppose?

@stuaxo
Copy link
Contributor Author

stuaxo commented Feb 26, 2021

Yeah it probably needs it's own issue on shoebot.

It's blocked on this shoebot/shoebot#322

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

2 participants