q2rad 0.1.193__py3-none-any.whl → 0.1.195__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 -1
- q2rad/q2lines.py +2 -1
- q2rad/q2rad.py +28 -13
- q2rad/q2utils.py +5 -1
- q2rad/version.py +1 -1
- {q2rad-0.1.193.dist-info → q2rad-0.1.195.dist-info}/METADATA +1 -1
- {q2rad-0.1.193.dist-info → q2rad-0.1.195.dist-info}/RECORD +10 -10
- {q2rad-0.1.193.dist-info → q2rad-0.1.195.dist-info}/LICENSE +0 -0
- {q2rad-0.1.193.dist-info → q2rad-0.1.195.dist-info}/WHEEL +0 -0
- {q2rad-0.1.193.dist-info → q2rad-0.1.195.dist-info}/entry_points.txt +0 -0
q2rad/q2actions.py
CHANGED
|
@@ -41,7 +41,7 @@ class Q2Actions(Q2Form, Q2_save_and_run):
|
|
|
41
41
|
self.add_action("/crud")
|
|
42
42
|
# self.add_seq_actions()
|
|
43
43
|
self.add_action("Run", self.form_runner, hotkey="F4")
|
|
44
|
-
self.add_action("Copy to", icon="
|
|
44
|
+
self.add_action("Copy to", icon="❖", worker=self.copy_to)
|
|
45
45
|
|
|
46
46
|
def create_form(self):
|
|
47
47
|
self.add_control("id", "", datatype="int", pk="*", ai="*", noform=1, nogrid=1)
|
q2rad/q2lines.py
CHANGED
|
@@ -93,7 +93,7 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
93
93
|
self.add_action("Fill", self.filler)
|
|
94
94
|
self.add_action("-")
|
|
95
95
|
self.add_action("Select panel", icon="⭥", worker=self.select_panel, hotkey="F3")
|
|
96
|
-
self.add_action("Copy to", icon="
|
|
96
|
+
self.add_action("Copy to", icon="❖", worker=self.copy_to)
|
|
97
97
|
self.add_action("Move rows down", icon="⭸", worker=self.move_rows_down)
|
|
98
98
|
self.add_action("Layout|Form", icon="☆", worker=lambda: self.add_layout("/f"))
|
|
99
99
|
self.add_action("Layout|Horizontally", worker=lambda: self.add_layout("/h"))
|
|
@@ -117,6 +117,7 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
117
117
|
self.add_control("/f")
|
|
118
118
|
self.add_control("label", _("Form label"), datatype="char", datalen=100)
|
|
119
119
|
self.add_control("gridlabel", _("Grid label"), datatype="char", datalen=100)
|
|
120
|
+
self.add_control("mess", _("Tooltip"), datatype="char", datalen=200)
|
|
120
121
|
if self.add_control("/h"):
|
|
121
122
|
self.add_control("seq", _("Sequence number"), datatype="int")
|
|
122
123
|
self.add_control("nogrid", _("No grid"), control="check", datalen=1)
|
q2rad/q2rad.py
CHANGED
|
@@ -91,6 +91,9 @@ set_logging()
|
|
|
91
91
|
_logger = logging.getLogger(__name__)
|
|
92
92
|
|
|
93
93
|
|
|
94
|
+
class ReturnEvent(Exception):
|
|
95
|
+
pass
|
|
96
|
+
|
|
94
97
|
def get_report(report_name="", style={}):
|
|
95
98
|
if report_name == "":
|
|
96
99
|
return Q2RadReport(style=style)
|
|
@@ -126,9 +129,6 @@ def run_module(module_name=None, globals=globals(), locals=locals(), script="",
|
|
|
126
129
|
else:
|
|
127
130
|
__name__ = "__main__"
|
|
128
131
|
|
|
129
|
-
class ReturnEvent(Exception):
|
|
130
|
-
pass
|
|
131
|
-
|
|
132
132
|
locals.update(
|
|
133
133
|
{
|
|
134
134
|
"RETURN": None,
|
|
@@ -141,9 +141,9 @@ def run_module(module_name=None, globals=globals(), locals=locals(), script="",
|
|
|
141
141
|
)
|
|
142
142
|
try:
|
|
143
143
|
exec(code["code"], globals, locals)
|
|
144
|
-
except ReturnEvent:
|
|
144
|
+
except ReturnEvent as error:
|
|
145
145
|
pass
|
|
146
|
-
except Exception:
|
|
146
|
+
except Exception as error:
|
|
147
147
|
explain_error()
|
|
148
148
|
return locals["RETURN"]
|
|
149
149
|
|
|
@@ -1015,6 +1015,7 @@ class Q2RadApp(Q2App):
|
|
|
1015
1015
|
`column`
|
|
1016
1016
|
, label
|
|
1017
1017
|
, gridlabel
|
|
1018
|
+
, mess
|
|
1018
1019
|
, nogrid
|
|
1019
1020
|
, noform
|
|
1020
1021
|
, `check`
|
|
@@ -1129,23 +1130,41 @@ class Q2RadApp(Q2App):
|
|
|
1129
1130
|
return form
|
|
1130
1131
|
|
|
1131
1132
|
def code_compiler(self, script):
|
|
1133
|
+
def count_leading_spaces(string):
|
|
1134
|
+
count = 0
|
|
1135
|
+
for char in string:
|
|
1136
|
+
if char == " ":
|
|
1137
|
+
count += 1
|
|
1138
|
+
else:
|
|
1139
|
+
break
|
|
1140
|
+
return count
|
|
1141
|
+
|
|
1132
1142
|
if "return" in script or "?" in script or "import" in script:
|
|
1133
1143
|
# modify script for
|
|
1134
1144
|
new_script_lines = []
|
|
1135
1145
|
in_def = False
|
|
1146
|
+
in_def_indent = -1
|
|
1136
1147
|
for x in script.split("\n"):
|
|
1148
|
+
if x.strip() == "":
|
|
1149
|
+
continue
|
|
1150
|
+
spaces_count = count_leading_spaces(x)
|
|
1137
1151
|
# when in_def is True - do not modify return
|
|
1138
|
-
if re.findall(r"
|
|
1152
|
+
if in_def is False and re.findall(r"^\s*def|^\s*class", x):
|
|
1139
1153
|
in_def = True
|
|
1140
|
-
|
|
1154
|
+
in_def_indent = spaces_count
|
|
1155
|
+
elif spaces_count <= in_def_indent:
|
|
1141
1156
|
in_def = False
|
|
1157
|
+
in_def_indent = -1
|
|
1142
1158
|
# return
|
|
1143
1159
|
if in_def is False and re.findall(r"^\s*return\W*.*|;\s*return\W*.*", x):
|
|
1144
1160
|
if x.strip() == "return":
|
|
1145
1161
|
x = x.replace("return", "raise ReturnEvent")
|
|
1146
1162
|
else:
|
|
1147
|
-
x = x.replace("return", "RETURN = ") + ";
|
|
1148
|
-
|
|
1163
|
+
# x = x.replace("return", "RETURN = ") + ";raise ReturnEvent"
|
|
1164
|
+
# x = x.replace("\n", "").replace("\r", "") + ";raise ReturnEvent"
|
|
1165
|
+
x = x.replace("\n", "").replace("\r", "")
|
|
1166
|
+
x = x.replace("return", "RETURN =")
|
|
1167
|
+
x += ";raise ReturnEvent"
|
|
1149
1168
|
if re.findall(r"^\s*\?\W*.*", x):
|
|
1150
1169
|
# lets print it
|
|
1151
1170
|
x = x.split("?")[0] + "print(" + "".join(x.split("?")[1:]) + ")"
|
|
@@ -1182,10 +1201,6 @@ class Q2RadApp(Q2App):
|
|
|
1182
1201
|
|
|
1183
1202
|
# to provide return ability for exec
|
|
1184
1203
|
def real_runner(**args):
|
|
1185
|
-
# make exec stop on return
|
|
1186
|
-
class ReturnEvent(Exception):
|
|
1187
|
-
pass
|
|
1188
|
-
|
|
1189
1204
|
__locals_dict = {
|
|
1190
1205
|
"RETURN": None,
|
|
1191
1206
|
"ReturnEvent": ReturnEvent,
|
q2rad/q2utils.py
CHANGED
|
@@ -266,7 +266,11 @@ class Q2Form(_Q2Form):
|
|
|
266
266
|
def after_form_show():
|
|
267
267
|
query = self.model.get_table_name()
|
|
268
268
|
if not query.strip().lower().startswith("select "):
|
|
269
|
-
|
|
269
|
+
where = self.model.get_where()
|
|
270
|
+
where = "" if where == "" else f" where {where}"
|
|
271
|
+
order = self.model.get_order()
|
|
272
|
+
order = "" if order == "" else f" order by {order}"
|
|
273
|
+
query = f"select * from {query} {where} {order}"
|
|
270
274
|
form.query_edit.set_content({"queries": {"query": query}})
|
|
271
275
|
|
|
272
276
|
form.after_form_show = after_form_show
|
q2rad/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.195"
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
q2rad/__init__.py,sha256=Y0Up-UTXOmCYC9llNmTF10CpDDgF2kv10pyHT3-YwmQ,183
|
|
2
2
|
q2rad/__main__.py,sha256=zP4JARM-FzFHM-vWLehx7c5N4v4m_F-TuMobCdFzr4Q,824
|
|
3
|
-
q2rad/q2actions.py,sha256=
|
|
3
|
+
q2rad/q2actions.py,sha256=Xqrpm68e36KVzyrmbDP8wDJfh-C_PVS-YTCF5nAQdcU,8034
|
|
4
4
|
q2rad/q2appmanager.py,sha256=uDm2sP49fS4sWn75NEEic0xxtFG0I780pLcxDBR4eME,15566
|
|
5
5
|
q2rad/q2appselector.py,sha256=BHxrQLoR567tLo5CLSZvgcg4V51BvNCaA1U_EZyEZ7k,12596
|
|
6
6
|
q2rad/q2constants.py,sha256=dQtN4OMvZw0FATDAFYjolI7eGMVUnNnbTl6qM-ggZ4I,3416
|
|
7
7
|
q2rad/q2forms.py,sha256=A5VeBK8OdE3zn0L1TgvCk4OjpB1nLibJqBFfpVZr_Uc,10181
|
|
8
|
-
q2rad/q2lines.py,sha256=
|
|
8
|
+
q2rad/q2lines.py,sha256=6p7vJI3m7bENIMrGgueIXP85b0Q2f-WmF8wz3HVHZdQ,16086
|
|
9
9
|
q2rad/q2make.py,sha256=wXoyBUwf2zaAl9JjWDCbjAteUElRq0O7ippyaMY9eug,6476
|
|
10
10
|
q2rad/q2market.py,sha256=koWwKKc1MVn0ud2XDu_dal8lBFEMLX8KABpZO_OzTIM,2597
|
|
11
11
|
q2rad/q2modules.py,sha256=N3OkUKfiwVZtmDyAtnJcs2Rprd7uIHd0HhjHTyFoN_s,4294
|
|
12
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=4bdQ3LtGN3pEYJj0VBTziJsMip_na7qj3NOUPejzjO8,45720
|
|
15
15
|
q2rad/q2raddb.py,sha256=ISqT5EBFO7eaXcQRNpA0hMiRU84kbd-FcfckwKMlGfs,4506
|
|
16
16
|
q2rad/q2reports.py,sha256=via1MQF5hfa-IGmzFwDmkEiNNHk0UhevM9yYhYs4DOs,83224
|
|
17
17
|
q2rad/q2stylesettings.py,sha256=_aK-44kFfkaEGdwH7FzRs1KP7nsP08bL8t8OmdjM2eY,4767
|
|
18
|
-
q2rad/q2utils.py,sha256=
|
|
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.
|
|
18
|
+
q2rad/q2utils.py,sha256=6Z7DOHcdRrWhAN_Fnx8WEi-fNqFqMOjO7diDe9YtXkU,18919
|
|
19
|
+
q2rad/version.py,sha256=6YJwurLCGx_wb4Z5lwVX0N9YBV5tZ-iYDNPyghKfQVw,23
|
|
20
|
+
q2rad-0.1.195.dist-info/entry_points.txt,sha256=DmsJQE6f3wYuhdN2h6ARYxSe8_d03paeepfGpdVj5rs,42
|
|
21
|
+
q2rad-0.1.195.dist-info/LICENSE,sha256=JRR3LlR18ghhYXT4G2cWgXmnxRvcuVcKlqncWWK4MRY,10347
|
|
22
|
+
q2rad-0.1.195.dist-info/METADATA,sha256=Ccz0GUlhbPeZIv8N6N2xKscuSpbXTbpZf--J0Z_hRMo,3369
|
|
23
|
+
q2rad-0.1.195.dist-info/WHEEL,sha256=WGfLGfLX43Ei_YORXSnT54hxFygu34kMpcQdmgmEwCQ,88
|
|
24
|
+
q2rad-0.1.195.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|