Skip to content

Commit

Permalink
Fix Failed to execute script main when startup.
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenmiao committed Jan 7, 2024
1 parent ff9d2e3 commit 7fc4b59
Show file tree
Hide file tree
Showing 37 changed files with 143 additions and 29 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Publish to Snapcraft
on:
release:
types: [released]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: snapcore/action-build@v1
id: build
- uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }}
with:
snap: ${{ steps.build.outputs.snap }}
release: stable
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,9 @@
* Comments:
1. Update documents.
2. Update translations.

# v2.8.42-x3d3s3
* Date: January 7, 2024
* Tag: https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.42
* Comments:
1. Fix "Failed to execute script main" when startup.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Rickrack (**R**e**a**l-t**i**me **C**olor **K**it) is a free and user-friendly c
<img width="60%" src="demo/04_videos/play_en.png" alt="..." />
</a></div>

[:rocket: v2.8.41 Update Notes](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.41)
[:rocket: v2.8.42 Update Notes](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.42)

[:house: Rickrack](https://eigenmiao.com/rickrack)

Expand All @@ -30,7 +30,7 @@ Rickrack (**R**e**a**l-t**i**me **C**olor **K**it) is a free and user-friendly c
<img width="60%" src="demo/04_videos/play_zh.png" alt="..." />
</a></div>

[:rocket: v2.8.41 更新说明](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.41)
[:rocket: v2.8.42 更新说明](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.42)

[:house: 焰火十二卷](https://eigenmiao.com/yanhuo)

Expand Down Expand Up @@ -124,7 +124,7 @@ https://github.com/eigenmiao/Rickrack

# Installation
## Current Release
The latest preview version is [v2.8.41](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.41).
The latest preview version is [v2.8.42](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.42).

## Install Software
### Recommend: Install on Windows 10 or 11 via WinGet tool
Expand All @@ -138,7 +138,7 @@ snap install rickrack
```

## Install on other platforms
Download Software from [Github](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.41) or [Sourceforge](https://sourceforge.net/projects/rickrack/files/v2.8.41/). The installation steps are presented in [tutorials](https://eigenmiao.com/2021/12/12/rickrack-tutorial-en-v2.3.4/#Installation).
Download Software from [Github](https://github.com/eigenmiao/Rickrack/releases/tag/v2.8.42) or [Sourceforge](https://sourceforge.net/projects/rickrack/files/v2.8.42/). The installation steps are presented in [tutorials](https://eigenmiao.com/2021/12/12/rickrack-tutorial-en-v2.3.4/#Installation).

Here is a [video tutorial](https://www.bilibili.com/video/BV17r4y1L7R6/).

Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ These versions of Rickrack are currently being supported with security updates.

| Version | Supported |
| --------------------- | ------------------ |
| v2.8.41-x3d3s3-stable | :white_check_mark: |
| v2.8.42-x3d3s3-stable | :white_check_mark: |
| v2.8.41-x3d3s3-stable | :x: |
| v2.8.40-x3d3s3-stable | :x: |
| v2.8.36-x3d3s3-pre | :x: |
| v2.8.35-x3d3s3-pre | :x: |
Expand Down
4 changes: 2 additions & 2 deletions rickrack/rickrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"""

__VERSION__ = """
v2.8.41-x3d3s3-stable
v2.8.42-x3d3s3-stable
"""

__AUTHOR__ = """
Eigenmiao (eigenmiao@outlook.com)
"""

__DATE__ = """
October 15, 2023
January 7, 2024
"""

__HELP__ = """
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name="Rickrack",
version="2.8.41",
version="2.8.42",
author="Eigenmiao",
author_email="eigenmiao@outlook.com",
description="Generate harmonious colors freely.",
Expand Down
6 changes: 6 additions & 0 deletions snap/gui/rickrack.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Desktop Entry]
Terminal=false
Name=Rickrack
Exec=rickrack
Icon=${SNAP}/meta/gui/rickrack.png
Type=Application
Binary file added snap/gui/rickrack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: rickrack
version: 2.8.42
summary: Generate harmonious colors freely.
description: |
Rickrack is a free and open-source color palette generator. It provides various functionalities to generate a harmonious set of colors, offering you better color combination options. You can easily obtain the desired color combinations through color wheel selection, color picking from images, and more. It offers support for various color palette formats like aco, ase, gpl, and xml, making them easily importable into popular image processing software such as Photoshop, Clip Studio Paint, GIMP, Krita, and Inkscape. You can apply these colors to your own creations or share them with others.
grade: stable
base: core20
confinement: strict

parts:
rickrack:
plugin: dump
source: https://github.com/eigenmiao/Rickrack/releases/download/v$SNAPCRAFT_PROJECT_VERSION/Rickrack_v$SNAPCRAFT_PROJECT_VERSION_en_linux_x86_64.tar.gz
override-stage: |
snapcraftctl stage
echo "{\"store_loc\": false}" > $SNAPCRAFT_STAGE/settings.json
stage-packages:
- libasound2
- libasyncns0
- libdouble-conversion1v5
- libdrm2
- libfcitx-qt5-1
- libflac8
- libgtk-3-0
- libice6
- libicu55
- libjson-c2
- libogg0
- libpcre16-3
- libproxy1v5
- libpulse-mainloop-glib0
- libpulse0
- libsm6
- libsndfile1
- libtinfo5
- libvorbis0a
- libvorbisenc2
- libxcb-dri2-0
- libxcb-dri3-0
- libxcb-xinerama0
- libxcb1
- appmenu-qt5
- xdg-user-dirs
- mesa-utils
- libgl1-mesa-dri
- libgl1-mesa-glx
- gstreamer1.0-plugins-base
- gstreamer1.0-plugins-good

slots:
dbus-rickrack:
interface: dbus
bus: session
name: com.eigenmiao.rickrack

apps:
rickrack:
environment:
LD_LIBRARY_PATH: $SNAP:$LD_LIBRARY_PATH
PATH: $SNAP:$PATH
QML2_IMPORT_PATH: $SNAP/PyQt5/Qt/qml:$QML2_IMPORT_PATH
QT_PLUGIN_PATH: $SNAP/PyQt5/Qt/plugins:$QT_PLUGIN_PATH
QT_LINUX_ACCESSIBILITY_ALWAYS_ON: 1
QT_QPA_PLATFORMTHEME: appmenu-qt5
QT_ACCESSIBILITY: 1
QT_IM_MODULE: fcitx
command: Rickrack
plugs:
- desktop
- framebuffer
- camera
- network
- home
- opengl
- x11
- desktop-legacy
slots:
- dbus-rickrack
2 changes: 1 addition & 1 deletion src/build/settings/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"app_name": "Rickrack",
"author": "Eigenmiao",
"main_module": "src/main/python/main.py",
"version": "2.8.41"
"version": "2.8.42"
}
17 changes: 9 additions & 8 deletions src/main/python/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
"""

__COPYRIGHT__ = """
Copyright (c) 2019-2023 by Eigenmiao. All Rights Reserved.
Copyright (c) 2019-2024 by Eigenmiao. All Rights Reserved.
"""

__WEBSITE__ = """
https://github.com/eigenmiao/Rickrack
"""

__VERSION__ = """
v2.8.41-x3d3s3-stable
v2.8.42-x3d3s3-stable
"""

__AUTHOR__ = """
Eigenmiao (eigenmiao@outlook.com)
"""

__DATE__ = """
October 15, 2023
October 15, 2024
"""

__HELP__ = """
Expand Down Expand Up @@ -751,7 +751,7 @@ def _change_layout(self, layout_src=""):
Change layout.
"""

if isinstance(layout_src, str) and self._args.geometry_args:
if isinstance(layout_src, str) and os.path.isfile(self._args.geometry_args):
main_win_layout = 0
main_win_state = self._geo_args.value('main_win_state', None)
main_win_geometry = self._geo_args.value('main_win_geometry', None)
Expand Down Expand Up @@ -795,9 +795,6 @@ def _load_last_work(self):
else:
store_path = self._args.usr_store

if not os.path.isdir(os.sep.join((store_path, "MyColors"))):
os.makedirs(os.sep.join((store_path, "MyColors")))

if os.path.isfile(os.sep.join((store_path, "depot.json"))) and self._sys_argv["reset"] not in ("depot", "work", "all"):
self._wget_operation.dp_open(os.sep.join((store_path, "depot.json")))

Expand Down Expand Up @@ -1902,7 +1899,11 @@ def closeEvent(self, event):
print("+")

if self._save_settings_before_close and not self._sys_argv["temporary"]:
self.save_main_settings()
try:
self.save_main_settings()

except Exception as err:
pass

self._args.remove_temp_dir()
self._wget_wheel.close()
Expand Down
25 changes: 15 additions & 10 deletions src/main/python/ricore/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def __init__(self, resources, resetall=False, uselang=""):
Init Args object.
"""

self.info_version_zh = "v2.8.41-x3d3s3-稳定版"
self.info_version_en = "v2.8.41-x3d3s3-stable"
self.info_date_zh = "2023年10月15日"
self.info_date_en = "October 15, 2023"
self.info_version_zh = "v2.8.42-x3d3s3-稳定版"
self.info_version_en = "v2.8.42-x3d3s3-stable"
self.info_date_zh = "2024年1月7日"
self.info_date_en = "January 7, 2024"
self.global_temp_dir = None
self.global_hm_rules = (
"analogous",
Expand Down Expand Up @@ -91,9 +91,6 @@ def __init__(self, resources, resetall=False, uselang=""):
lang_paths = [(41, "default"),]
langs_dir = os.sep.join((resources, "langs"))

if not os.path.isdir(langs_dir):
os.makedirs(langs_dir)

for lang in os.listdir(langs_dir):
if os.path.isfile(os.sep.join((langs_dir, lang))) and lang.split(".")[-1] == "qm":
glang = re.split("\.|_|-", lang)
Expand Down Expand Up @@ -253,10 +250,18 @@ def init_settings(self):
self.usr_image = os.sep.join((self.home_dir, self.pic_name))

if not os.path.isdir(self.usr_color):
os.makedirs(self.usr_color)
try:
os.makedirs(self.usr_color)

except Exception as err:
pass

if not os.path.isdir(self.usr_image):
os.makedirs(self.usr_image)
try:
os.makedirs(self.usr_image)

except Exception as err:
pass

self.hm_rule = "analogous"
self.overflow = "return"
Expand Down Expand Up @@ -416,7 +421,7 @@ def save_settings(self):
json.dump(settings, sf, ensure_ascii=False)

with open(os.sep.join((self.resources, "settings.json")), "w", encoding="utf-8") as sf:
json.dump({"store_loc": False, "lang": self.lang}, sf, ensure_ascii=False)
json.dump({"version": self.info_version_en, "site": self.info_main_site, "store_loc": False, "lang": self.lang}, sf, ensure_ascii=False)

except Exception as err:
if self.global_log:
Expand Down
3 changes: 1 addition & 2 deletions src/main/python/wgets/splash.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ def __init__(self, resources, sys_argv):
display_lang = "zh"

else:
default_locale = locale.getdefaultlocale()[0]
default_locale = str(default_locale).lower() if default_locale else ""
default_locale = str(locale.getdefaultlocale()[0]).lower()

if len(default_locale) > 1 and default_locale[:2].lower() in ("zh", "ja", "ko"):
display_lang = "zh"
Expand Down
Binary file modified src/main/resources/base/langs/ar.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/cs.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/da.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/de.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/el.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/en.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/eo.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/es.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/fi.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/fr.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/is.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/it.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/iw.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/ja.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/ko.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/lt.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/nl.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/no.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/ru.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/sv.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/th.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/vn.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/zh-Hant.qm
Binary file not shown.
Binary file modified src/main/resources/base/langs/zh.qm
Binary file not shown.

0 comments on commit 7fc4b59

Please sign in to comment.