q2rad 0.1.221__tar.gz → 0.1.222__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.221 → q2rad-0.1.222}/PKG-INFO +1 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/pyproject.toml +1 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2appmanager.py +2 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2extensions.py +2 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2lines.py +1 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2rad.py +113 -38
- q2rad-0.1.222/q2rad/version.py +1 -0
- q2rad-0.1.221/q2rad/version.py +0 -1
- {q2rad-0.1.221 → q2rad-0.1.222}/LICENSE +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/README.md +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/__init__.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/__main__.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2actions.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2appselector.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2constants.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2forms.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2make.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2market.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2modules.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2packages.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2queries.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2raddb.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2reports.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2stylesettings.py +0 -0
- {q2rad-0.1.221 → q2rad-0.1.222}/q2rad/q2utils.py +0 -0
|
@@ -448,7 +448,8 @@ class AppManager(Q2Form):
|
|
|
448
448
|
return rez
|
|
449
449
|
|
|
450
450
|
def import_q2market(self):
|
|
451
|
-
self.q2_app.check_app_update(force_update=True)
|
|
451
|
+
if self.q2_app.check_app_update(force_update=True):
|
|
452
|
+
self.q2_app.open_selected_app()
|
|
452
453
|
|
|
453
454
|
def import_app(self, file=""):
|
|
454
455
|
filetype = "JSON(*.json)"
|
|
@@ -160,7 +160,8 @@ class Q2Extensions(Q2Form):
|
|
|
160
160
|
def import_q2market(self):
|
|
161
161
|
q2market_url = self.r.q2market_url if self.r.q2market_url else self.q2_app.q2market_url
|
|
162
162
|
if q2market_url:
|
|
163
|
-
q2app.q2_app.check_ext_update(self.r.prefix, force_update=True)
|
|
163
|
+
if q2app.q2_app.check_ext_update(self.r.prefix, force_update=True):
|
|
164
|
+
q2app.q2_app.open_selected_app()
|
|
164
165
|
else:
|
|
165
166
|
q2Mess("No App URL!")
|
|
166
167
|
|
|
@@ -300,7 +300,7 @@ class Q2Lines(Q2Form, Q2_save_and_run):
|
|
|
300
300
|
record = self.get_current_record()
|
|
301
301
|
record["table"] = self.db.get("forms", f"name = '{self.prev_form.r.name}'", "form_table")
|
|
302
302
|
if not q2app.q2_app.db_data.alter_column(record):
|
|
303
|
-
q2mess(self.db_data.migrate_error_list)
|
|
303
|
+
q2mess(self.q2_app.db_data.migrate_error_list)
|
|
304
304
|
|
|
305
305
|
def copy_to(self):
|
|
306
306
|
rows = self.get_grid_selected_rows()
|
|
@@ -323,8 +323,8 @@ class Q2RadApp(Q2App):
|
|
|
323
323
|
Q2AppSelect().run(autoload_enabled)
|
|
324
324
|
if self.selected_application != {}:
|
|
325
325
|
self.open_selected_app(True, migrate_db_data=False)
|
|
326
|
-
self.check_app_update()
|
|
327
|
-
|
|
326
|
+
if self.check_app_update() or self.check_ext_update():
|
|
327
|
+
self.open_selected_app()
|
|
328
328
|
self.on_new_tab()
|
|
329
329
|
else:
|
|
330
330
|
self.close()
|
|
@@ -558,9 +558,11 @@ class Q2RadApp(Q2App):
|
|
|
558
558
|
if self.dev_mode:
|
|
559
559
|
self.add_menu("Dev|Forms", self.run_forms)
|
|
560
560
|
self.add_menu("Dev|Modules", self.run_modules)
|
|
561
|
-
self.add_menu("Dev|
|
|
561
|
+
self.add_menu("Dev|Queres", self.run_queries)
|
|
562
562
|
self.add_menu("Dev|Reports", self.run_reports)
|
|
563
563
|
self.add_menu("Dev|Packages", self.run_packages)
|
|
564
|
+
self.add_menu("Dev|-")
|
|
565
|
+
self.add_menu("Dev|Finder", self.run_finder)
|
|
564
566
|
if not self.frozen:
|
|
565
567
|
self.add_menu("Dev|-")
|
|
566
568
|
self.add_menu("Dev|Make binary", self.make_binary)
|
|
@@ -912,7 +914,7 @@ class Q2RadApp(Q2App):
|
|
|
912
914
|
except Exception as e: # noqa F841
|
|
913
915
|
self.show_statusbar_mess("An error occurred while checking for updates")
|
|
914
916
|
return
|
|
915
|
-
if force_update or market_version and market_version
|
|
917
|
+
if force_update or (market_version and market_version > self.app_version):
|
|
916
918
|
if force_update:
|
|
917
919
|
update_detected = f"You are about to rewrite current App <b>{self.app_title}</b>!"
|
|
918
920
|
else:
|
|
@@ -928,7 +930,8 @@ class Q2RadApp(Q2App):
|
|
|
928
930
|
):
|
|
929
931
|
data = json.load(open_url(self.app_url + ".json")) # noqa F405
|
|
930
932
|
AppManager.import_json_app(data)
|
|
931
|
-
self.open_selected_app()
|
|
933
|
+
# self.open_selected_app()
|
|
934
|
+
return True
|
|
932
935
|
|
|
933
936
|
def check_ext_update(self, prefix="", force_update=False, _ext_url=""):
|
|
934
937
|
if self.frozen:
|
|
@@ -937,6 +940,7 @@ class Q2RadApp(Q2App):
|
|
|
937
940
|
cu = q2cursor(f"select * from extensions where prefix='{prefix}'")
|
|
938
941
|
else:
|
|
939
942
|
cu = q2cursor(f"select * from extensions where checkupdates<>'' order by seq")
|
|
943
|
+
updated = None
|
|
940
944
|
for row in cu.records():
|
|
941
945
|
_prefix = row["prefix"]
|
|
942
946
|
|
|
@@ -953,8 +957,8 @@ class Q2RadApp(Q2App):
|
|
|
953
957
|
market_version = read_url(ext_url + ".version").decode("utf-8") # noqa F405
|
|
954
958
|
except Exception as e: # noqa F841
|
|
955
959
|
self.show_statusbar_mess("An error occurred while checking for updates")
|
|
956
|
-
|
|
957
|
-
if force_update or market_version and market_version
|
|
960
|
+
continue
|
|
961
|
+
if force_update or (market_version and market_version > ext_version):
|
|
958
962
|
if force_update:
|
|
959
963
|
update_detected = (
|
|
960
964
|
f"You are about to rewrite current Extension ({_prefix}) <b>{self.app_title}</b>!"
|
|
@@ -974,8 +978,10 @@ class Q2RadApp(Q2App):
|
|
|
974
978
|
):
|
|
975
979
|
data = json.load(open_url(ext_url + ".json")) # noqa F405
|
|
976
980
|
AppManager.import_json_app(data, prefix=_prefix)
|
|
977
|
-
update("extensions", {"prefix":row["prefix"], "version":market_version})
|
|
978
|
-
|
|
981
|
+
update("extensions", {"prefix": row["prefix"], "version": market_version})
|
|
982
|
+
updated = True
|
|
983
|
+
# self.open_selected_app()
|
|
984
|
+
return updated
|
|
979
985
|
|
|
980
986
|
def update_app_packages(self):
|
|
981
987
|
if self.frozen:
|
|
@@ -1115,6 +1121,71 @@ class Q2RadApp(Q2App):
|
|
|
1115
1121
|
def run_extensions(self):
|
|
1116
1122
|
Q2Extensions().run()
|
|
1117
1123
|
|
|
1124
|
+
def run_finder(self):
|
|
1125
|
+
class Q2Finder:
|
|
1126
|
+
def __init__(self, find_string):
|
|
1127
|
+
self.find_string = find_string
|
|
1128
|
+
|
|
1129
|
+
def get_columns_sql(self, table):
|
|
1130
|
+
return "select {{}} from {} where concat({}) like".format(
|
|
1131
|
+
table,
|
|
1132
|
+
", ".join([f"`{x}`" for x in q2app.q2_app.db_logic.get_database_columns(table).keys()]),
|
|
1133
|
+
)
|
|
1134
|
+
|
|
1135
|
+
def show_lines(self, table="lines"):
|
|
1136
|
+
sql = self.get_columns_sql(table).format("id") + " '%{}%'".format(self.find_string)
|
|
1137
|
+
where = "id in ({})".format(
|
|
1138
|
+
", ".join([x["id"] for x in q2cursor(sql, q2app.q2_app.db_logic).records()])
|
|
1139
|
+
)
|
|
1140
|
+
{"actions": Q2Actions, "lines": Q2Lines}[table]().run(where=where)
|
|
1141
|
+
|
|
1142
|
+
def show_other(self, table):
|
|
1143
|
+
sql = self.get_columns_sql(table).format("name") + " '%{}%'".format(self.find_string)
|
|
1144
|
+
where = "name in ({})".format(
|
|
1145
|
+
", ".join(['"' + x["name"] + '"' for x in q2cursor(sql, q2app.q2_app.db_logic).records()])
|
|
1146
|
+
)
|
|
1147
|
+
{"forms": Q2Forms, "reports": Q2Reports, "modules": Q2Modules, "queries": Q2Queries}[
|
|
1148
|
+
table
|
|
1149
|
+
]().run(where=where)
|
|
1150
|
+
|
|
1151
|
+
finder = Q2Form("Finder")
|
|
1152
|
+
|
|
1153
|
+
finder.add_control("find_string", "Find string", datalen=150)
|
|
1154
|
+
finder.add_control("/")
|
|
1155
|
+
finder.add_control("/h", "in")
|
|
1156
|
+
finder.add_control(
|
|
1157
|
+
"button",
|
|
1158
|
+
"Forms",
|
|
1159
|
+
control="button",
|
|
1160
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_other("forms"),
|
|
1161
|
+
)
|
|
1162
|
+
finder.add_control(
|
|
1163
|
+
"button",
|
|
1164
|
+
"Lines",
|
|
1165
|
+
control="button",
|
|
1166
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_lines("lines"),
|
|
1167
|
+
)
|
|
1168
|
+
finder.add_control(
|
|
1169
|
+
"button",
|
|
1170
|
+
"Actions",
|
|
1171
|
+
control="button",
|
|
1172
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_lines("actions"),
|
|
1173
|
+
)
|
|
1174
|
+
finder.add_control(
|
|
1175
|
+
"button",
|
|
1176
|
+
"Modules",
|
|
1177
|
+
control="button",
|
|
1178
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_other("modules"),
|
|
1179
|
+
)
|
|
1180
|
+
finder.add_control(
|
|
1181
|
+
"button",
|
|
1182
|
+
"Queries",
|
|
1183
|
+
control="button",
|
|
1184
|
+
valid=lambda: Q2Finder(finder.s.find_string).show_other("queries"),
|
|
1185
|
+
)
|
|
1186
|
+
finder.cancel_button = 1
|
|
1187
|
+
finder.run()
|
|
1188
|
+
|
|
1118
1189
|
def make_binary(self):
|
|
1119
1190
|
make_binary(self)
|
|
1120
1191
|
|
|
@@ -1199,12 +1270,12 @@ class Q2RadApp(Q2App):
|
|
|
1199
1270
|
form.after_delete = self.code_runner(form_dic["after_delete"], form)
|
|
1200
1271
|
|
|
1201
1272
|
# add controls
|
|
1202
|
-
for
|
|
1203
|
-
|
|
1204
|
-
if
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
form.add_control(**
|
|
1273
|
+
for control in cu.records():
|
|
1274
|
+
control["valid"] = self.code_runner(control["valid"], form)
|
|
1275
|
+
if control.get("_show"):
|
|
1276
|
+
control["show"] = self.code_runner(control["_show"], form)
|
|
1277
|
+
control["when"] = self.code_runner(control["_when"], form)
|
|
1278
|
+
form.add_control(**control)
|
|
1208
1279
|
run_module("_e_control", _locals=locals())
|
|
1209
1280
|
|
|
1210
1281
|
# add datasource
|
|
@@ -1235,14 +1306,14 @@ class Q2RadApp(Q2App):
|
|
|
1235
1306
|
ext_select = ""
|
|
1236
1307
|
sql = f"select * from (select * from actions where name = '{name}' order by seq ) qq {ext_select}"
|
|
1237
1308
|
cu = q2cursor(sql, self.db_logic)
|
|
1238
|
-
for
|
|
1239
|
-
if
|
|
1309
|
+
for action in cu.records():
|
|
1310
|
+
if action["action_mode"] == "1":
|
|
1240
1311
|
form.add_action("/crud")
|
|
1241
|
-
elif
|
|
1312
|
+
elif action["action_mode"] == "3":
|
|
1242
1313
|
form.add_action("-")
|
|
1243
1314
|
else:
|
|
1244
|
-
if
|
|
1245
|
-
child_form_name =
|
|
1315
|
+
if action["child_form"] and action["child_where"]:
|
|
1316
|
+
child_form_name = action["child_form"]
|
|
1246
1317
|
|
|
1247
1318
|
def get_action_form(child_form_name):
|
|
1248
1319
|
def worker():
|
|
@@ -1251,29 +1322,33 @@ class Q2RadApp(Q2App):
|
|
|
1251
1322
|
return worker
|
|
1252
1323
|
|
|
1253
1324
|
form.add_action(
|
|
1254
|
-
|
|
1255
|
-
self.code_runner(
|
|
1325
|
+
action["action_text"],
|
|
1326
|
+
self.code_runner(action["action_worker"]) if action["action_worker"] else None,
|
|
1256
1327
|
child_form=get_action_form(child_form_name),
|
|
1257
|
-
child_where=
|
|
1258
|
-
hotkey=
|
|
1259
|
-
mess=
|
|
1260
|
-
icon=
|
|
1261
|
-
tag=
|
|
1262
|
-
child_noshow=
|
|
1263
|
-
child_copy_mode=
|
|
1328
|
+
child_where=action["child_where"],
|
|
1329
|
+
hotkey=action["action_key"],
|
|
1330
|
+
mess=action["action_mess"],
|
|
1331
|
+
icon=action["action_icon"],
|
|
1332
|
+
tag=action["tag"],
|
|
1333
|
+
child_noshow=action["child_noshow"],
|
|
1334
|
+
child_copy_mode=action["child_copy_mode"],
|
|
1264
1335
|
eof_disabled=1,
|
|
1265
1336
|
)
|
|
1266
1337
|
else:
|
|
1267
1338
|
form.add_action(
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1339
|
+
action["action_text"],
|
|
1340
|
+
(
|
|
1341
|
+
self.code_runner(action["action_worker"], form=form)
|
|
1342
|
+
if action["action_worker"]
|
|
1343
|
+
else None
|
|
1344
|
+
),
|
|
1345
|
+
hotkey=action["action_key"],
|
|
1346
|
+
icon=action["action_icon"],
|
|
1347
|
+
mess=action["action_mess"],
|
|
1348
|
+
tag=action["tag"],
|
|
1349
|
+
child_noshow=action["child_noshow"],
|
|
1350
|
+
child_copy_mode=action["child_copy_mode"],
|
|
1351
|
+
eof_disabled=action["eof_disabled"],
|
|
1277
1352
|
)
|
|
1278
1353
|
run_module("_e_action", _locals=locals())
|
|
1279
1354
|
return form
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.222"
|
q2rad-0.1.221/q2rad/version.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.221"
|
|
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
|