q2rad 0.1.223__tar.gz → 0.1.224__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.
- {q2rad-0.1.223 → q2rad-0.1.224}/PKG-INFO +1 -1
- {q2rad-0.1.223 → q2rad-0.1.224}/pyproject.toml +1 -1
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2rad.py +3 -2
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2reports.py +34 -2
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2utils.py +1 -0
- q2rad-0.1.224/q2rad/version.py +1 -0
- q2rad-0.1.223/q2rad/version.py +0 -1
- {q2rad-0.1.223 → q2rad-0.1.224}/LICENSE +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/README.md +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/__init__.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/__main__.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2actions.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2appmanager.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2appselector.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2constants.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2extensions.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2forms.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2lines.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2make.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2market.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2modules.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2packages.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2queries.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2raddb.py +0 -0
- {q2rad-0.1.223 → q2rad-0.1.224}/q2rad/q2stylesettings.py +0 -0
|
@@ -1412,13 +1412,14 @@ class Q2RadApp(Q2App):
|
|
|
1412
1412
|
if re.findall(r"^\s*import\W*.*", x):
|
|
1413
1413
|
module = x.split("import")[1].strip()
|
|
1414
1414
|
if self.db_logic.get("modules", f"name='{module}'", "name"):
|
|
1415
|
-
x = x.split("import")[0] + f"run_module('{module}', import_only=True)"
|
|
1415
|
+
# x = x.split("import")[0] + f"run_module('{module}', import_only=True)"
|
|
1416
|
+
x = x.split("import")[0] + f"run_module('{module}', _globals=globals(), import_only=True)"
|
|
1416
1417
|
|
|
1417
1418
|
new_script_lines.append(x)
|
|
1418
1419
|
script = "\n".join(new_script_lines)
|
|
1419
1420
|
try:
|
|
1420
1421
|
code = compile(script, f"<{script}>", "exec")
|
|
1421
|
-
return {"code": code, "error": ""}
|
|
1422
|
+
return {"code": code, "error": "", "script": script}
|
|
1422
1423
|
except Exception:
|
|
1423
1424
|
error = sys.exc_info()[1]
|
|
1424
1425
|
msg = []
|
|
@@ -26,13 +26,18 @@ from q2rad.q2queries import Q2QueryEdit
|
|
|
26
26
|
from q2rad.q2utils import q2cursor, Q2_save_and_run
|
|
27
27
|
from q2gui import q2app
|
|
28
28
|
from q2gui.q2dialogs import Q2WaitShow, q2WaitMax, q2WaitStep, q2working
|
|
29
|
+
from q2rad.q2raddb import *
|
|
30
|
+
from q2rad.q2utils import *
|
|
29
31
|
import json
|
|
30
32
|
import os
|
|
33
|
+
import logging
|
|
34
|
+
import threading
|
|
31
35
|
import gettext
|
|
32
36
|
|
|
33
37
|
from q2rad.q2utils import Q2Form
|
|
34
38
|
|
|
35
39
|
_ = gettext.gettext
|
|
40
|
+
_logger = logging.getLogger(__name__)
|
|
36
41
|
|
|
37
42
|
# TODO: selected rows removing - bug
|
|
38
43
|
|
|
@@ -190,6 +195,10 @@ class Q2RadReport(Q2Report):
|
|
|
190
195
|
q2app.q2_app.process_events()
|
|
191
196
|
|
|
192
197
|
def run(self, output_file="temp/repo.html"):
|
|
198
|
+
from q2rad.q2rad import run_module, run_form, get_form , get_report
|
|
199
|
+
_globals = {}
|
|
200
|
+
_globals.update(locals())
|
|
201
|
+
|
|
193
202
|
output_file = self.prepare_output_file(output_file)
|
|
194
203
|
if not output_file:
|
|
195
204
|
return
|
|
@@ -214,6 +223,27 @@ class Q2RadReport(Q2Report):
|
|
|
214
223
|
|
|
215
224
|
return real_worker
|
|
216
225
|
|
|
226
|
+
if _module := self.report_content.get("module"):
|
|
227
|
+
code = q2app.q2_app.code_compiler(_module)
|
|
228
|
+
if code["code"]:
|
|
229
|
+
_globals.update(globals())
|
|
230
|
+
try:
|
|
231
|
+
exec(code["code"], _globals)
|
|
232
|
+
for key, value in _globals.items():
|
|
233
|
+
self.set_data(value, key)
|
|
234
|
+
except Exception as error:
|
|
235
|
+
from q2rad.q2rad import explain_error
|
|
236
|
+
_logger.error(f"{error}")
|
|
237
|
+
explain_error()
|
|
238
|
+
else:
|
|
239
|
+
msg = code["error"]
|
|
240
|
+
if threading.current_thread() is threading.main_thread():
|
|
241
|
+
q2mess(f"{msg}".replace("\n", "<br>").replace(" ", " "))
|
|
242
|
+
print(f"{msg}")
|
|
243
|
+
print("-" * 25)
|
|
244
|
+
_logger.error(msg)
|
|
245
|
+
return
|
|
246
|
+
|
|
217
247
|
q2working(worker(), "W o r k i n g")
|
|
218
248
|
|
|
219
249
|
super().run(output_file, data=data)
|
|
@@ -364,8 +394,8 @@ class Q2ReportEdit(Q2Form):
|
|
|
364
394
|
self.add_control("rl", "", widget=self.layout_edit, nogrid=1, migrate=0)
|
|
365
395
|
self.add_control("/t", "Query")
|
|
366
396
|
self.add_control("ql", "", widget=self.query_edit, nogrid=1, migrate=0)
|
|
367
|
-
self.add_control("/t", "Setup")
|
|
368
|
-
self.add_control("before_script", "", control="code")
|
|
397
|
+
# self.add_control("/t", "Setup")
|
|
398
|
+
# self.add_control("before_script", "", control="code")
|
|
369
399
|
self.add_control("/t", "Module")
|
|
370
400
|
self.add_control("module", "", control="code")
|
|
371
401
|
self.add_control("/t", "Comment")
|
|
@@ -380,10 +410,12 @@ class Q2ReportEdit(Q2Form):
|
|
|
380
410
|
content_json = content
|
|
381
411
|
self.query_edit.set_content(content_json)
|
|
382
412
|
self.layout_edit.set_content(content_json)
|
|
413
|
+
self.s.module = content_json.get("module", "#")
|
|
383
414
|
|
|
384
415
|
def get_content(self, str_mode=True):
|
|
385
416
|
content = self.query_edit.get_content(str_mode=False)
|
|
386
417
|
content.update(self.layout_edit.get_content(str_mode=False))
|
|
418
|
+
content["module"] = self.s.module
|
|
387
419
|
if str_mode:
|
|
388
420
|
return json.dumps(content, indent=2)
|
|
389
421
|
else:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.224"
|
q2rad-0.1.223/q2rad/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.223"
|
|
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
|
|
File without changes
|