q2rad 0.1.222__py3-none-any.whl → 0.1.224__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/q2actions.py +1 -0
- q2rad/q2forms.py +1 -0
- q2rad/q2lines.py +1 -0
- q2rad/q2modules.py +2 -1
- q2rad/q2queries.py +1 -0
- q2rad/q2rad.py +20 -3
- q2rad/q2reports.py +35 -2
- q2rad/q2utils.py +1 -0
- q2rad/version.py +1 -1
- {q2rad-0.1.222.dist-info → q2rad-0.1.224.dist-info}/METADATA +1 -1
- q2rad-0.1.224.dist-info/RECORD +25 -0
- q2rad-0.1.222.dist-info/RECORD +0 -25
- {q2rad-0.1.222.dist-info → q2rad-0.1.224.dist-info}/LICENSE +0 -0
- {q2rad-0.1.222.dist-info → q2rad-0.1.224.dist-info}/WHEEL +0 -0
- {q2rad-0.1.222.dist-info → q2rad-0.1.224.dist-info}/entry_points.txt +0 -0
q2rad/q2actions.py
CHANGED
|
@@ -139,6 +139,7 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
139
139
|
self.add_control("/t", _("Comment"))
|
|
140
140
|
self.add_control("comment", gridlabel=_("Comments"), datatype="longtext", control="longtext")
|
|
141
141
|
self.add_control("/")
|
|
142
|
+
self.add_control("q2_time", "Time", datatype="int", noform=1, alignment=7)
|
|
142
143
|
self._add_save_and_run()
|
|
143
144
|
self._add_save_and_run_visible()
|
|
144
145
|
|
q2rad/q2forms.py
CHANGED
q2rad/q2lines.py
CHANGED
q2rad/q2modules.py
CHANGED
|
@@ -56,7 +56,8 @@ class Q2Modules(Q2Form, Q2_save_and_run):
|
|
|
56
56
|
self.add_control("/t", "Comment")
|
|
57
57
|
self.add_control("comment", _("Comment"), control="text", dattype="text")
|
|
58
58
|
|
|
59
|
-
self.add_control("last_line", "Last line", datatype="int", noform=1, migrate=1)
|
|
59
|
+
self.add_control("last_line", "Last line", datatype="int", noform=1, migrate=1, nogrid=1)
|
|
60
|
+
self.add_control("q2_time", "Time", datatype="int", noform=1, alignment=7)
|
|
60
61
|
self.add_control("/")
|
|
61
62
|
|
|
62
63
|
cursor: Q2Cursor = self.q2_app.db_logic.table(table_name="modules", order="name")
|
q2rad/q2queries.py
CHANGED
|
@@ -63,6 +63,7 @@ class Q2Queries(Q2Form, Q2_save_and_run):
|
|
|
63
63
|
# readonly=1,
|
|
64
64
|
)
|
|
65
65
|
self.add_control("comment", _("Comment"), datatype="longtext", noform=1)
|
|
66
|
+
self.add_control("q2_time", "Time", datatype="int", noform=1, alignment=7)
|
|
66
67
|
self._add_save_and_run(save_only=True)
|
|
67
68
|
self._add_save_and_run_visible(save_only=True)
|
|
68
69
|
|
q2rad/q2rad.py
CHANGED
|
@@ -425,6 +425,16 @@ class Q2RadApp(Q2App):
|
|
|
425
425
|
data_schema.add(**x)
|
|
426
426
|
db_logic.set_schema(data_schema)
|
|
427
427
|
|
|
428
|
+
data_schema = Q2DbSchema()
|
|
429
|
+
for form in (
|
|
430
|
+
Q2Constants(),
|
|
431
|
+
Q2Extensions(),
|
|
432
|
+
):
|
|
433
|
+
for x in form.get_table_schema():
|
|
434
|
+
data_schema.add(**x)
|
|
435
|
+
|
|
436
|
+
self.db_data.set_schema(data_schema)
|
|
437
|
+
|
|
428
438
|
def get_autocompletition_list(self):
|
|
429
439
|
rez = []
|
|
430
440
|
tables = self.db_data.db_schema.get_schema_tables()
|
|
@@ -558,7 +568,7 @@ class Q2RadApp(Q2App):
|
|
|
558
568
|
if self.dev_mode:
|
|
559
569
|
self.add_menu("Dev|Forms", self.run_forms)
|
|
560
570
|
self.add_menu("Dev|Modules", self.run_modules)
|
|
561
|
-
self.add_menu("Dev|
|
|
571
|
+
self.add_menu("Dev|Queries", self.run_queries)
|
|
562
572
|
self.add_menu("Dev|Reports", self.run_reports)
|
|
563
573
|
self.add_menu("Dev|Packages", self.run_packages)
|
|
564
574
|
self.add_menu("Dev|-")
|
|
@@ -1183,6 +1193,12 @@ class Q2RadApp(Q2App):
|
|
|
1183
1193
|
control="button",
|
|
1184
1194
|
valid=lambda: Q2Finder(finder.s.find_string).show_other("queries"),
|
|
1185
1195
|
)
|
|
1196
|
+
finder.add_control(
|
|
1197
|
+
"button",
|
|
1198
|
+
"Reports",
|
|
1199
|
+
control="button",
|
|
1200
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_other("reports"),
|
|
1201
|
+
)
|
|
1186
1202
|
finder.cancel_button = 1
|
|
1187
1203
|
finder.run()
|
|
1188
1204
|
|
|
@@ -1396,13 +1412,14 @@ class Q2RadApp(Q2App):
|
|
|
1396
1412
|
if re.findall(r"^\s*import\W*.*", x):
|
|
1397
1413
|
module = x.split("import")[1].strip()
|
|
1398
1414
|
if self.db_logic.get("modules", f"name='{module}'", "name"):
|
|
1399
|
-
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)"
|
|
1400
1417
|
|
|
1401
1418
|
new_script_lines.append(x)
|
|
1402
1419
|
script = "\n".join(new_script_lines)
|
|
1403
1420
|
try:
|
|
1404
1421
|
code = compile(script, f"<{script}>", "exec")
|
|
1405
|
-
return {"code": code, "error": ""}
|
|
1422
|
+
return {"code": code, "error": "", "script": script}
|
|
1406
1423
|
except Exception:
|
|
1407
1424
|
error = sys.exc_info()[1]
|
|
1408
1425
|
msg = []
|
q2rad/q2reports.py
CHANGED
|
@@ -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)
|
|
@@ -241,6 +271,7 @@ class Q2Reports(Q2Form, Q2_save_and_run):
|
|
|
241
271
|
noform=1,
|
|
242
272
|
)
|
|
243
273
|
self.add_control("comment", _("Comment"), datatype="text", noform=1)
|
|
274
|
+
self.add_control("q2_time", "Time", datatype="int", noform=1, alignment=7)
|
|
244
275
|
self._add_save_and_run(save_only=True)
|
|
245
276
|
self._add_save_and_run_visible(save_only=True)
|
|
246
277
|
|
|
@@ -363,8 +394,8 @@ class Q2ReportEdit(Q2Form):
|
|
|
363
394
|
self.add_control("rl", "", widget=self.layout_edit, nogrid=1, migrate=0)
|
|
364
395
|
self.add_control("/t", "Query")
|
|
365
396
|
self.add_control("ql", "", widget=self.query_edit, nogrid=1, migrate=0)
|
|
366
|
-
self.add_control("/t", "Setup")
|
|
367
|
-
self.add_control("before_script", "", control="code")
|
|
397
|
+
# self.add_control("/t", "Setup")
|
|
398
|
+
# self.add_control("before_script", "", control="code")
|
|
368
399
|
self.add_control("/t", "Module")
|
|
369
400
|
self.add_control("module", "", control="code")
|
|
370
401
|
self.add_control("/t", "Comment")
|
|
@@ -379,10 +410,12 @@ class Q2ReportEdit(Q2Form):
|
|
|
379
410
|
content_json = content
|
|
380
411
|
self.query_edit.set_content(content_json)
|
|
381
412
|
self.layout_edit.set_content(content_json)
|
|
413
|
+
self.s.module = content_json.get("module", "#")
|
|
382
414
|
|
|
383
415
|
def get_content(self, str_mode=True):
|
|
384
416
|
content = self.query_edit.get_content(str_mode=False)
|
|
385
417
|
content.update(self.layout_edit.get_content(str_mode=False))
|
|
418
|
+
content["module"] = self.s.module
|
|
386
419
|
if str_mode:
|
|
387
420
|
return json.dumps(content, indent=2)
|
|
388
421
|
else:
|
q2rad/q2utils.py
CHANGED
q2rad/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.224"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
q2rad/__init__.py,sha256=Y0Up-UTXOmCYC9llNmTF10CpDDgF2kv10pyHT3-YwmQ,183
|
|
2
|
+
q2rad/__main__.py,sha256=zP4JARM-FzFHM-vWLehx7c5N4v4m_F-TuMobCdFzr4Q,824
|
|
3
|
+
q2rad/q2actions.py,sha256=sZftIHXmrVRnmkHVA51foSyAel9ziIa82rAZq03OPh4,8342
|
|
4
|
+
q2rad/q2appmanager.py,sha256=8btKbT_NGBlNxscINVQnpdkLZ032OuvnFeYbXda4Xnw,20616
|
|
5
|
+
q2rad/q2appselector.py,sha256=bjl4MDg9DoU1h6NZOQDElaIGURjVQwiHnsUwr3kp3nc,18813
|
|
6
|
+
q2rad/q2constants.py,sha256=dQtN4OMvZw0FATDAFYjolI7eGMVUnNnbTl6qM-ggZ4I,3416
|
|
7
|
+
q2rad/q2extensions.py,sha256=ZAY2gXKjun666PeYfnqGH0X17ZmTgaOMmjCvxAIltJI,7595
|
|
8
|
+
q2rad/q2forms.py,sha256=U19O_zgLrIk0IXCEzscHhQTSIbgW8XS3ftO2ktEHJvo,11206
|
|
9
|
+
q2rad/q2lines.py,sha256=wm6U_WM2K3C9TLI8971_IYcjtUghlBUdIliMAhEESt0,19276
|
|
10
|
+
q2rad/q2make.py,sha256=wXoyBUwf2zaAl9JjWDCbjAteUElRq0O7ippyaMY9eug,6476
|
|
11
|
+
q2rad/q2market.py,sha256=RNXTNv-fFUgbzBGhHPNXlzGjsAHAtz71BRbTErJarNo,2641
|
|
12
|
+
q2rad/q2modules.py,sha256=RwemVJwfxth0lBN4K96tKz62VOW71C7CmmKyhIoH5mc,4632
|
|
13
|
+
q2rad/q2packages.py,sha256=y72L1RAw1OgtKGaL8lJ1KHIaers5I6kTZSiphwwrY0M,3808
|
|
14
|
+
q2rad/q2queries.py,sha256=YYJEpC_0rXAV8W_lx2604yqnkooHzheFmDCfqbW02zY,13203
|
|
15
|
+
q2rad/q2rad.py,sha256=YuitDdn5gggJFZ96QHeiMClvoLNGN6tLl3U5IPXlaAo,56023
|
|
16
|
+
q2rad/q2raddb.py,sha256=tMX971d_awTwiWeYLkZGSfdrIs88oiNHBAs2cMFvSbU,4685
|
|
17
|
+
q2rad/q2reports.py,sha256=tAOm54_P_NN8nRDsZy8N6vbw0YOTNQ_9xtvT6NMG724,86155
|
|
18
|
+
q2rad/q2stylesettings.py,sha256=rEJLyLzsffJEXnMbg9bPB3KHLjYfw-49QgrtcYOfGV0,4769
|
|
19
|
+
q2rad/q2utils.py,sha256=APe6BIdjDY5B6V_iuy-2oRyh3UPAzc8kJmPZJY5AojA,19767
|
|
20
|
+
q2rad/version.py,sha256=B3XV2JBD0xS1afkIkrXk7h-qhjzPqMqB-QIxgORR5ko,23
|
|
21
|
+
q2rad-0.1.224.dist-info/entry_points.txt,sha256=DmsJQE6f3wYuhdN2h6ARYxSe8_d03paeepfGpdVj5rs,42
|
|
22
|
+
q2rad-0.1.224.dist-info/LICENSE,sha256=JRR3LlR18ghhYXT4G2cWgXmnxRvcuVcKlqncWWK4MRY,10347
|
|
23
|
+
q2rad-0.1.224.dist-info/METADATA,sha256=o7gJRGx4U-o5cLh1BRP9ac3Wzljdj57KnPMQb5vrHA0,3369
|
|
24
|
+
q2rad-0.1.224.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
25
|
+
q2rad-0.1.224.dist-info/RECORD,,
|
q2rad-0.1.222.dist-info/RECORD
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
q2rad/__init__.py,sha256=Y0Up-UTXOmCYC9llNmTF10CpDDgF2kv10pyHT3-YwmQ,183
|
|
2
|
-
q2rad/__main__.py,sha256=zP4JARM-FzFHM-vWLehx7c5N4v4m_F-TuMobCdFzr4Q,824
|
|
3
|
-
q2rad/q2actions.py,sha256=eExRvOSyLhT_v1XCR-DmLEhQ9g_LRkrlyXnwDCjT0LM,8258
|
|
4
|
-
q2rad/q2appmanager.py,sha256=8btKbT_NGBlNxscINVQnpdkLZ032OuvnFeYbXda4Xnw,20616
|
|
5
|
-
q2rad/q2appselector.py,sha256=bjl4MDg9DoU1h6NZOQDElaIGURjVQwiHnsUwr3kp3nc,18813
|
|
6
|
-
q2rad/q2constants.py,sha256=dQtN4OMvZw0FATDAFYjolI7eGMVUnNnbTl6qM-ggZ4I,3416
|
|
7
|
-
q2rad/q2extensions.py,sha256=ZAY2gXKjun666PeYfnqGH0X17ZmTgaOMmjCvxAIltJI,7595
|
|
8
|
-
q2rad/q2forms.py,sha256=e9FrhXjvi9ZmrhRBmnmsHoPxDQJqsanLnsPjY6rjaQI,11122
|
|
9
|
-
q2rad/q2lines.py,sha256=hZMfbqsd_UTACrsR5_GxmDqWY7uKcF-P5kMUeoY0KG8,19192
|
|
10
|
-
q2rad/q2make.py,sha256=wXoyBUwf2zaAl9JjWDCbjAteUElRq0O7ippyaMY9eug,6476
|
|
11
|
-
q2rad/q2market.py,sha256=RNXTNv-fFUgbzBGhHPNXlzGjsAHAtz71BRbTErJarNo,2641
|
|
12
|
-
q2rad/q2modules.py,sha256=SpDdXJPG6IcVz1u3xnLoynA2rmiODCNZTZJT8s5iTRI,4538
|
|
13
|
-
q2rad/q2packages.py,sha256=y72L1RAw1OgtKGaL8lJ1KHIaers5I6kTZSiphwwrY0M,3808
|
|
14
|
-
q2rad/q2queries.py,sha256=l9SJ_T5Y38p23xa505EPZocCEmFw_a2y4ck0_-AHVP0,13119
|
|
15
|
-
q2rad/q2rad.py,sha256=Mw3VZpK08JftJ9Ov5U8i2FdGhAYRlGGPeagmnQqTSlk,55424
|
|
16
|
-
q2rad/q2raddb.py,sha256=tMX971d_awTwiWeYLkZGSfdrIs88oiNHBAs2cMFvSbU,4685
|
|
17
|
-
q2rad/q2reports.py,sha256=1fewf1Zlz98raqTIWlRLIg-zTCYA2flGVqyIC120UEU,84802
|
|
18
|
-
q2rad/q2stylesettings.py,sha256=rEJLyLzsffJEXnMbg9bPB3KHLjYfw-49QgrtcYOfGV0,4769
|
|
19
|
-
q2rad/q2utils.py,sha256=Vb5K8Lbb7PzQGDiBEHFrPyDcytVnUSVXy9yIkvWM1Oc,19734
|
|
20
|
-
q2rad/version.py,sha256=NVwRTBgIeHjH6vZ080qRRs0_PMbU-1iWEOmyuOznMyA,23
|
|
21
|
-
q2rad-0.1.222.dist-info/entry_points.txt,sha256=DmsJQE6f3wYuhdN2h6ARYxSe8_d03paeepfGpdVj5rs,42
|
|
22
|
-
q2rad-0.1.222.dist-info/LICENSE,sha256=JRR3LlR18ghhYXT4G2cWgXmnxRvcuVcKlqncWWK4MRY,10347
|
|
23
|
-
q2rad-0.1.222.dist-info/METADATA,sha256=SGv212kqcX-QPThHnmml3mYlgYKX2sjQQ28RJqSMJkQ,3369
|
|
24
|
-
q2rad-0.1.222.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
25
|
-
q2rad-0.1.222.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|