• R/O
  • SSH

execsql: Commit

Default repository for execsql.py


Commit MetaInfo

Révision95f00bc30c204cbcd3ee5efbc87b46bdc8cfe57e (tree)
l'heure2022-02-23 12:34:46
Auteurrdnielsen
Commiterrdnielsen

Message de Log

Modified ODS output so that body cells are aligned to the top.

Change Summary

Modification

diff -r fa3782be260c -r 95f00bc30c20 execsql/execsql.py
--- a/execsql/execsql.py Sun Feb 20 16:33:36 2022 -0800
+++ b/execsql/execsql.py Tue Feb 22 19:34:46 2022 -0800
@@ -28,7 +28,7 @@
2828 # ===============================================================================
2929
3030 __version__ = "1.100.1"
31-__vdate = "2022-02-20"
31+__vdate = "2022-02-22"
3232
3333 primary_vno = 1
3434 secondary_vno = 100
@@ -1420,11 +1420,19 @@
14201420 pass
14211421 else:
14221422 self.wbk = odf.opendocument.OpenDocumentSpreadsheet()
1423+ def define_body_style(self):
1424+ st_name = "body"
1425+ if not st_name in self.cell_style_names:
1426+ body_style = odf.style.Style(name=st_name, family="table-cell")
1427+ body_style.addElement(odf.style.TableCellProperties(attributes={"verticalalign":"top"}))
1428+ self.wbk.styles.addElement(body_style)
1429+ self.cell_style_names.append(st_name)
14231430 def define_header_style(self):
14241431 st_name = "header"
14251432 if not st_name in self.cell_style_names:
14261433 header_style = odf.style.Style(name=st_name, family="table-cell")
1427- header_style.addElement(odf.style.TableCellProperties(attributes={"borderbottom":"1px solid #000000"}))
1434+ header_style.addElement(odf.style.TableCellProperties(attributes={"borderbottom":"1pt solid #000000",
1435+ "verticalalign":"bottom"}))
14281436 self.wbk.styles.addElement(header_style)
14291437 self.cell_style_names.append(st_name)
14301438 def define_iso_datetime_style(self):
@@ -1446,7 +1454,8 @@
14461454 dt_style.addElement(odf.number.Text(text=u":"))
14471455 dt_style.addElement(odf.number.Seconds(style="long", decimalplaces="3"))
14481456 self.wbk.styles.addElement(dt_style)
1449- dts = odf.style.Style(name=st_name, datastylename="iso-datetime", parentstylename="Default", family="table-cell")
1457+ self.define_body_style()
1458+ dts = odf.style.Style(name=st_name, datastylename="iso-datetime", parentstylename="body", family="table-cell")
14501459 self.wbk.automaticstyles.addElement(dts)
14511460 self.cell_style_names.append(st_name)
14521461 def define_iso_date_style(self):
@@ -1459,7 +1468,8 @@
14591468 dt_style.addElement(odf.number.Text(text=u"-"))
14601469 dt_style.addElement(odf.number.Day(style="long"))
14611470 self.wbk.styles.addElement(dt_style)
1462- dts = odf.style.Style(name=st_name, datastylename="iso-date", parentstylename="Default", family="table-cell")
1471+ self.define_body_style()
1472+ dts = odf.style.Style(name=st_name, datastylename="iso-date", parentstylename="body", family="table-cell")
14631473 self.wbk.automaticstyles.addElement(dts)
14641474 self.cell_style_names.append(st_name)
14651475 def sheetnames(self):
@@ -1525,7 +1535,8 @@
15251535 self.define_header_style()
15261536 style_name = "header"
15271537 else:
1528- style_name = "Default"
1538+ self.define_body_style()
1539+ style_name = "body"
15291540 tr = odf.table.TableRow()
15301541 odf_table.addElement(tr)
15311542 for item in datarow:
diff -r fa3782be260c -r 95f00bc30c20 setup.py
--- a/setup.py Sun Feb 20 16:33:36 2022 -0800
+++ b/setup.py Tue Feb 22 19:34:46 2022 -0800
@@ -5,7 +5,7 @@
55 long_description = f.read()
66
77 setuptools.setup(name='execsql',
8- version='1.100.0',
8+ version='1.100.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.