1
0
Fork 0
mirror of https://github.com/YunoHost/apps.git synced 2024-09-03 20:06:07 +02:00

Merge pull request #2145 from YunoHost/store_tomlkit

store: Use tomlkit when create pull requests to add apps to wishlist
This commit is contained in:
Alexandre Aubin 2024-03-19 18:55:50 +01:00 committed by GitHub
commit b30122db42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,7 @@
import time import time
import re import re
import toml import toml
import tomlkit
import base64 import base64
import hashlib import hashlib
import hmac import hmac
@ -331,7 +332,7 @@ def add_to_wishlist():
) )
current_wishlist_sha = current_wishlist_rawtoml.sha current_wishlist_sha = current_wishlist_rawtoml.sha
current_wishlist_rawtoml = current_wishlist_rawtoml.decoded_content.decode() current_wishlist_rawtoml = current_wishlist_rawtoml.decoded_content.decode()
new_wishlist = toml.loads(current_wishlist_rawtoml) new_wishlist = tomlkit.loads(current_wishlist_rawtoml)
if slug in new_wishlist: if slug in new_wishlist:
url = f"https://apps.yunohost.org/wishlist?search={slug}" url = f"https://apps.yunohost.org/wishlist?search={slug}"
@ -356,7 +357,7 @@ def add_to_wishlist():
} }
new_wishlist = dict(sorted(new_wishlist.items())) new_wishlist = dict(sorted(new_wishlist.items()))
new_wishlist_rawtoml = toml.dumps(new_wishlist) new_wishlist_rawtoml = tomlkit.dumps(new_wishlist)
new_branch = f"add-to-wishlist-{slug}" new_branch = f"add-to-wishlist-{slug}"
try: try:
# Get the commit base for the new branch, and create it # Get the commit base for the new branch, and create it

View file

@ -2,6 +2,7 @@ Flask==2.3.2
python-slugify python-slugify
PyGithub PyGithub
toml toml
tomlkit
pycmarkgfm pycmarkgfm
gunicorn gunicorn
emoji emoji