• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Révisionc13ded0ca50b64f50d2dff97ee0c7a8ae792104c (tree)
l'heure2022-01-08 23:37:54
Auteurrdnielsen
Commiterrdnielsen

Message de Log

Modified the ENTRY_FORM to use <Control-Return> for the OK button action, and to use <Return> for this action only if there is not a textarea on the form; modified the ENTRY_FORM to set dialog_canceled appropriately.

Change Summary

Modification

diff -r 4190a6070f1e -r c13ded0ca50b doc/source/metacommands.rst
--- a/doc/source/metacommands.rst Mon Jan 03 12:47:47 2022 -0800
+++ b/doc/source/metacommands.rst Sat Jan 08 06:37:54 2022 -0800
@@ -4027,6 +4027,12 @@
40274027 defined previously—except for checkboxes, for which the substitution
40284028 variable is always defined and assigned a value of "0" or "1".
40294029
4030+The <Enter> key will carry out the action of the "Continue" button
4031+unless there is a multi-line text area on the form. The <Control-Enter>
4032+key chord will carry out the action of the "Continue" button in all
4033+cases. The <Esc> key will carry out the action of the "Cancel"
4034+button.
4035+
40304036 Although the PROMPT ENTRY_FORM metacommand supports validation of
40314037 individual entries through the use of either a list of valid values or
40324038 a regular expression, it does not support cross-column validation or
diff -r 4190a6070f1e -r c13ded0ca50b execsql/execsql.py
--- a/execsql/execsql.py Mon Jan 03 12:47:47 2022 -0800
+++ b/execsql/execsql.py Sat Jan 08 06:37:54 2022 -0800
@@ -27,12 +27,12 @@
2727 #
2828 # ===============================================================================
2929
30-__version__ = "1.96.0"
31-__vdate = "2022-01-03"
30+__version__ = "1.96.1"
31+__vdate = "2022-01-08"
3232
3333 primary_vno = 1
3434 secondary_vno = 96
35-tertiary_vno = 0
35+tertiary_vno = 1
3636
3737 import os
3838 import os.path
@@ -7838,6 +7838,7 @@
78387838 self.msg_label.grid(column=0, row=0, sticky=tk.EW)
78397839 # Data entry frame
78407840 entryframe = ttk.Frame(master=self.win, padding="3 3 3 3")
7841+ has_textarea = False
78417842 any_required = False
78427843 for i, e in enumerate(self.entries):
78437844 self.entries[i].entrylabel = ttk.Label(entryframe, text=e.prompt)
@@ -7857,6 +7858,7 @@
78577858 else:
78587859 self.entries[i].entryvar.set("1")
78597860 elif self.entries[i].entry_type is not None and self.entries[i].entry_type.lower() == "textarea":
7861+ has_textarea = True
78607862 self.entries[i].entryctrl = tk.Text(itementryframe, width=e.width if e.width else 20, height=e.height if e.height else 5, wrap="word")
78617863 if e.value is not None:
78627864 self.entries[i].entryctrl.insert(tk.END, e.value)
@@ -7967,7 +7969,9 @@
79677969 continue_btn = ttk.Button(btnframe, text="Continue", command=self.do_continue)
79687970 self.continue_button = continue_btn
79697971 continue_btn.grid(column=1, row=0, sticky=tk.E, padx=3)
7970- self.win.bind("<Return>", self.do_continue)
7972+ if not has_textarea:
7973+ self.win.bind("<Return>", self.do_continue)
7974+ self.win.bind("<Control-Return>", self.do_continue)
79717975 # Put the frames and other widgets in place.
79727976 msgframe.grid(column=0, row=0, sticky=tk.EW)
79737977 entryframe.grid(column=0, row=1, sticky=tk.EW)
@@ -8057,6 +8061,7 @@
80578061 valid = len(valid_errors) == 0
80588062 self.continue_button.configure(state='normal' if valid else 'disabled')
80598063 def cancel(self, *args):
8064+ status.dialog_canceled = True
80608065 self.win.destroy()
80618066 self.win.update_idletasks()
80628067 def do_continue(self, *args):
@@ -8077,6 +8082,7 @@
80778082 self.win._root().withdraw()
80788083 self.win.focus_force()
80798084 self.entries[0].entryctrl.focus()
8085+ status.dialog_canceled = False
80808086 self.win.wait_window(self.win)
80818087 return (self.button_value, self.entries)
80828088
diff -r 4190a6070f1e -r c13ded0ca50b setup.py
--- a/setup.py Mon Jan 03 12:47:47 2022 -0800
+++ b/setup.py Sat Jan 08 06:37:54 2022 -0800
@@ -5,7 +5,7 @@
55 long_description = f.read()
66
77 setuptools.setup(name='execsql',
8- version='1.96.0',
8+ version='1.96.1',
99 description="Runs a SQL script against a PostgreSQL, MS-Access, SQLite, MS-SQL-Server, MySQL, MariaDB, Firebird, or Oracle database, or an ODBC DSN. Provides metacommands to import and export data, copy data between databases, conditionally execute SQL and metacommands, and dynamically alter SQL and metacommands with substitution variables. Data can be exported in 18 different formats, including CSV, TSV, ODS, HTML, JSON, LaTeX, and Markdown tables, and using custom templates.",
1010 author='Dreas Nielsen',
1111 author_email='dreas.nielsen@gmail.com',
Afficher sur ancien navigateur de dépôt.