q2rad 0.1.182__py3-none-any.whl → 0.1.184__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of q2rad might be problematic. Click here for more details.
- q2rad/q2make.py +36 -7
- q2rad/q2packages.py +5 -4
- q2rad/q2rad.py +15 -3
- q2rad/version.py +1 -1
- {q2rad-0.1.182.dist-info → q2rad-0.1.184.dist-info}/METADATA +1 -1
- {q2rad-0.1.182.dist-info → q2rad-0.1.184.dist-info}/RECORD +9 -9
- {q2rad-0.1.182.dist-info → q2rad-0.1.184.dist-info}/LICENSE +0 -0
- {q2rad-0.1.182.dist-info → q2rad-0.1.184.dist-info}/WHEEL +0 -0
- {q2rad-0.1.182.dist-info → q2rad-0.1.184.dist-info}/entry_points.txt +0 -0
q2rad/q2make.py
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
import os
|
|
16
16
|
import sys
|
|
17
17
|
import shutil
|
|
18
|
+
import zipfile
|
|
18
19
|
from q2terminal.q2terminal import Q2Terminal
|
|
19
20
|
from q2rad.q2utils import q2cursor, Q2Form, open_folder # noqa F401
|
|
20
21
|
from q2gui.q2dialogs import q2mess, q2wait, q2ask
|
|
@@ -69,7 +70,7 @@ def make_binary(self):
|
|
|
69
70
|
if not form.ok_pressed:
|
|
70
71
|
return
|
|
71
72
|
|
|
72
|
-
if q2ask("Уou are about to start
|
|
73
|
+
if q2ask("Уou are about to start building binary executable file of Q2RAD!<br>Are You Sure?") != 2:
|
|
73
74
|
return
|
|
74
75
|
|
|
75
76
|
make_folder = os.path.abspath(form.s.make_folder)
|
|
@@ -81,20 +82,30 @@ def make_binary(self):
|
|
|
81
82
|
if not os.path.isdir(make_folder):
|
|
82
83
|
return
|
|
83
84
|
|
|
84
|
-
main = "
|
|
85
|
+
main = """
|
|
86
|
+
import sys
|
|
87
|
+
if "darwin" in sys.platform:
|
|
88
|
+
path = sys.argv[0].split("/Contents/MacOS")[0]
|
|
89
|
+
path = os.path.dirname(path)
|
|
90
|
+
os.chdir(path)
|
|
91
|
+
|
|
92
|
+
from q2rad.q2rad import Q2RadApp
|
|
93
|
+
app = Q2RadApp()
|
|
94
|
+
app.run()
|
|
95
|
+
"""
|
|
85
96
|
open(f"{make_folder}/{binary_name}.py", "w").write(main)
|
|
86
97
|
|
|
87
98
|
dist_folder = os.path.abspath(f"{make_folder}/dist/{binary_name}")
|
|
88
99
|
|
|
89
100
|
terminal = Q2Terminal(callback=print)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
101
|
+
pynstaller_executable = f"'{sys.executable.replace('w.exe', '.exe')}' -m PyInstaller"
|
|
102
|
+
if "win32" in sys.platform:
|
|
103
|
+
pynstaller_executable = "& " + pynstaller_executable
|
|
104
|
+
print(pynstaller_executable)
|
|
93
105
|
if not os.path.isfile("poetry.lock"):
|
|
94
106
|
terminal.run(f"{pynstaller_executable} -v")
|
|
95
107
|
if terminal.exit_code != 0:
|
|
96
|
-
|
|
97
|
-
terminal.run(f"'{sys.executable}' -m pip install pyinstaller")
|
|
108
|
+
terminal.run(f"'{sys.executable.replace('w.exe', '.exe')}' -m pip install pyinstaller")
|
|
98
109
|
if terminal.exit_code != 0:
|
|
99
110
|
q2mess("Pyinstaller not installed!")
|
|
100
111
|
return
|
|
@@ -128,6 +139,24 @@ def make_binary(self):
|
|
|
128
139
|
# if os.path.isfile(os.path.join(dist_folder, x)):
|
|
129
140
|
# shutil.move(os.path.join(dist_folder, x), os.path.join(dist_folder, binary_name, x))
|
|
130
141
|
|
|
142
|
+
if "darwin" in sys.platform:
|
|
143
|
+
shutil.move(
|
|
144
|
+
f"{make_folder}/dist/{binary_name}.app", f"{make_folder}/dist/{binary_name}/{binary_name}.app"
|
|
145
|
+
)
|
|
146
|
+
os.remove(f"{make_folder}/dist/{binary_name}/{binary_name}")
|
|
147
|
+
shutil.rmtree(f"{make_folder}/dist/{binary_name}/_internal", ignore_errors=True)
|
|
148
|
+
|
|
149
|
+
name = f"{make_folder}/dist/{binary_name}"
|
|
150
|
+
zip_name = name + ".zip"
|
|
151
|
+
|
|
152
|
+
with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zip_ref:
|
|
153
|
+
for folder_name, subfolders, filenames in os.walk(name):
|
|
154
|
+
for filename in filenames:
|
|
155
|
+
file_path = os.path.join(folder_name, filename)
|
|
156
|
+
zip_ref.write(file_path, arcname=f"{binary_name}/{os.path.relpath(file_path, name)}")
|
|
157
|
+
|
|
158
|
+
zip_ref.close()
|
|
159
|
+
|
|
131
160
|
w.close()
|
|
132
161
|
|
|
133
162
|
if terminal.exit_code != 0:
|
q2rad/q2packages.py
CHANGED
|
@@ -31,7 +31,8 @@ class Q2Packages(Q2Form):
|
|
|
31
31
|
|
|
32
32
|
def on_init(self):
|
|
33
33
|
self.add_control("package_name", _("Name"), datatype="char", datalen=100, pk="*")
|
|
34
|
-
self.add_control("
|
|
34
|
+
self.add_control("package_alias", _("Alias"), datatype="char", datalen=100)
|
|
35
|
+
self.add_control("package_version", _("Version"), datatype="char", datalen=10)
|
|
35
36
|
self.add_control("comment", _("Comment"), datatype="text")
|
|
36
37
|
|
|
37
38
|
cursor: Q2Cursor = self.q2_app.db_logic.table(table_name="packages")
|
|
@@ -40,9 +41,9 @@ class Q2Packages(Q2Form):
|
|
|
40
41
|
self.set_model(model)
|
|
41
42
|
self.add_action("/crud")
|
|
42
43
|
# self.add_action("Imp", self.imp)
|
|
43
|
-
self.add_action("Install", self.install)
|
|
44
|
-
self.add_action("Uninstall", self.uninstall)
|
|
45
|
-
self.add_action("Versions", self.info)
|
|
44
|
+
self.add_action("Install", self.install, eof_disabled=True)
|
|
45
|
+
self.add_action("Uninstall", self.uninstall, eof_disabled=True)
|
|
46
|
+
self.add_action("Versions", self.info, eof_disabled=True)
|
|
46
47
|
|
|
47
48
|
# def imp(self):
|
|
48
49
|
# __import__(self.r.package_name)
|
q2rad/q2rad.py
CHANGED
|
@@ -16,6 +16,7 @@ import sys
|
|
|
16
16
|
import os
|
|
17
17
|
import re
|
|
18
18
|
import threading
|
|
19
|
+
from packaging import version
|
|
19
20
|
|
|
20
21
|
if __name__ == "__main__":
|
|
21
22
|
sys.path.insert(0, ".")
|
|
@@ -63,7 +64,8 @@ from q2rad.q2utils import Q2Tasker, Q2Form, auto_filter, set_logging, open_folde
|
|
|
63
64
|
from q2rad.q2utils import q2choice
|
|
64
65
|
from q2rad.q2make import make_binary
|
|
65
66
|
|
|
66
|
-
from q2data2docx.q2data2docx import q2data2docx
|
|
67
|
+
from q2data2docx.q2data2docx import q2data2docx # noqa F401
|
|
68
|
+
|
|
67
69
|
# from q2googledrive.q2googledrive import q2googledrive # noqa F401
|
|
68
70
|
|
|
69
71
|
import gettext
|
|
@@ -866,9 +868,19 @@ class Q2RadApp(Q2App):
|
|
|
866
868
|
list_2_upgrade = []
|
|
867
869
|
|
|
868
870
|
rez = self.get_packages_version(packages_list)
|
|
869
|
-
|
|
870
871
|
for package in rez:
|
|
871
872
|
latest_version, current_version = rez[package]
|
|
873
|
+
if self.db_logic is not None and package not in q2_modules:
|
|
874
|
+
pkg_ver = get("packages", f"package_name='{package}'", "package_version", q2_db=self.db_logic)
|
|
875
|
+
pkg_ver = pkg_ver if pkg_ver else "99999"
|
|
876
|
+
try:
|
|
877
|
+
if version.parse(latest_version) > version.parse(pkg_ver):
|
|
878
|
+
continue
|
|
879
|
+
except Exception as error:
|
|
880
|
+
q2mess(f"Error occured while checking updates for <b>{package}</b>:"
|
|
881
|
+
f"<br> {error}<br>"
|
|
882
|
+
f"<b>{package}</b> package update interrupted")
|
|
883
|
+
continue
|
|
872
884
|
if latest_version != current_version and latest_version:
|
|
873
885
|
list_2_upgrade_message.append(f"<b>{package}</b>: {current_version} > {latest_version}")
|
|
874
886
|
list_2_upgrade.append(package)
|
|
@@ -877,7 +889,7 @@ class Q2RadApp(Q2App):
|
|
|
877
889
|
if can_upgrade:
|
|
878
890
|
if (
|
|
879
891
|
q2AskYN(
|
|
880
|
-
"Updates for packages are avaiable!<p><p>"
|
|
892
|
+
"!Updates for packages are avaiable!<p><p>"
|
|
881
893
|
f"{',<br> '.join(list_2_upgrade_message)}<br><br>"
|
|
882
894
|
"Do you want to proceed with update?<p><p>"
|
|
883
895
|
"The program will be restarted after the update!"
|
q2rad/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.184"
|
|
@@ -6,19 +6,19 @@ q2rad/q2appselector.py,sha256=oKlBdGPaCh0HEeDNJRMtGMVYGev2Ylundqum74NtPqY,12238
|
|
|
6
6
|
q2rad/q2constants.py,sha256=dQtN4OMvZw0FATDAFYjolI7eGMVUnNnbTl6qM-ggZ4I,3416
|
|
7
7
|
q2rad/q2forms.py,sha256=A5VeBK8OdE3zn0L1TgvCk4OjpB1nLibJqBFfpVZr_Uc,10181
|
|
8
8
|
q2rad/q2lines.py,sha256=e2GwnXxGhxMw_xWF_-enmYeHaMSKRnxER1jGFgRlOAc,14481
|
|
9
|
-
q2rad/q2make.py,sha256=
|
|
9
|
+
q2rad/q2make.py,sha256=k5hOwhhI8N2FY_6Irl0LlL2vBjjFMNHgxwWcD4jiXoY,6510
|
|
10
10
|
q2rad/q2market.py,sha256=koWwKKc1MVn0ud2XDu_dal8lBFEMLX8KABpZO_OzTIM,2597
|
|
11
11
|
q2rad/q2modules.py,sha256=N3OkUKfiwVZtmDyAtnJcs2Rprd7uIHd0HhjHTyFoN_s,4294
|
|
12
|
-
q2rad/q2packages.py,sha256=
|
|
12
|
+
q2rad/q2packages.py,sha256=ifRu8LuVrrTphiJe1JUVED_KB2sHJCPVnZq9VEh3K8w,3473
|
|
13
13
|
q2rad/q2queries.py,sha256=ABbr66YRLmleo2wcpvwcQwSPt_htjQsYXgoCqRRQSbo,12512
|
|
14
|
-
q2rad/q2rad.py,sha256=
|
|
14
|
+
q2rad/q2rad.py,sha256=S5XD-Np8OzeqEHSndN3EWLtUPup2YgZCVsZt_WvzWjQ,43644
|
|
15
15
|
q2rad/q2raddb.py,sha256=ISqT5EBFO7eaXcQRNpA0hMiRU84kbd-FcfckwKMlGfs,4506
|
|
16
16
|
q2rad/q2reports.py,sha256=xciOPsSbhepcKk_q2bIHsceAyg5ZMbs-EVbzyD8sqBI,81212
|
|
17
17
|
q2rad/q2stylesettings.py,sha256=esbfQoPgP7lJN2GRkqeQKjDpHCqCilJBzZf-c73ThCU,3593
|
|
18
18
|
q2rad/q2utils.py,sha256=YKmHbfvKqGqhVjOERdceK2lT9IShj0afwZkGTObCs-I,18504
|
|
19
|
-
q2rad/version.py,sha256=
|
|
20
|
-
q2rad-0.1.
|
|
21
|
-
q2rad-0.1.
|
|
22
|
-
q2rad-0.1.
|
|
23
|
-
q2rad-0.1.
|
|
24
|
-
q2rad-0.1.
|
|
19
|
+
q2rad/version.py,sha256=QIoV_M2rk6XDGECmjmRmCu9WBMJogF97jr_VxixP1hc,23
|
|
20
|
+
q2rad-0.1.184.dist-info/entry_points.txt,sha256=DmsJQE6f3wYuhdN2h6ARYxSe8_d03paeepfGpdVj5rs,42
|
|
21
|
+
q2rad-0.1.184.dist-info/LICENSE,sha256=JRR3LlR18ghhYXT4G2cWgXmnxRvcuVcKlqncWWK4MRY,10347
|
|
22
|
+
q2rad-0.1.184.dist-info/METADATA,sha256=OU3hzh7gKNxZerxrOOVxNZhLKOXpgF0rvZFl9Oh-GbI,3329
|
|
23
|
+
q2rad-0.1.184.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
24
|
+
q2rad-0.1.184.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|