Closed roberto-arista closed 1 year ago
Hey Just, I've read the docs for contextlib.contextmanager
but I am a bit confused on how it applies to this case. The docs say
The function being decorated must return a generator-iterator when called. This iterator must yield exactly one value, which will be bound to the targets in the with statement’s as clause, if any.
How can drawing()
return a generator-iterator?
I will add the expected example test images
As per the example from the docs, it should look roughly like this:
@contextlib.contextmanager
def drawing(self):
self.newDrawing()
try:
yield
finally:
self.endDrawing()
The code should be fine, now it seems I have to figure out the tests images
the same contextmanager could be used for savedState
👋
I could not open a separate pull request because this one has not been merged yet. I added the kern
feature to the documentation as I discovered by chance that it is supported by openTypeFeatures()
Hey all! Is there anything I can do to push forward this pull request? I think it would be a nice addition to the drawbot API!
🎉
I could not open a separate pull request because this one has not been merged yet.
PR's don't need to be merged in order of creation, especially if their respective changes don't conflict.
And once one is merged, it is possible to rebase the other.
Wait, I thought this was merged, instead it was only approved. I'll reopen the pull request!
following this discussion: #474