リビジョン | 8d8959f8ef8d4cb65fef71dd34e986eefb7aed03 (tree) |
---|---|
日時 | 2023-04-19 12:06:09 |
作者 | rdnielsen |
コミッター | rdnielsen |
Fixed description handling when exporting multiple tables to ODS at once.
@@ -27,12 +27,12 @@ | ||
27 | 27 | # |
28 | 28 | # =============================================================================== |
29 | 29 | |
30 | -__version__ = "1.115.2" | |
31 | -__vdate = "2023-04-07" | |
30 | +__version__ = "1.115.3" | |
31 | +__vdate = "2023-04-18" | |
32 | 32 | |
33 | 33 | primary_vno = 1 |
34 | 34 | secondary_vno = 115 |
35 | -tertiary_vno = 2 | |
35 | +tertiary_vno = 3 | |
36 | 36 | |
37 | 37 | import os |
38 | 38 | import os.path |
@@ -13767,8 +13767,9 @@ | ||
13767 | 13767 | |
13768 | 13768 | def write_queries_to_ods(table_list, db, outfile, append=False, tee=False, desc=None): |
13769 | 13769 | tables = [t.strip() for t in table_list.split(",")] |
13770 | - descriptions = [d.strip() for d in desc.split(",")] | |
13771 | - one_desc = len(descriptions) != len(tables) | |
13770 | + if desc is not None: | |
13771 | + descriptions = [d.strip() for d in desc.split(",")] | |
13772 | + one_desc = len(descriptions) != len(tables) | |
13772 | 13773 | if os.path.isfile(outfile) and not append: |
13773 | 13774 | os.unlink(outfile) |
13774 | 13775 | wbk = OdsFile() |
@@ -13815,10 +13816,13 @@ | ||
13815 | 13816 | # Add sheet to workbook |
13816 | 13817 | wbk.add_sheet(tbl) |
13817 | 13818 | # Add information to the "Datasheets" sheet. |
13818 | - if one_desc: | |
13819 | - d = desc | |
13820 | - else: | |
13821 | - d = descriptions[i] | |
13819 | + if desc is None: | |
13820 | + d = None | |
13821 | + else: | |
13822 | + if one_desc: | |
13823 | + d = desc | |
13824 | + else: | |
13825 | + d = descriptions[i] | |
13822 | 13826 | datasheetlist = wbk.sheet_named(inventory_name) |
13823 | 13827 | if datasheetlist: |
13824 | 13828 | script, lno = current_script_line() |
@@ -5,7 +5,7 @@ | ||
5 | 5 | long_description = f.read() |
6 | 6 | |
7 | 7 | setuptools.setup(name='execsql', |
8 | - version='1.115.2', | |
8 | + version='1.115.3', | |
9 | 9 | 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.", |
10 | 10 | author='Dreas Nielsen', |
11 | 11 | author_email='dreas.nielsen@gmail.com', |