q2rad 0.1.182__tar.gz → 0.1.183__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: q2rad
3
- Version: 0.1.182
3
+ Version: 0.1.183
4
4
  Summary: RAD - database, GUI, reports
5
5
  Author: Andrei Puchko
6
6
  Author-email: andrei.puchko@gmx.de
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "q2rad"
3
- version = "0.1.182"
3
+ version = "0.1.183"
4
4
  description = "RAD - database, GUI, reports"
5
5
  authors = ["Andrei Puchko <andrei.puchko@gmx.de>"]
6
6
  readme = "README.md"
@@ -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 buiding binary executable file of Q2RAD!<br>Are You Sure?") != 2:
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,7 +82,16 @@ def make_binary(self):
81
82
  if not os.path.isdir(make_folder):
82
83
  return
83
84
 
84
- main = "from q2rad.q2rad import Q2RadApp;app = Q2RadApp();app.run()"
85
+ main = """
86
+ if "darwin" in sys.platform:
87
+ path = sys.argv[0].split("/Contents/MacOS")[0]
88
+ path = os.path.dirname(path)
89
+ os.chdir(path)
90
+
91
+ from q2rad.q2rad import Q2RadApp
92
+ app = Q2RadApp()
93
+ app.run()
94
+ """
85
95
  open(f"{make_folder}/{binary_name}.py", "w").write(main)
86
96
 
87
97
  dist_folder = os.path.abspath(f"{make_folder}/dist/{binary_name}")
@@ -89,6 +99,8 @@ def make_binary(self):
89
99
  terminal = Q2Terminal(callback=print)
90
100
  # pynstaller_executable = os.path.dirname(sys.executable) + "/pyinstaller"
91
101
  pynstaller_executable = f"'{sys.executable}' -m PyInstaller"
102
+ if "win32" in sys.platform:
103
+ pynstaller_executable = "&" + pynstaller_executable
92
104
 
93
105
  if not os.path.isfile("poetry.lock"):
94
106
  terminal.run(f"{pynstaller_executable} -v")
@@ -128,6 +140,24 @@ def make_binary(self):
128
140
  # if os.path.isfile(os.path.join(dist_folder, x)):
129
141
  # shutil.move(os.path.join(dist_folder, x), os.path.join(dist_folder, binary_name, x))
130
142
 
143
+ if "darwin" in sys.platform:
144
+ shutil.move(
145
+ f"{make_folder}/dist/{binary_name}.app", f"{make_folder}/dist/{binary_name}/{binary_name}.app"
146
+ )
147
+ os.remove(f"{make_folder}/dist/{binary_name}/{binary_name}")
148
+ shutil.rmtree(f"{make_folder}/dist/{binary_name}/_internal", ignore_errors=True)
149
+
150
+ name = f"{make_folder}/dist/{binary_name}"
151
+ zip_name = name + ".zip"
152
+
153
+ with zipfile.ZipFile(zip_name, "w", zipfile.ZIP_DEFLATED) as zip_ref:
154
+ for folder_name, subfolders, filenames in os.walk(name):
155
+ for filename in filenames:
156
+ file_path = os.path.join(folder_name, filename)
157
+ zip_ref.write(file_path, arcname=f"{binary_name}/{os.path.relpath(file_path, name)}")
158
+
159
+ zip_ref.close()
160
+
131
161
  w.close()
132
162
 
133
163
  if terminal.exit_code != 0:
@@ -40,9 +40,9 @@ class Q2Packages(Q2Form):
40
40
  self.set_model(model)
41
41
  self.add_action("/crud")
42
42
  # 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)
43
+ self.add_action("Install", self.install, eof_disabled=True)
44
+ self.add_action("Uninstall", self.uninstall, eof_disabled=True)
45
+ self.add_action("Versions", self.info, eof_disabled=True)
46
46
 
47
47
  # def imp(self):
48
48
  # __import__(self.r.package_name)
@@ -0,0 +1 @@
1
+ __version__ = "0.1.183"
@@ -1 +0,0 @@
1
- __version__ = "0.1.182"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes