From cdd085fd4823db1bf7270657c2ca084ba75d7408 Mon Sep 17 00:00:00 2001 From: miro Date: Mon, 4 Nov 2024 17:45:49 +0000 Subject: [PATCH] fix: gui resources path --- {ui => gui/qt5}/CurrentWeather.qml | 0 {ui => gui/qt5}/DailyForecast.qml | 0 .../qt5}/DailyForecastColumnDelegate.qml | 0 {ui => gui/qt5}/HourlyForecast.qml | 0 .../qt5}/HourlyForecastColumnDelegate.qml | 0 {ui => gui/qt5}/SingleDay.qml | 0 {ui => gui/qt5}/SunriseSunset.qml | 0 {ui => gui/qt5}/WeatherDelegate.qml | 0 {ui => gui/qt5}/animations/clouds.json | 0 {ui => gui/qt5}/animations/fog.json | 0 {ui => gui/qt5}/animations/night.json | 0 .../qt5}/animations/partial_clouds.json | 0 {ui => gui/qt5}/animations/rain.json | 0 {ui => gui/qt5}/animations/sleet.json | 0 {ui => gui/qt5}/animations/snow.json | 0 {ui => gui/qt5}/animations/storm.json | 0 {ui => gui/qt5}/animations/sun.json | 0 {ui => gui/qt5}/backgrounds/Rainy.qml | 0 {ui => gui/qt5}/backgrounds/Simple.qml | 0 {ui => gui/qt5}/backgrounds/Snowy.qml | 0 .../qt5}/backgrounds/components/Rain.qml | 0 .../qt5}/backgrounds/components/Snow.qml | 0 {ui => gui/qt5}/backgrounds/components/qmldir | 0 {ui => gui/qt5}/backgrounds/qmldir | 0 .../qt5}/images/chanceprecipitation.svg | 0 {ui => gui/qt5}/images/clouds.svg | 0 {ui => gui/qt5}/images/day.jpg | Bin {ui => gui/qt5}/images/fog.svg | 0 {ui => gui/qt5}/images/high_temperature.svg | 0 {ui => gui/qt5}/images/humidity.svg | 0 {ui => gui/qt5}/images/low_temperature.svg | 0 {ui => gui/qt5}/images/moon.svg | 0 {ui => gui/qt5}/images/night.jpg | Bin {ui => gui/qt5}/images/night.svg | 0 {ui => gui/qt5}/images/partial_clouds_day.svg | 0 .../qt5}/images/partial_clouds_night.svg | 0 {ui => gui/qt5}/images/rain.svg | 0 {ui => gui/qt5}/images/snow.svg | 0 {ui => gui/qt5}/images/storm.svg | 0 {ui => gui/qt5}/images/sun.svg | 0 {ui => gui/qt5}/images/sunrise.svg | 0 {ui => gui/qt5}/images/sunset.svg | 0 {ui => gui/qt5}/images/wind.svg | 0 {ui => gui/qt5}/qmldir | 0 .../qt5}/translations/DailyForecast_de.ts | 0 .../qt5}/translations/DailyForecast_es.ts | 0 .../qt5}/translations/DailyForecast_fr.ts | 0 .../qt5}/translations/DailyForecast_it.ts | 0 .../qt5}/translations/DailyForecast_nl.ts | 0 .../qt5}/translations/DailyForecast_pt.ts | 0 .../qt5}/translations/HourlyForecast_de.ts | 0 .../qt5}/translations/HourlyForecast_es.ts | 0 .../qt5}/translations/HourlyForecast_fr.ts | 0 .../qt5}/translations/HourlyForecast_it.ts | 0 .../qt5}/translations/HourlyForecast_nl.ts | 0 .../qt5}/translations/HourlyForecast_pt.ts | 0 .../skill-ovos-weather.openvoiceos_de.qm | Bin .../skill-ovos-weather.openvoiceos_es.qm | Bin .../skill-ovos-weather.openvoiceos_fr.qm | Bin .../skill-ovos-weather.openvoiceos_it.qm | Bin .../skill-ovos-weather.openvoiceos_nl.qm | Bin .../skill-ovos-weather.openvoiceos_pt.qm | Bin scripts/bump_alpha.py | 18 -- scripts/bump_build.py | 21 --- scripts/bump_major.py | 27 --- scripts/bump_minor.py | 24 --- scripts/prepare_skillstore.py | 76 --------- scripts/prepare_translations.py | 53 ------ scripts/remove_alpha.py | 13 -- scripts/translate.py | 157 ------------------ setup.py | 2 +- test/unittests/osm_tests.py | 30 ---- 72 files changed, 1 insertion(+), 420 deletions(-) rename {ui => gui/qt5}/CurrentWeather.qml (100%) rename {ui => gui/qt5}/DailyForecast.qml (100%) rename {ui => gui/qt5}/DailyForecastColumnDelegate.qml (100%) rename {ui => gui/qt5}/HourlyForecast.qml (100%) rename {ui => gui/qt5}/HourlyForecastColumnDelegate.qml (100%) rename {ui => gui/qt5}/SingleDay.qml (100%) rename {ui => gui/qt5}/SunriseSunset.qml (100%) rename {ui => gui/qt5}/WeatherDelegate.qml (100%) rename {ui => gui/qt5}/animations/clouds.json (100%) rename {ui => gui/qt5}/animations/fog.json (100%) rename {ui => gui/qt5}/animations/night.json (100%) rename {ui => gui/qt5}/animations/partial_clouds.json (100%) rename {ui => gui/qt5}/animations/rain.json (100%) rename {ui => gui/qt5}/animations/sleet.json (100%) rename {ui => gui/qt5}/animations/snow.json (100%) rename {ui => gui/qt5}/animations/storm.json (100%) rename {ui => gui/qt5}/animations/sun.json (100%) rename {ui => gui/qt5}/backgrounds/Rainy.qml (100%) rename {ui => gui/qt5}/backgrounds/Simple.qml (100%) rename {ui => gui/qt5}/backgrounds/Snowy.qml (100%) rename {ui => gui/qt5}/backgrounds/components/Rain.qml (100%) rename {ui => gui/qt5}/backgrounds/components/Snow.qml (100%) rename {ui => gui/qt5}/backgrounds/components/qmldir (100%) rename {ui => gui/qt5}/backgrounds/qmldir (100%) rename {ui => gui/qt5}/images/chanceprecipitation.svg (100%) rename {ui => gui/qt5}/images/clouds.svg (100%) rename {ui => gui/qt5}/images/day.jpg (100%) rename {ui => gui/qt5}/images/fog.svg (100%) rename {ui => gui/qt5}/images/high_temperature.svg (100%) rename {ui => gui/qt5}/images/humidity.svg (100%) rename {ui => gui/qt5}/images/low_temperature.svg (100%) rename {ui => gui/qt5}/images/moon.svg (100%) rename {ui => gui/qt5}/images/night.jpg (100%) rename {ui => gui/qt5}/images/night.svg (100%) rename {ui => gui/qt5}/images/partial_clouds_day.svg (100%) rename {ui => gui/qt5}/images/partial_clouds_night.svg (100%) rename {ui => gui/qt5}/images/rain.svg (100%) rename {ui => gui/qt5}/images/snow.svg (100%) rename {ui => gui/qt5}/images/storm.svg (100%) rename {ui => gui/qt5}/images/sun.svg (100%) rename {ui => gui/qt5}/images/sunrise.svg (100%) rename {ui => gui/qt5}/images/sunset.svg (100%) rename {ui => gui/qt5}/images/wind.svg (100%) rename {ui => gui/qt5}/qmldir (100%) rename {ui => gui/qt5}/translations/DailyForecast_de.ts (100%) rename {ui => gui/qt5}/translations/DailyForecast_es.ts (100%) rename {ui => gui/qt5}/translations/DailyForecast_fr.ts (100%) rename {ui => gui/qt5}/translations/DailyForecast_it.ts (100%) rename {ui => gui/qt5}/translations/DailyForecast_nl.ts (100%) rename {ui => gui/qt5}/translations/DailyForecast_pt.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_de.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_es.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_fr.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_it.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_nl.ts (100%) rename {ui => gui/qt5}/translations/HourlyForecast_pt.ts (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_de.qm (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_es.qm (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_fr.qm (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_it.qm (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_nl.qm (100%) rename {ui => gui/qt5}/translations/skill-ovos-weather.openvoiceos_pt.qm (100%) delete mode 100644 scripts/bump_alpha.py delete mode 100644 scripts/bump_build.py delete mode 100644 scripts/bump_major.py delete mode 100644 scripts/bump_minor.py delete mode 100644 scripts/prepare_skillstore.py delete mode 100644 scripts/prepare_translations.py delete mode 100644 scripts/remove_alpha.py delete mode 100644 scripts/translate.py delete mode 100644 test/unittests/osm_tests.py diff --git a/ui/CurrentWeather.qml b/gui/qt5/CurrentWeather.qml similarity index 100% rename from ui/CurrentWeather.qml rename to gui/qt5/CurrentWeather.qml diff --git a/ui/DailyForecast.qml b/gui/qt5/DailyForecast.qml similarity index 100% rename from ui/DailyForecast.qml rename to gui/qt5/DailyForecast.qml diff --git a/ui/DailyForecastColumnDelegate.qml b/gui/qt5/DailyForecastColumnDelegate.qml similarity index 100% rename from ui/DailyForecastColumnDelegate.qml rename to gui/qt5/DailyForecastColumnDelegate.qml diff --git a/ui/HourlyForecast.qml b/gui/qt5/HourlyForecast.qml similarity index 100% rename from ui/HourlyForecast.qml rename to gui/qt5/HourlyForecast.qml diff --git a/ui/HourlyForecastColumnDelegate.qml b/gui/qt5/HourlyForecastColumnDelegate.qml similarity index 100% rename from ui/HourlyForecastColumnDelegate.qml rename to gui/qt5/HourlyForecastColumnDelegate.qml diff --git a/ui/SingleDay.qml b/gui/qt5/SingleDay.qml similarity index 100% rename from ui/SingleDay.qml rename to gui/qt5/SingleDay.qml diff --git a/ui/SunriseSunset.qml b/gui/qt5/SunriseSunset.qml similarity index 100% rename from ui/SunriseSunset.qml rename to gui/qt5/SunriseSunset.qml diff --git a/ui/WeatherDelegate.qml b/gui/qt5/WeatherDelegate.qml similarity index 100% rename from ui/WeatherDelegate.qml rename to gui/qt5/WeatherDelegate.qml diff --git a/ui/animations/clouds.json b/gui/qt5/animations/clouds.json similarity index 100% rename from ui/animations/clouds.json rename to gui/qt5/animations/clouds.json diff --git a/ui/animations/fog.json b/gui/qt5/animations/fog.json similarity index 100% rename from ui/animations/fog.json rename to gui/qt5/animations/fog.json diff --git a/ui/animations/night.json b/gui/qt5/animations/night.json similarity index 100% rename from ui/animations/night.json rename to gui/qt5/animations/night.json diff --git a/ui/animations/partial_clouds.json b/gui/qt5/animations/partial_clouds.json similarity index 100% rename from ui/animations/partial_clouds.json rename to gui/qt5/animations/partial_clouds.json diff --git a/ui/animations/rain.json b/gui/qt5/animations/rain.json similarity index 100% rename from ui/animations/rain.json rename to gui/qt5/animations/rain.json diff --git a/ui/animations/sleet.json b/gui/qt5/animations/sleet.json similarity index 100% rename from ui/animations/sleet.json rename to gui/qt5/animations/sleet.json diff --git a/ui/animations/snow.json b/gui/qt5/animations/snow.json similarity index 100% rename from ui/animations/snow.json rename to gui/qt5/animations/snow.json diff --git a/ui/animations/storm.json b/gui/qt5/animations/storm.json similarity index 100% rename from ui/animations/storm.json rename to gui/qt5/animations/storm.json diff --git a/ui/animations/sun.json b/gui/qt5/animations/sun.json similarity index 100% rename from ui/animations/sun.json rename to gui/qt5/animations/sun.json diff --git a/ui/backgrounds/Rainy.qml b/gui/qt5/backgrounds/Rainy.qml similarity index 100% rename from ui/backgrounds/Rainy.qml rename to gui/qt5/backgrounds/Rainy.qml diff --git a/ui/backgrounds/Simple.qml b/gui/qt5/backgrounds/Simple.qml similarity index 100% rename from ui/backgrounds/Simple.qml rename to gui/qt5/backgrounds/Simple.qml diff --git a/ui/backgrounds/Snowy.qml b/gui/qt5/backgrounds/Snowy.qml similarity index 100% rename from ui/backgrounds/Snowy.qml rename to gui/qt5/backgrounds/Snowy.qml diff --git a/ui/backgrounds/components/Rain.qml b/gui/qt5/backgrounds/components/Rain.qml similarity index 100% rename from ui/backgrounds/components/Rain.qml rename to gui/qt5/backgrounds/components/Rain.qml diff --git a/ui/backgrounds/components/Snow.qml b/gui/qt5/backgrounds/components/Snow.qml similarity index 100% rename from ui/backgrounds/components/Snow.qml rename to gui/qt5/backgrounds/components/Snow.qml diff --git a/ui/backgrounds/components/qmldir b/gui/qt5/backgrounds/components/qmldir similarity index 100% rename from ui/backgrounds/components/qmldir rename to gui/qt5/backgrounds/components/qmldir diff --git a/ui/backgrounds/qmldir b/gui/qt5/backgrounds/qmldir similarity index 100% rename from ui/backgrounds/qmldir rename to gui/qt5/backgrounds/qmldir diff --git a/ui/images/chanceprecipitation.svg b/gui/qt5/images/chanceprecipitation.svg similarity index 100% rename from ui/images/chanceprecipitation.svg rename to gui/qt5/images/chanceprecipitation.svg diff --git a/ui/images/clouds.svg b/gui/qt5/images/clouds.svg similarity index 100% rename from ui/images/clouds.svg rename to gui/qt5/images/clouds.svg diff --git a/ui/images/day.jpg b/gui/qt5/images/day.jpg similarity index 100% rename from ui/images/day.jpg rename to gui/qt5/images/day.jpg diff --git a/ui/images/fog.svg b/gui/qt5/images/fog.svg similarity index 100% rename from ui/images/fog.svg rename to gui/qt5/images/fog.svg diff --git a/ui/images/high_temperature.svg b/gui/qt5/images/high_temperature.svg similarity index 100% rename from ui/images/high_temperature.svg rename to gui/qt5/images/high_temperature.svg diff --git a/ui/images/humidity.svg b/gui/qt5/images/humidity.svg similarity index 100% rename from ui/images/humidity.svg rename to gui/qt5/images/humidity.svg diff --git a/ui/images/low_temperature.svg b/gui/qt5/images/low_temperature.svg similarity index 100% rename from ui/images/low_temperature.svg rename to gui/qt5/images/low_temperature.svg diff --git a/ui/images/moon.svg b/gui/qt5/images/moon.svg similarity index 100% rename from ui/images/moon.svg rename to gui/qt5/images/moon.svg diff --git a/ui/images/night.jpg b/gui/qt5/images/night.jpg similarity index 100% rename from ui/images/night.jpg rename to gui/qt5/images/night.jpg diff --git a/ui/images/night.svg b/gui/qt5/images/night.svg similarity index 100% rename from ui/images/night.svg rename to gui/qt5/images/night.svg diff --git a/ui/images/partial_clouds_day.svg b/gui/qt5/images/partial_clouds_day.svg similarity index 100% rename from ui/images/partial_clouds_day.svg rename to gui/qt5/images/partial_clouds_day.svg diff --git a/ui/images/partial_clouds_night.svg b/gui/qt5/images/partial_clouds_night.svg similarity index 100% rename from ui/images/partial_clouds_night.svg rename to gui/qt5/images/partial_clouds_night.svg diff --git a/ui/images/rain.svg b/gui/qt5/images/rain.svg similarity index 100% rename from ui/images/rain.svg rename to gui/qt5/images/rain.svg diff --git a/ui/images/snow.svg b/gui/qt5/images/snow.svg similarity index 100% rename from ui/images/snow.svg rename to gui/qt5/images/snow.svg diff --git a/ui/images/storm.svg b/gui/qt5/images/storm.svg similarity index 100% rename from ui/images/storm.svg rename to gui/qt5/images/storm.svg diff --git a/ui/images/sun.svg b/gui/qt5/images/sun.svg similarity index 100% rename from ui/images/sun.svg rename to gui/qt5/images/sun.svg diff --git a/ui/images/sunrise.svg b/gui/qt5/images/sunrise.svg similarity index 100% rename from ui/images/sunrise.svg rename to gui/qt5/images/sunrise.svg diff --git a/ui/images/sunset.svg b/gui/qt5/images/sunset.svg similarity index 100% rename from ui/images/sunset.svg rename to gui/qt5/images/sunset.svg diff --git a/ui/images/wind.svg b/gui/qt5/images/wind.svg similarity index 100% rename from ui/images/wind.svg rename to gui/qt5/images/wind.svg diff --git a/ui/qmldir b/gui/qt5/qmldir similarity index 100% rename from ui/qmldir rename to gui/qt5/qmldir diff --git a/ui/translations/DailyForecast_de.ts b/gui/qt5/translations/DailyForecast_de.ts similarity index 100% rename from ui/translations/DailyForecast_de.ts rename to gui/qt5/translations/DailyForecast_de.ts diff --git a/ui/translations/DailyForecast_es.ts b/gui/qt5/translations/DailyForecast_es.ts similarity index 100% rename from ui/translations/DailyForecast_es.ts rename to gui/qt5/translations/DailyForecast_es.ts diff --git a/ui/translations/DailyForecast_fr.ts b/gui/qt5/translations/DailyForecast_fr.ts similarity index 100% rename from ui/translations/DailyForecast_fr.ts rename to gui/qt5/translations/DailyForecast_fr.ts diff --git a/ui/translations/DailyForecast_it.ts b/gui/qt5/translations/DailyForecast_it.ts similarity index 100% rename from ui/translations/DailyForecast_it.ts rename to gui/qt5/translations/DailyForecast_it.ts diff --git a/ui/translations/DailyForecast_nl.ts b/gui/qt5/translations/DailyForecast_nl.ts similarity index 100% rename from ui/translations/DailyForecast_nl.ts rename to gui/qt5/translations/DailyForecast_nl.ts diff --git a/ui/translations/DailyForecast_pt.ts b/gui/qt5/translations/DailyForecast_pt.ts similarity index 100% rename from ui/translations/DailyForecast_pt.ts rename to gui/qt5/translations/DailyForecast_pt.ts diff --git a/ui/translations/HourlyForecast_de.ts b/gui/qt5/translations/HourlyForecast_de.ts similarity index 100% rename from ui/translations/HourlyForecast_de.ts rename to gui/qt5/translations/HourlyForecast_de.ts diff --git a/ui/translations/HourlyForecast_es.ts b/gui/qt5/translations/HourlyForecast_es.ts similarity index 100% rename from ui/translations/HourlyForecast_es.ts rename to gui/qt5/translations/HourlyForecast_es.ts diff --git a/ui/translations/HourlyForecast_fr.ts b/gui/qt5/translations/HourlyForecast_fr.ts similarity index 100% rename from ui/translations/HourlyForecast_fr.ts rename to gui/qt5/translations/HourlyForecast_fr.ts diff --git a/ui/translations/HourlyForecast_it.ts b/gui/qt5/translations/HourlyForecast_it.ts similarity index 100% rename from ui/translations/HourlyForecast_it.ts rename to gui/qt5/translations/HourlyForecast_it.ts diff --git a/ui/translations/HourlyForecast_nl.ts b/gui/qt5/translations/HourlyForecast_nl.ts similarity index 100% rename from ui/translations/HourlyForecast_nl.ts rename to gui/qt5/translations/HourlyForecast_nl.ts diff --git a/ui/translations/HourlyForecast_pt.ts b/gui/qt5/translations/HourlyForecast_pt.ts similarity index 100% rename from ui/translations/HourlyForecast_pt.ts rename to gui/qt5/translations/HourlyForecast_pt.ts diff --git a/ui/translations/skill-ovos-weather.openvoiceos_de.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_de.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_de.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_de.qm diff --git a/ui/translations/skill-ovos-weather.openvoiceos_es.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_es.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_es.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_es.qm diff --git a/ui/translations/skill-ovos-weather.openvoiceos_fr.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_fr.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_fr.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_fr.qm diff --git a/ui/translations/skill-ovos-weather.openvoiceos_it.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_it.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_it.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_it.qm diff --git a/ui/translations/skill-ovos-weather.openvoiceos_nl.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_nl.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_nl.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_nl.qm diff --git a/ui/translations/skill-ovos-weather.openvoiceos_pt.qm b/gui/qt5/translations/skill-ovos-weather.openvoiceos_pt.qm similarity index 100% rename from ui/translations/skill-ovos-weather.openvoiceos_pt.qm rename to gui/qt5/translations/skill-ovos-weather.openvoiceos_pt.qm diff --git a/scripts/bump_alpha.py b/scripts/bump_alpha.py deleted file mode 100644 index b74a4a97..00000000 --- a/scripts/bump_alpha.py +++ /dev/null @@ -1,18 +0,0 @@ -import fileinput -from os.path import join, dirname - - -version_file = join(dirname(dirname(__file__)), "version.py") -version_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - else: - print(line.rstrip('\n')) \ No newline at end of file diff --git a/scripts/bump_build.py b/scripts/bump_build.py deleted file mode 100644 index 61099f87..00000000 --- a/scripts/bump_build.py +++ /dev/null @@ -1,21 +0,0 @@ -import fileinput -from os.path import join, dirname - - -version_file = join(dirname(dirname(__file__)), "version.py") -version_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) diff --git a/scripts/bump_major.py b/scripts/bump_major.py deleted file mode 100644 index 7ca77079..00000000 --- a/scripts/bump_major.py +++ /dev/null @@ -1,27 +0,0 @@ -import fileinput -from os.path import join, dirname - - -version_file = join(dirname(dirname(__file__)), "version.py") -version_var_name = "VERSION_MAJOR" -minor_var_name = "VERSION_MINOR" -build_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(minor_var_name): - print(f"{minor_var_name} = 0") - elif line.startswith(build_var_name): - print(f"{build_var_name} = 0") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) \ No newline at end of file diff --git a/scripts/bump_minor.py b/scripts/bump_minor.py deleted file mode 100644 index ca02e509..00000000 --- a/scripts/bump_minor.py +++ /dev/null @@ -1,24 +0,0 @@ -import fileinput -from os.path import join, dirname - - -version_file = join(dirname(dirname(__file__)), "version.py") -version_var_name = "VERSION_MINOR" -build_var_name = "VERSION_BUILD" -alpha_var_name = "VERSION_ALPHA" - -with open(version_file, "r", encoding="utf-8") as v: - for line in v.readlines(): - if line.startswith(version_var_name): - version = int(line.split("=")[-1]) - new_version = int(version) + 1 - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(version_var_name): - print(f"{version_var_name} = {new_version}") - elif line.startswith(build_var_name): - print(f"{build_var_name} = 0") - elif line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) \ No newline at end of file diff --git a/scripts/prepare_skillstore.py b/scripts/prepare_skillstore.py deleted file mode 100644 index 529ba7ca..00000000 --- a/scripts/prepare_skillstore.py +++ /dev/null @@ -1,76 +0,0 @@ -from ovos_skills_manager import SkillEntry -from os.path import exists, join, dirname -from shutil import rmtree -import os -from os import makedirs -import json -from ovos_utils.bracket_expansion import expand_parentheses, expand_options - - -branch = "dev" -repo = "skill-ovos-weather" -author = "OpenVoiceOS" - -url = f"https://github.com/{author}/{repo}@{branch}" - -skill = SkillEntry.from_github_url(url) -tmp_skills = "/tmp/osm_installed_skills" -skill_folder = f"{tmp_skills}/{skill.uuid}" - -base_dir = dirname(dirname(__file__)) -desktop_dir = join(base_dir, "res", "desktop") -android_ui = join(base_dir, "ui", "+android") -makedirs(desktop_dir, exist_ok=True) - -readme = join(base_dir, "README.md") -jsonf = join(desktop_dir, "skill.json") -desktopf = join(desktop_dir, f"{repo}.desktop") -skill_code = join(base_dir, "__init__.py") - -res_folder = join(base_dir, "locale", "en-us") - - -def read_samples(path): - samples = [] - with open(path) as fi: - for _ in fi.read().split("\n"): - if _ and not _.strip().startswith("#"): - samples += expand_options(_) - return samples - -samples = [] -for root, folders, files in os.walk(res_folder): - for f in files: - if f.endswith(".intent"): - samples += read_samples(join(root, f)) -skill._data["examples"] = list(set(samples)) - -has_android = exists(android_ui) -with open(skill_code) as f: - has_homescreen = f"{repo}.{author}.home" in f.read() - -if not exists(readme): - with open(readme, "w") as f: - f.write(skill.generate_readme()) - -if has_homescreen and not exists(desktopf): - with open(desktopf, "w") as f: - f.write(skill.desktop_file) - -if not exists(jsonf): - data = skill.json - with open(jsonf, "w") as f: - if not has_android or not has_homescreen: - data.pop("android") - if not has_homescreen: - data.pop("desktop") - data["desktopFile"] = False -else: - with open(jsonf) as f: - data = json.load(f) - -# set dev branch -data["branch"] = "dev" - -with open(jsonf, "w") as f: - json.dump(data, f, indent=4) diff --git a/scripts/prepare_translations.py b/scripts/prepare_translations.py deleted file mode 100644 index 01a674d0..00000000 --- a/scripts/prepare_translations.py +++ /dev/null @@ -1,53 +0,0 @@ -"""this script should run every time the contents of the locale folder change -except if PR originated from @gitlocalize-app -TODO - on commit to dev -""" - -import json -from os.path import dirname -import os - -locale = f"{dirname(dirname(__file__))}/locale" -tx = f"{dirname(dirname(__file__))}/translations" - - -for lang in os.listdir(locale): - intents = {} - dialogs = {} - vocs = {} - regexes = {} - for root, _, files in os.walk(f"{locale}/{lang}"): - b = root.split(f"/{lang}")[-1] - - for f in files: - if b: - fid = f"{b}/{f}" - else: - fid = f - with open(f"{root}/{f}") as fi: - strings = [l.replace("{{", "{").replace("}}", "}") - for l in fi.read().split("\n") if l.strip() - and not l.startswith("#")] - - if fid.endswith(".intent"): - intents[fid] = strings - elif fid.endswith(".dialog"): - dialogs[fid] = strings - elif fid.endswith(".voc"): - vocs[fid] = strings - elif fid.endswith(".rx"): - regexes[fid] = strings - - os.makedirs(f"{tx}/{lang.lower()}", exist_ok=True) - if intents: - with open(f"{tx}/{lang.lower()}/intents.json", "w") as f: - json.dump(intents, f, indent=4) - if dialogs: - with open(f"{tx}/{lang.lower()}/dialogs.json", "w") as f: - json.dump(dialogs, f, indent=4) - if vocs: - with open(f"{tx}/{lang.lower()}/vocabs.json", "w") as f: - json.dump(vocs, f, indent=4) - if regexes: - with open(f"{tx}/{lang.lower()}/regexes.json", "w") as f: - json.dump(regexes, f, indent=4) diff --git a/scripts/remove_alpha.py b/scripts/remove_alpha.py deleted file mode 100644 index fca73420..00000000 --- a/scripts/remove_alpha.py +++ /dev/null @@ -1,13 +0,0 @@ -import fileinput -from os.path import join, dirname - - -version_file = join(dirname(dirname(__file__)), "version.py") - -alpha_var_name = "VERSION_ALPHA" - -for line in fileinput.input(version_file, inplace=True): - if line.startswith(alpha_var_name): - print(f"{alpha_var_name} = 0") - else: - print(line.rstrip('\n')) diff --git a/scripts/translate.py b/scripts/translate.py deleted file mode 100644 index 43b06872..00000000 --- a/scripts/translate.py +++ /dev/null @@ -1,157 +0,0 @@ -from os.path import dirname, join, isdir, exists -from pathlib import Path -import shutil -import os -import re -from ovos_utils.bracket_expansion import expand_options -from ovos_translate_plugin_deepl import DeepLTranslator - - -API_KEY = os.getenv("API_KEY") -if not API_KEY: - raise ValueError - -single_lang = os.getenv("TARGET_LANG") -target_langs = (single_lang,) if single_lang else ("de-de", - "ca-es", - "cs-cz", - "da-dk", - "es-es", - "fr-fr", - "hu-hu", - "it-it", - "nl-nl", - "pl-pl", - "pt-pt", - "ru-ru", - "sv-fi", - "sv-se") - - -base_folder = dirname(dirname(__file__)) -res_folder = join(base_folder, "locale") - -# old structure -old_voc_folder = join(base_folder, "vocab") -old_dialog_folder = join(base_folder, "dialog") -old_res_folder = [old_voc_folder, old_dialog_folder] - -src_lang="en-us" -src_files={} -# note: regex/namedvalues are just copied, this cant be auto translated reliably -ext = [".voc", ".dialog", ".intent", ".entity", ".rx", ".value", ".word"] -untranslated = [".rx", ".value", ".entity"] - -tx = DeepLTranslator({"api_key": API_KEY}) - - -def file_location(f: str, base: str) -> bool: - for root, dirs, files in os.walk(base): - for file in files: - if f == file: - return join(root, file) - return None - -def translate(lines: list, target_lang: str) -> list: - translations = [] - for line in lines: - replacements = dict() - for num, var in enumerate(re.findall(r"(?:{{|{)[ a-zA-Z0-9_]*(?:}}|})", line)): - line = line.replace(var, f'@{num}', 1) - replacements[f'@{num}'] = var - try: - translated = tx.translate(line, target=target_lang, source=src_lang) - except Exception as e: - continue - for num, var in replacements.items(): - translated = translated.replace(num, var) - translations.append(translated) - - return translations - - -def entities(file: str) -> set: - vars = set() - if not exists(file): - return vars - - lines = get_lines(file) - for line in lines: - for var in re.findall(r"(?:{{|{)[ a-zA-Z0-9_]*(?:}}|})", line): - vars.add(var) - return vars - - -def get_lines(file: str): - with open(file, "r") as f: - # entity files often include #-placeholder - if file.endswith(".entity"): - lines = [exp for l in f.read().split("\n") for exp - in expand_options(l) if l] - else: - lines = [exp for l in f.read().split("\n") for exp - in expand_options(l) if l and not l.startswith("#")] - return lines - - -def migrate_locale(folder): - for lang in os.listdir(folder): - path = join(folder, lang) - for root, dirs, files in os.walk(path): - for file in files: - if file_location(file, join(res_folder, lang)) is None: - rel_path = root.replace(folder, "").lstrip("/") - new_path = join(res_folder, rel_path) - os.makedirs(new_path, exist_ok=True) - shutil.move(join(root, file), - join(new_path, file)) - shutil.rmtree(path) - shutil.rmtree(folder) - - -for folder in old_res_folder: - if not isdir(folder): - continue - migrate_locale(folder) - -src_folder = join(res_folder, src_lang) -for root, dirs, files in os.walk(src_folder): - if src_lang not in root: - continue - for f in files: - if any(f.endswith(e) for e in ext): - file_path = join(root, f) - rel_path = file_path.replace(src_folder, "").lstrip("/") - src_files[rel_path] = file_path - -for lang in target_langs: - # service cant translate - if not tx.get_langcode(lang): - continue - for rel_path, src in src_files.items(): - filename = Path(rel_path).name - dst = file_location(filename, join(res_folder, lang)) or \ - join(res_folder, lang, rel_path) - if entities(src) != entities(dst): - if exists(dst): - os.remove(dst) - elif not exists(dst): - pass - else: - continue - os.makedirs(dirname(dst), exist_ok=True) - - lines = get_lines(src) - if any(filename.endswith(e) for e in untranslated): - tx_lines = lines - is_translated = False - else: - tx_lines = translate(lines, lang) - is_translated = True - if tx_lines: - tx_lines = list(set(tx_lines)) - with open(dst, "w") as f: - if is_translated: - f.write(f"# auto translated from {src_lang} to {lang}\n") - for translated in set(tx_lines): - f.write(translated + "\n") diff --git a/setup.py b/setup.py index c44af908..40b45e9f 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ def get_requirements(requirements_filename: str): def find_resource_files(): - resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex", "weather_helpers") + resource_base_dirs = ("locale", "gui", "vocab", "dialog", "regex", "weather_helpers") package_data = ["*.json"] for res in resource_base_dirs: if path.isdir(path.join(BASEDIR, res)): diff --git a/test/unittests/osm_tests.py b/test/unittests/osm_tests.py deleted file mode 100644 index d415b895..00000000 --- a/test/unittests/osm_tests.py +++ /dev/null @@ -1,30 +0,0 @@ -# write your first unittest! -import unittest -from os.path import exists -from shutil import rmtree - -from ovos_skills_manager import SkillEntry - -branch = "dev" -url = f"https://github.com/OpenVoiceOS/skill-ovos-weather@{branch}" - - -class TestOSM(unittest.TestCase): - @classmethod - def setUpClass(self): - self.skill_id = "skill-ovos-weather.openvoiceos" - - def test_osm_install(self): - skill = SkillEntry.from_github_url(url) - tmp_skills = "/tmp/osm_installed_skills" - skill_folder = f"{tmp_skills}/{skill.uuid}" - - if exists(skill_folder): - rmtree(skill_folder) - - updated = skill.install(folder=tmp_skills, default_branch=branch) - self.assertEqual(updated, True) - self.assertTrue(exists(skill_folder)) - - updated = skill.install(folder=tmp_skills, default_branch=branch) - self.assertEqual(updated, False)