From 2a6457a4485620ce33dba585dc5e00f4d3f8aee8 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:45:41 +0330 Subject: [PATCH 01/10] Remove build script --- Build.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Build.py diff --git a/Build.py b/Build.py deleted file mode 100644 index c66b859..0000000 --- a/Build.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -import os,subprocess - -# Jump to Src -os.chdir("src/") - -# Create Qrc file -listrc = os.listdir('UI') -listrc.remove('res.qrc') -f = open('UI/res.qrc', 'w') -f.write("""""") -for i in listrc: - f.write(f"{i}") -f.write("""""") -f.close() - -# Compile Qrc & Create onefile script & Build Parch Package -subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && cp Welcome ../build/parch-welcome/usr/bin/ && cd ../build && chmod +x parch-welcome/usr/bin/* && tar -czvf parch-welcome.tar.gz parch-welcome/ && makepkg -f && cd .. && rm -rf build/pkg build/src build/*.tar.gz && rm -rf src/Welcome""",shell=True) \ No newline at end of file -- 2.45.3 From d2ea58829da5c87224e20f9c8ad8a111b4de1304 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:45:51 +0330 Subject: [PATCH 02/10] Remove debug script --- Debug.py | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 Debug.py diff --git a/Debug.py b/Debug.py deleted file mode 100644 index 598dcac..0000000 --- a/Debug.py +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/python -import os,subprocess - -# Jump to Src -os.chdir("src") - -# Create Qrc file -listrc = os.listdir('UI') -listrc.remove('res.qrc') -f = open('UI/res.qrc', 'w') -f.write("""""") -for i in listrc: - f.write(f"{i}") -f.write("""""") -f.close() - -# Compile Qrc & Create onefile script & run it -subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && ./Welcome && rm Welcome""",shell=True) \ No newline at end of file -- 2.45.3 From 5d49e1df1ae336a572404ec8768916a07b684dcb Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:46:20 +0330 Subject: [PATCH 03/10] update readme --- README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f31a3c9..7a10c1c 100644 --- a/README.md +++ b/README.md @@ -6,14 +6,29 @@ Parch dorood (/do-rood/, درود, pronunciation) which is Persian word for "Gre - Updating Parch repositories This program is still on alpha stages and it is not completely ready to use. -## Build Parch Package -for building **Parch Package** from **Welcome** project you should run: +## Build the package +- Jump to `build` directory: ```shell -python Build.py +cd build +``` +- Compress `parch-welcome` directory for creating package: +```shell +tar -czvf parch-welcome.tar.gz parch-welcome/ +``` +- Make package after compressing: +```shell +makepkg -f ``` -## Debug & Run from Source -if you want to run project without installing, you should run: +## Install the package +- For installing this pacakge run: ```shell -python Debug.py +cd build +sudo pacman -U ./parch-welcome* +``` + +## Generate Qt Resources (if edited) +if you made a changes in src you can update the `qrc` by running this command: +```shell +python src/01-Generate.py ``` \ No newline at end of file -- 2.45.3 From fca7ccef71e80e4156b7fad95dc7b1822ff9f6d3 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:46:44 +0330 Subject: [PATCH 04/10] Remove Import Res --- build/parch-welcome/usr/bin/Welcome | 82 ++++++++++++++--------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/build/parch-welcome/usr/bin/Welcome b/build/parch-welcome/usr/bin/Welcome index eee7240..c32dea8 100755 --- a/build/parch-welcome/usr/bin/Welcome +++ b/build/parch-welcome/usr/bin/Welcome @@ -154,6 +154,28 @@ q6\x92\x1c~\x87W\x1d\xb8\xdcr\x9d\xe6\xbf\x0d\xdf\ \x19\x91sh\xfahDz4by\xdd\x88\xe5#\x1a\ \xb1\xbc\xc5\x88\xe5\xfd\x8c\x88\xae:\xf1\xe5\x1f\xf1\xa9\xfe\ m\x9a\xff\x025\x8d\xde4\ +\x00\x00\x017\ +<\ +svg xmlns=\x22http:\ +//www.w3.org/200\ +0/svg\x22 class=\x22h-\ +5 w-5 ml-2\x22 fill\ +=\x22none\x22 viewBox=\ +\x220 0 24 24\x22 stro\ +ke=\x22currentColor\ +\x22 stroke-width=\x22\ +2\x22>\x0a \ + \x0a \ + \ +\ \x00\x00\x02\xd4\ <\ svg xmlns=\x22http:\ @@ -202,28 +224,6 @@ ZM2.04 4.326c.32\ .88A7 7 0 1 1 2.\ 04 4.327Z\x22/>\x0a\ -\x00\x00\x017\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 class=\x22h-\ -5 w-5 ml-2\x22 fill\ -=\x22none\x22 viewBox=\ -\x220 0 24 24\x22 stro\ -ke=\x22currentColor\ -\x22 stroke-width=\x22\ -2\x22>\x0a \ - \x0a \ - \ -\ \x00\x00\x03\x0f\ <\ svg xmlns=\x22http:\ @@ -1126,13 +1126,13 @@ qt_resource_name = b"\ \x00c\ \x00a\x00f\x00e\x00.\x00s\x00v\x00g\ \x00\x0b\ -\x00_)\x87\ -\x00w\ -\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ \x08\xcf\xef\x87\ \x00i\ \x00n\x00s\x00t\x00a\x00l\x00l\x00.\x00s\x00v\x00g\ +\x00\x0b\ +\x00_)\x87\ +\x00w\ +\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ \x00\x08\ \x06^W\xe7\ \x00b\ @@ -1166,30 +1166,30 @@ qt_resource_name = b"\ qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x0e\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x05\x12\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xcc\x00\x01\x00\x00\x00\x01\x00\x006\x80\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x0c\xe6\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x01 \x00\x00\x00\x00\x00\x01\x00\x00@\xc2\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x002\x00\x01\x00\x00\x00\x01\x00\x00\x06V\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0b\xab\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ +\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xf9\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xee\x00\x00\x00\x00\x00\x01\x00\x009\xf2\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x003c\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00=\xde\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ " def qInitResources(): @@ -1209,7 +1209,7 @@ from PyQt6.QtGui import * from PyQt6.QtQml import * # Import Resources of Qt -import Res + # Simple Qt Quick class for loading QML files -- 2.45.3 From 80f59e27e186809c849422a71938c76a1e644257 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:47:22 +0330 Subject: [PATCH 05/10] Qt Resource Generator --- src/QrcGenerate.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/QrcGenerate.py diff --git a/src/QrcGenerate.py b/src/QrcGenerate.py new file mode 100644 index 0000000..5b65ae6 --- /dev/null +++ b/src/QrcGenerate.py @@ -0,0 +1,20 @@ +#!/usr/bin/python +#!/usr/bin/python + +import os,subprocess + +# Jump to src +os.chdir("src") + +# Create Qrc file +listrc = os.listdir('UI') +listrc.remove('res.qrc') +f = open('UI/res.qrc', 'w') +f.write("""""") +for i in listrc: + f.write(f"{i}") +f.write("""""") +f.close() + +# Compile Qrc & Create onefile script & run it +subprocess.run("""rcc -g python UI/res.qrc -o Res.py && sed -i 's/PySide2/PyQt6/g' Res.py && echo "#!/usr/bin/python" > Welcome && cat Res.py >> Welcome && cat Welcome.py >> Welcome && chmod +x Welcome && sed -i 's/import Res//g' Welcome && mv Welcome ../build/parch-welcome/usr/bin""",shell=True) \ No newline at end of file -- 2.45.3 From 455c2d10f2df98f242c8694308da94233bfe8666 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:47:34 +0330 Subject: [PATCH 06/10] Generated Resource --- src/Res.py | 80 +++++++++++++++++++++++++++--------------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/Res.py b/src/Res.py index 1d35d30..90b3840 100644 --- a/src/Res.py +++ b/src/Res.py @@ -153,6 +153,28 @@ q6\x92\x1c~\x87W\x1d\xb8\xdcr\x9d\xe6\xbf\x0d\xdf\ \x19\x91sh\xfahDz4by\xdd\x88\xe5#\x1a\ \xb1\xbc\xc5\x88\xe5\xfd\x8c\x88\xae:\xf1\xe5\x1f\xf1\xa9\xfe\ m\x9a\xff\x025\x8d\xde4\ +\x00\x00\x017\ +<\ +svg xmlns=\x22http:\ +//www.w3.org/200\ +0/svg\x22 class=\x22h-\ +5 w-5 ml-2\x22 fill\ +=\x22none\x22 viewBox=\ +\x220 0 24 24\x22 stro\ +ke=\x22currentColor\ +\x22 stroke-width=\x22\ +2\x22>\x0a \ + \x0a \ + \ +\ \x00\x00\x02\xd4\ <\ svg xmlns=\x22http:\ @@ -201,28 +223,6 @@ ZM2.04 4.326c.32\ .88A7 7 0 1 1 2.\ 04 4.327Z\x22/>\x0a\ -\x00\x00\x017\ -<\ -svg xmlns=\x22http:\ -//www.w3.org/200\ -0/svg\x22 class=\x22h-\ -5 w-5 ml-2\x22 fill\ -=\x22none\x22 viewBox=\ -\x220 0 24 24\x22 stro\ -ke=\x22currentColor\ -\x22 stroke-width=\x22\ -2\x22>\x0a \ - \x0a \ - \ -\ \x00\x00\x03\x0f\ <\ svg xmlns=\x22http:\ @@ -1125,13 +1125,13 @@ qt_resource_name = b"\ \x00c\ \x00a\x00f\x00e\x00.\x00s\x00v\x00g\ \x00\x0b\ -\x00_)\x87\ -\x00w\ -\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ -\x00\x0b\ \x08\xcf\xef\x87\ \x00i\ \x00n\x00s\x00t\x00a\x00l\x00l\x00.\x00s\x00v\x00g\ +\x00\x0b\ +\x00_)\x87\ +\x00w\ +\x00e\x00b\x00s\x00i\x00t\x00e\x00.\x00s\x00v\x00g\ \x00\x08\ \x06^W\xe7\ \x00b\ @@ -1165,30 +1165,30 @@ qt_resource_name = b"\ qt_resource_struct = b"\ \x00\x00\x00\x00\x00\x02\x00\x00\x00\x0c\x00\x00\x00\x01\ \x00\x00\x00\x00\x00\x00\x00\x00\ -\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0a\x0e\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x1c\x00\x00\x00\x00\x00\x01\x00\x00\x05\x12\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xcc\x00\x01\x00\x00\x00\x01\x00\x006\x80\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x80\x00\x00\x00\x00\x00\x01\x00\x00\x0c\xe6\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x01 \x00\x00\x00\x00\x00\x01\x00\x00@\xc2\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x002\x00\x01\x00\x00\x00\x01\x00\x00\x06V\ -\x00\x00\x01\x89\xf8\x14s,\ -\x00\x00\x00d\x00\x00\x00\x00\x00\x01\x00\x00\x0b\xab\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ +\x00\x00\x00H\x00\x00\x00\x00\x00\x01\x00\x00\x08\xd3\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\x96\x00\x00\x00\x00\x00\x01\x00\x00\x0f\xf9\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xee\x00\x00\x00\x00\x00\x01\x00\x009\xf2\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x00\xb6\x00\x00\x00\x00\x00\x01\x00\x003c\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ \x00\x00\x01\x06\x00\x00\x00\x00\x00\x01\x00\x00=\xde\ -\x00\x00\x01\x89\xf8\x14s,\ +\x00\x00\x01\x89\xf9\xef\xe6\x98\ " def qInitResources(): -- 2.45.3 From 0bef47c12ca37911fbb0af39742a63561ef36633 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:47:41 +0330 Subject: [PATCH 07/10] Qrc file --- src/UI/res.qrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/res.qrc b/src/UI/res.qrc index be3b626..ce115c4 100644 --- a/src/UI/res.qrc +++ b/src/UI/res.qrc @@ -1 +1 @@ -website.svginstall.svgbook.svgmasto.svgx-lg.svgtele.svgParchLogo.svggithub.svgdiscord.svgParchLinux.qmlcafe.svgtw.svg \ No newline at end of file +install.svgmasto.svggithub.svgParchLinux.qmlbook.svgwebsite.svgdiscord.svgtw.svgx-lg.svgtele.svgcafe.svgParchLogo.svg \ No newline at end of file -- 2.45.3 From 491fb4d746a30a3853171c89153a15042b06394d Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:48:09 +0330 Subject: [PATCH 08/10] Rename QrcGenerator in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a10c1c..944a04d 100644 --- a/README.md +++ b/README.md @@ -30,5 +30,5 @@ sudo pacman -U ./parch-welcome* ## Generate Qt Resources (if edited) if you made a changes in src you can update the `qrc` by running this command: ```shell -python src/01-Generate.py +python src/QrcGenerate.py ``` \ No newline at end of file -- 2.45.3 From d04f83b6015810f06431d951f9f71f750ade55a8 Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:57:49 +0330 Subject: [PATCH 09/10] Replace to Popen --- build/parch-welcome/usr/bin/Welcome | 4 ++-- src/Welcome.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/parch-welcome/usr/bin/Welcome b/build/parch-welcome/usr/bin/Welcome index c32dea8..a5ad0cd 100755 --- a/build/parch-welcome/usr/bin/Welcome +++ b/build/parch-welcome/usr/bin/Welcome @@ -1273,12 +1273,12 @@ class Main(Quick): # DO: Run Calamares Installer def install_(self): self.close() - subprocess.run('sudo sh /etc/calamares/launch.sh',shell=True) + subprocess.Popen('sudo sh /etc/calamares/launch.sh',shell=True) # DO: Loading link in `xdg-open` function def link(self,url): self.close() - subprocess.run(f'xdg-open {url}',shell=True) + subprocess.Popen(f'xdg-open {url}',shell=True) # DO: Init Function def __init__(self): diff --git a/src/Welcome.py b/src/Welcome.py index a32d685..9cd2c5a 100644 --- a/src/Welcome.py +++ b/src/Welcome.py @@ -72,12 +72,12 @@ class Main(Quick): # DO: Run Calamares Installer def install_(self): self.close() - subprocess.run('sudo sh /etc/calamares/launch.sh',shell=True) + subprocess.Popen('sudo sh /etc/calamares/launch.sh',shell=True) # DO: Loading link in `xdg-open` function def link(self,url): self.close() - subprocess.run(f'xdg-open {url}',shell=True) + subprocess.Popen(f'xdg-open {url}',shell=True) # DO: Init Function def __init__(self): -- 2.45.3 From 6c999c7d861f1cd1a280cfa1f8b37046a4b13afe Mon Sep 17 00:00:00 2001 From: manijamali2003 Date: Tue, 15 Aug 2023 19:58:53 +0330 Subject: [PATCH 10/10] add requirements --- requirements.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..9f92236 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +PyQt6 \ No newline at end of file -- 2.45.3