Merge pull request #13 from YunoHost-Apps/fix-screenshots

Fix screenshots
This commit is contained in:
Jens Diemer 2022-04-08 18:35:09 +02:00 committed by GitHub
commit 6160c76af2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 5 deletions

View file

@ -37,8 +37,8 @@ This package for YunoHost used [django-yunohost-integration](https://github.com/
## Screenshots ## Screenshots
![](./doc/screenshots/v0.0.2 - hosts change list.png) ![](./doc/screenshots/v002_hosts_change_list.png)
![](./doc/screenshots/v0.1.0.rc1 - Group Management.png) ![](./doc/screenshots/v010rc1_group_management.png)
## Disclaimers / important information ## Disclaimers / important information

View file

@ -33,8 +33,8 @@ This package for YunoHost used [django-yunohost-integration](https://github.com/
## Captures d'écran ## Captures d'écran
![](./doc/screenshots/v0.0.2 - hosts change list.png) ![](./doc/screenshots/v002_hosts_change_list.png)
![](./doc/screenshots/v0.1.0.rc1 - Group Management.png) ![](./doc/screenshots/v010rc1_group_management.png)
## Avertissements / informations importantes ## Avertissements / informations importantes

View file

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View file

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View file

@ -4,7 +4,8 @@ import shutil
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from bx_py_utils.path import assert_is_file from bx_django_utils.filename import clean_filename
from bx_py_utils.path import assert_is_dir, assert_is_file
import djfritz import djfritz
@ -69,3 +70,20 @@ def test_requirements_txt():
) )
print(diff) print(diff)
assert diff == '', f'{requirements_txt} is not up-to-date! (Hint: call: "make update")' assert diff == '', f'{requirements_txt} is not up-to-date! (Hint: call: "make update")'
def test_screenshot_filenames():
"""
https://forum.yunohost.org/t/yunohost-bot-cant-handle-spaces-in-screenshots/19483
"""
screenshot_path = PACKAGE_ROOT / 'doc' / 'screenshots'
assert_is_dir(screenshot_path)
renamed = []
for file_path in screenshot_path.iterdir():
file_name = file_path.name
cleaned_name = clean_filename(file_name)
if cleaned_name != file_name:
new_path = file_path.with_name(cleaned_name)
file_path.rename(new_path)
renamed.append(f'{file_name!r} renamed to {cleaned_name!r}')
assert not renamed, f'Bad screenshots file names found: {", ".join(renamed)}'