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

widgets: add PNG status badge #11466

Merged
merged 2 commits into from
Apr 23, 2024
Merged

widgets: add PNG status badge #11466

merged 2 commits into from
Apr 23, 2024

Conversation

nijel
Copy link
Member

@nijel nijel commented Apr 23, 2024

Proposed changes

It is SVG rendered into PNG using rsvg, which is already pulled as a dependency for Pango/Cairo stack.

Fixes #6221

Checklist

  • Lint and unit tests pass locally with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added documentation to describe my feature.
  • I have squashed my commits into logic units.
  • I have described the changes in the commit messages.

Other information

@nijel nijel added this to the 5.5.1 milestone Apr 23, 2024
@nijel nijel self-assigned this Apr 23, 2024
@nijel nijel requested a review from orangesunny as a code owner April 23, 2024 10:14
nijel added a commit to WeblateOrg/docker that referenced this pull request Apr 23, 2024
It is SVG rendered into PNG using rsvg, which is already pulled as a
dependency for Pango/Cairo stack.

Fixes WeblateOrg#6221
@nijel nijel merged commit dbf4bfe into WeblateOrg:main Apr 23, 2024
16 of 19 checks passed
@nijel nijel deleted the png-badge branch April 23, 2024 12:19
@tipa
Copy link
Contributor

tipa commented Apr 30, 2024

@nijel after this change, I get tons of error reports because Weblate throws errors when trying to get the PNG status badge:

Exception Type: AttributeError at /widget/my_app/status-badge.png Exception Value: 'gi.repository.Rsvg' object has no attribute 'Rectangle'
Raised during: weblate.trans.views.widgets.render_widget

seems like that rsvg dependency is not automatically pulled in for me, even though I have pycairo-1.26.0 installed (via pip)

nijel added a commit that referenced this pull request Apr 30, 2024
The render_document is new feature in 2.46, before there was
render_cairo which is now deprecated.

See #11466
@nijel
Copy link
Member Author

nijel commented Apr 30, 2024

Ah, this interface was added in librsvg 2.46 (see https://lazka.github.io/pgi-docs/Rsvg-2.0/classes/Handle.html#Rsvg.Handle.render_document), so you probably have an older version. I've adjusted the required version in e58b409.

@nijel
Copy link
Member Author

nijel commented Apr 30, 2024

53994d9 should make it work with older versions as well.

nijel added a commit that referenced this pull request Apr 30, 2024
@tipa
Copy link
Contributor

tipa commented Apr 30, 2024

That worked - thanks for the quick help!

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

Successfully merging this pull request may close these issues.

Add png status badge
2 participants