From b3623623aa4d8d8343d5f480f4f239a0be25b680 Mon Sep 17 00:00:00 2001 From: miro Date: Fri, 12 Apr 2024 18:33:10 +0100 Subject: [PATCH] ui -> qt5 rm dead files and bad automations --- .github/workflows/publish_build.yml | 4 - .github/workflows/publish_major.yml | 4 - .github/workflows/publish_minor.yml | 4 - {ui => qt5}/date.qml | 0 {ui => qt5}/time.qml | 0 res/desktop/skill.json | 113 ---------------------------- scripts/prepare_skillstore.py | 76 ------------------- scripts/release_skillstore.py | 41 ---------- setup.py | 2 +- 9 files changed, 1 insertion(+), 243 deletions(-) rename {ui => qt5}/date.qml (100%) rename {ui => qt5}/time.qml (100%) delete mode 100644 res/desktop/skill.json delete mode 100644 scripts/prepare_skillstore.py delete mode 100644 scripts/release_skillstore.py diff --git a/.github/workflows/publish_build.yml b/.github/workflows/publish_build.yml index 65e168be..8c7c85fa 100644 --- a/.github/workflows/publish_build.yml +++ b/.github/workflows/publish_build.yml @@ -26,10 +26,6 @@ jobs: run: | VER=$(python setup.py --version) python scripts/remove_alpha.py - - name: Prepare Skillstore metadata - run: | - python scripts/prepare_skillstore.py - python scripts/release_skillstore.py - name: "Generate release changelog" uses: heinrichreimer/github-changelog-generator-action@v2.3 with: diff --git a/.github/workflows/publish_major.yml b/.github/workflows/publish_major.yml index 09121b43..b5e8d4ee 100644 --- a/.github/workflows/publish_major.yml +++ b/.github/workflows/publish_major.yml @@ -26,10 +26,6 @@ jobs: run: | VER=$(python setup.py --version) python scripts/remove_alpha.py - - name: Prepare Skillstore metadata - run: | - python scripts/prepare_skillstore.py - python scripts/release_skillstore.py - name: "Generate release changelog" uses: heinrichreimer/github-changelog-generator-action@v2.3 with: diff --git a/.github/workflows/publish_minor.yml b/.github/workflows/publish_minor.yml index fe985115..d7dc8953 100644 --- a/.github/workflows/publish_minor.yml +++ b/.github/workflows/publish_minor.yml @@ -26,10 +26,6 @@ jobs: run: | VER=$(python setup.py --version) python scripts/remove_alpha.py - - name: Prepare Skillstore metadata - run: | - python scripts/prepare_skillstore.py - python scripts/release_skillstore.py - name: "Generate release changelog" uses: heinrichreimer/github-changelog-generator-action@v2.3 with: diff --git a/ui/date.qml b/qt5/date.qml similarity index 100% rename from ui/date.qml rename to qt5/date.qml diff --git a/ui/time.qml b/qt5/time.qml similarity index 100% rename from ui/time.qml rename to qt5/time.qml diff --git a/res/desktop/skill.json b/res/desktop/skill.json deleted file mode 100644 index b6af74f0..00000000 --- a/res/desktop/skill.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "authorname": "OpenVoiceOS", - "foldername": "skill-ovos-date-time", - "url": "https://github.com/OpenVoiceOS/skill-ovos-date-time", - "branch": "dev", - "license": "apache-2.0", - "tags": [ - "world-time", - "date-time", - "date", - "time", - "Daily", - "world-clock", - "clock", - "permissive-license" - ], - "short_description": "Get the time, date, day of the week", - "last_updated": "2022-10-11T16:36:06Z", - "icon": "https://raw.githack.com/FortAwesome/Font-Awesome/master/svgs/solid/calendar.svg", - "skillname": "Date and Time", - "description": "Get the local time or time for major cities around the world. Times\nare given in 12-hour (2:30 pm) or 24-hour format (14:30) based on the\nTime Format setting at [Home](https://home.mycroft.ai/#/setting/basic)\n\nTime can optionally be shown on a display, like a digital clock. See\nthe [Skill Setting](https://home.mycroft.ai/#/skill).", - "examples": [ - "the time right now please", - "what were the dates for last weekend", - "what were the dates last weekend", - "what are the days for this weekend", - "what is the date this weekend", - "the clock right now please", - "the clock now", - "when is it {offset} hours from now in {location}", - "time right now", - "clock", - "when is it {offset} minutes from now", - "when is it {offset} seconds from now in {location}", - "what days this weekend", - "the time please", - "what date is this weekend", - "what is the date for next weekend", - "when is it {offset} hours in {location}", - "the time", - "do you have the time", - "what were the days last weekend", - "what days for next weekend", - "when is it {offset} hours from now", - "what day was last weekend", - "what are the days this weekend", - "time", - "time now please", - "what dates are next weekend", - "the time now please", - "what days were last weekend", - "what are the days for next weekend", - "when is it {offset} hours", - "the clock now please", - "what date is next weekend", - "what is the date next weekend", - "the clock", - "when is it {offset} minutes", - "what days next weekend", - "what is the date for this weekend", - "do you have the current time", - "clock right now", - "what was the date last weekend", - "clock now please", - "what are the days next weekend", - "current time", - "when is it {offset} minutes in {location}", - "what are the dates for next weekend", - "clock now", - "what are the dates next weekend", - "clock right now please", - "the clock right now", - "the time right now", - "clock please", - "what are the dates this weekend", - "what were the days for last weekend", - "what days for this weekend", - "what day is next weekend", - "the time now", - "what day is this weekend", - "what dates are this weekend", - "what are the dates for this weekend", - "when is it {offset} seconds from now", - "when is it {offset} seconds", - "when is it {offset} seconds in {location}", - "when is it {offset} minutes from now in {location}", - "what dates were last weekend", - "what date was last weekend", - "the clock please", - "time now", - "time right now please", - "time please" - ], - "credits": [ - "Mycroft AI (@MycroftAI)" - ], - "category": "Daily", - "categories": [ - "Daily" - ], - "requirements": { - "python": [ - "geocoder", - "timezonefinder", - "tzlocal>=1.3", - "holidays~=0.12", - "pytz>=2022.1" - ], - "skill": [], - "system": {} - }, - "desktopFile": false -} \ No newline at end of file diff --git a/scripts/prepare_skillstore.py b/scripts/prepare_skillstore.py deleted file mode 100644 index 411734c0..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-date-time" -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/release_skillstore.py b/scripts/release_skillstore.py deleted file mode 100644 index a176d890..00000000 --- a/scripts/release_skillstore.py +++ /dev/null @@ -1,41 +0,0 @@ -import json -from os.path import join, dirname - -base_dir = dirname(dirname(__file__)) - - -def get_version(): - """ Find the version of the package""" - version_file = join(base_dir, 'version.py') - major, minor, build, alpha = (None, None, None, None) - with open(version_file) as f: - for line in f: - if 'VERSION_MAJOR' in line: - major = line.split('=')[1].strip() - elif 'VERSION_MINOR' in line: - minor = line.split('=')[1].strip() - elif 'VERSION_BUILD' in line: - build = line.split('=')[1].strip() - elif 'VERSION_ALPHA' in line: - alpha = line.split('=')[1].strip() - - if ((major and minor and build and alpha) or - '# END_VERSION_BLOCK' in line): - break - version = f"{major}.{minor}.{build}" - if alpha and int(alpha) > 0: - version += f"a{alpha}" - return version - - -desktop_dir = join(base_dir, "res", "desktop") - -jsonf = join(desktop_dir, "skill.json") - -with open(jsonf) as f: - data = json.load(f) - -data["branch"] = "v" + get_version() - -with open(jsonf, "w") as f: - json.dump(data, f, indent=4) diff --git a/setup.py b/setup.py index ee925aad..39718a14 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ def get_requirements(requirements_filename: str): def find_resource_files(): - resource_base_dirs = ("locale", "ui", "vocab", "dialog", "regex", "skill") + resource_base_dirs = ("locale", "qt5") base_dir = path.dirname(__file__) package_data = ["*.json"] for res in resource_base_dirs: