From 23894c64f1f29334f5aa2f8a03a84acb57429eff Mon Sep 17 00:00:00 2001 From: Stelios Tsampas Date: Sun, 24 Oct 2021 19:07:51 +0300 Subject: [PATCH] Add dev scripts for ui/translation generation --- scripts/py2ts.sh | 8 ++++++++ scripts/pylint.sh | 8 ++++++++ ui2py.sh => scripts/ui2py.sh | 7 ++++--- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100755 scripts/py2ts.sh create mode 100755 scripts/pylint.sh rename ui2py.sh => scripts/ui2py.sh (69%) diff --git a/scripts/py2ts.sh b/scripts/py2ts.sh new file mode 100755 index 00000000..a0f7463f --- /dev/null +++ b/scripts/py2ts.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cwd="$(pwd)" +cd "$(dirname "$0")"/.. || exit + +pylupdate5 -noobsolete $(find rare/ -iname "*.py") -ts rare/languages/placeholder.ts + +cd "$cwd" || exit diff --git a/scripts/pylint.sh b/scripts/pylint.sh new file mode 100755 index 00000000..b7722934 --- /dev/null +++ b/scripts/pylint.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +cwd="$(pwd)" +cd "$(dirname "$0")"/.. || exit + +pylint -E rare --jobs=3 --disable=E0611,E1123,E1120 --ignore=ui,singleton.py --extension-pkg-whitelist=PyQt5 + +cd "$cwd" || exit diff --git a/ui2py.sh b/scripts/ui2py.sh similarity index 69% rename from ui2py.sh rename to scripts/ui2py.sh index 25e1e87c..c2f0e899 100755 --- a/ui2py.sh +++ b/scripts/ui2py.sh @@ -1,6 +1,7 @@ -#!/usr/bin/bash +#!/bin/sh -pushd "$(dirname "$0")" || exit +cwd="$(pwd)" +cd "$(dirname "$0")"/.. || exit changed="$(git diff --name-only HEAD | grep '\.ui')" @@ -9,4 +10,4 @@ for ui in $changed; do pyuic5 "${ui}" -x -o "${ui%.ui}.py" done -popd || exit +cd "$cwd" || exit