Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwurstsalat <mailtrash@posteo.de>2022-11-29 21:36:31 +0300
committerwurstsalat <mailtrash@posteo.de>2022-11-29 21:36:31 +0300
commit32c8534b1fc02ebd8c0eceaf46abfdf65d1d910d (patch)
tree4748dbfa21603777edf30fc716f4faf9080f7b43
parent067c233b4b0d53c909f5d7babc158388101cbb85 (diff)
Scripts: Type annotations, linting
-rw-r--r--scripts/build_repository.py11
-rwxr-xr-xscripts/update_translations.py1
2 files changed, 4 insertions, 8 deletions
diff --git a/scripts/build_repository.py b/scripts/build_repository.py
index 4289cf8..1c26477 100644
--- a/scripts/build_repository.py
+++ b/scripts/build_repository.py
@@ -2,10 +2,7 @@
# Keep this file python 3.7 compatible because it is executed on the server
from typing import Any
-from typing import Dict
from typing import Iterator
-from typing import Set
-from typing import Dict
import sys
import json
@@ -20,7 +17,7 @@ logging.basicConfig(format=FORMAT, level=logging.DEBUG)
log = logging.getLogger()
-REQUIRED_KEYS: Set[str] = {
+REQUIRED_KEYS: set[str] = {
'authors',
'description',
'homepage',
@@ -32,7 +29,7 @@ REQUIRED_KEYS: Set[str] = {
'version'
}
-PACKAGE_INDEX: Dict[str, Any] = {
+PACKAGE_INDEX: dict[str, Any] = {
'metadata': {
'repository_name': 'master',
'image_path': 'images.zip',
@@ -41,12 +38,12 @@ PACKAGE_INDEX: Dict[str, Any] = {
}
-def is_manifest_valid(manifest: Dict[str, Any]) -> bool:
+def is_manifest_valid(manifest: dict[str, Any]) -> bool:
manifest_keys = set(manifest.keys())
return REQUIRED_KEYS.issubset(manifest_keys)
-def iter_releases(release_folder: Path) -> Iterator[Dict[str, Any]]:
+def iter_releases(release_folder: Path) -> Iterator[dict[str, Any]]:
for path in release_folder.rglob('*.zip'):
with ZipFile(path) as release_zip:
if path.name == 'images.zip':
diff --git a/scripts/update_translations.py b/scripts/update_translations.py
index b7e487e..22a0e69 100755
--- a/scripts/update_translations.py
+++ b/scripts/update_translations.py
@@ -4,7 +4,6 @@ import argparse
import re
import subprocess
from pathlib import Path
-import sys
REPO_DIR = Path(__file__).parent.parent