From 0a8b4a7e38d1c11c782d9970368a066892bdc51e Mon Sep 17 00:00:00 2001 From: drfho Date: Mon, 13 Jul 2020 14:22:38 +0200 Subject: [PATCH 1/6] Renewed ZMI --- Products/ZMySQLDA/__init__.py | 4 +- Products/ZMySQLDA/www/bin.svg | 6 + Products/ZMySQLDA/www/browse.dtml | 18 +- Products/ZMySQLDA/www/connectionAdd.dtml | 348 +++++++++++----------- Products/ZMySQLDA/www/connectionEdit.dtml | 337 +++++++++++---------- Products/ZMySQLDA/www/da.svg | 4 + Products/ZMySQLDA/www/date.svg | 4 + Products/ZMySQLDA/www/datetime.svg | 4 + Products/ZMySQLDA/www/field.svg | 7 + Products/ZMySQLDA/www/float.svg | 7 + Products/ZMySQLDA/www/int.svg | 6 + Products/ZMySQLDA/www/stable.svg | 4 + Products/ZMySQLDA/www/table.svg | 4 + Products/ZMySQLDA/www/text.svg | 6 + Products/ZMySQLDA/www/time.svg | 4 + Products/ZMySQLDA/www/view.svg | 4 + Products/ZMySQLDA/www/what.svg | 5 + 17 files changed, 434 insertions(+), 338 deletions(-) create mode 100644 Products/ZMySQLDA/www/bin.svg create mode 100644 Products/ZMySQLDA/www/da.svg create mode 100644 Products/ZMySQLDA/www/date.svg create mode 100644 Products/ZMySQLDA/www/datetime.svg create mode 100644 Products/ZMySQLDA/www/field.svg create mode 100644 Products/ZMySQLDA/www/float.svg create mode 100644 Products/ZMySQLDA/www/int.svg create mode 100644 Products/ZMySQLDA/www/stable.svg create mode 100644 Products/ZMySQLDA/www/table.svg create mode 100644 Products/ZMySQLDA/www/text.svg create mode 100644 Products/ZMySQLDA/www/time.svg create mode 100644 Products/ZMySQLDA/www/view.svg create mode 100644 Products/ZMySQLDA/www/what.svg diff --git a/Products/ZMySQLDA/__init__.py b/Products/ZMySQLDA/__init__.py index f9049d2..522162a 100644 --- a/Products/ZMySQLDA/__init__.py +++ b/Products/ZMySQLDA/__init__.py @@ -25,10 +25,10 @@ def initialize(context): permission=add_zmysql_database_connections, constructors=(DA.manage_addZMySQLConnectionForm, DA.manage_addZMySQLConnection), - icon='www/da.gif') + icon='www/da.svg') misc_ = {} for icon in ('table', 'view', 'stable', 'what', 'field', 'text', 'bin', 'int', 'float', 'date', 'time', 'datetime'): - misc_[icon] = ImageFile(os.path.join('www', '%s.gif') % icon, globals()) + misc_[icon] = ImageFile(os.path.join('www', '%s.svg') % icon, globals()) diff --git a/Products/ZMySQLDA/www/bin.svg b/Products/ZMySQLDA/www/bin.svg new file mode 100644 index 0000000..39597fc --- /dev/null +++ b/Products/ZMySQLDA/www/bin.svg @@ -0,0 +1,6 @@ + + diff --git a/Products/ZMySQLDA/www/browse.dtml b/Products/ZMySQLDA/www/browse.dtml index 08f643a..0102167 100644 --- a/Products/ZMySQLDA/www/browse.dtml +++ b/Products/ZMySQLDA/www/browse.dtml @@ -1,17 +1,23 @@ - +
- - &dtml-type; - () - + + &dtml-type; +    +
+ + diff --git a/Products/ZMySQLDA/www/connectionAdd.dtml b/Products/ZMySQLDA/www/connectionAdd.dtml index 6fb91c9..f7d5bb6 100644 --- a/Products/ZMySQLDA/www/connectionAdd.dtml +++ b/Products/ZMySQLDA/www/connectionAdd.dtml @@ -2,175 +2,185 @@
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Id - -
Title - -
- Database Connection String - 1 - -
Connect immediately - - Open the database connection after instantiation. -
Unicode results - - Should database query results be decoded to Unicode? -
- Character set 2 - - -
Automatically create database - - - Create database from connection string if it does not exist yet. - -
- Connect timeout - - - in seconds -

-
- -
1 Connection Strings
-
-

- The connection string used for Z MySQL Database Connection - is of the form: -

-          [*lock] [+/-][database][@host[:port]] [user [password [unix_socket]]]
-      
- or typically: -
-          database user password
-      
- to use a MySQL server on localhost via the standard UNIX socket. - Only specify host if the server is on a remote system. You can - use a non-standard port, if necessary. Hint: To use a non-standard - port on the local system, use 127.0.0.1 for the host instead of - localhost. -

-

- Either a database or a host or both must be specified. - If the UNIX socket is in a non-standard location, you can specify - the full path to it after the password. -

-

- A '-' in front of the database tells ZMySQLDA to not use Zope's - Transaction Manager, even if the server supports transactions. A - '+' in front of the database tells ZMySQLDA that it must use - transactions; an exception will be raised if they are not - supported by the server. If neither '-' or '+' are present, then - transactions will be enabled if the server supports them. If you - are using non-transaction safe tables (TSTs) on a server that - supports TSTs, use '-'. If you require transactions, use '+'. If - you aren't sure, don't use either. -

-

- *lock at the begining of the connection string means to - pseudo-transactional. When the transaction begins, it will acquire - a lock on the server named lock (i.e. MYLOCK). When the - transaction commits, the lock will be released. If the transaction - is aborted and restarted, which can happen due to a ConflictError, - you'll get an error in the logs, and inconsistent data. In this - respect, it's equivalent to transactions turned off. -

-

- Transactions are highly recommended. Using a named lock in - conjunctions with transactions is probably pointless. -

-
- -
2 Character set
-
-

- The character set the database adapter will use to communicate with - the database. You should choose a character set matching the Zope - application character set, which defaulted to Latin-1 for - Zope 2 and now defaults to UTF-8 for Zope 4. -

- -

- The database will expect all incoming - data to be encoded in this character set, and query results from the - database will be encoded in the same character set unless you check - Unicode results. -

- -

- Not set will emulate previous releases' behavior on Python 2, which - used Latin-1 (ISO 8859-1), but if Unicode results is selected, the - connection character set switches to UTF-8 and strings in query results - are decoded to Unicode. On Python 3, Not set always defaults to - UTF-8. -

- -

- For Python 2, you can force the character set to Latin-1 or UTF-8, - regardless of the Unicode results setting. This is useful - when your application wants to use UTF-8, but cannot deal with unicode - return values. -

- -

- Python 3 only supports the UTF-8 options! -

- -
+ + +
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Open the database connection after instantiation. +
+
+ +
+ +
+ + Should database query results be decoded to Unicode? +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Create database from connection string if it does not exist yet. +
+
+ +
+ +
+ + in seconds +
+
+ +
+ +
+
+ +
+ +
+
1 + Database Connection String +
+
+ The connection string used for Z MySQL Database Connection is of the form: +
+ [*lock] [+/-][database][@host[:port]] [user [password [unix_socket]]] +
+ or typically: +
+ database user password +
+ to use a MySQL server on localhost via the standard UNIX socket. + Only specify host if the server is on a remote system. You can + use a non-standard port, if necessary. Hint: To use a non-standard + port on the local system, use 127.0.0.1 for the host instead of + localhost. +
+
+ Either a database or a host or both must be specified. + If the UNIX socket is in a non-standard location, you can specify + the full path to it after the password. +
+
+ A '-' in front of the database tells ZMySQLDA to not use Zope's + Transaction Manager, even if the server supports transactions. A + '+' in front of the database tells ZMySQLDA that it must use + transactions; an exception will be raised if they are not + supported by the server. If neither '-' or '+' are present, then + transactions will be enabled if the server supports them. If you + are using non-transaction safe tables (TSTs) on a server that + supports TSTs, use '-'. If you require transactions, use '+'. If + you aren't sure, don't use either. +
+
+ *lock at the begining of the connection string means to + pseudo-transactional. When the transaction begins, it will acquire + a lock on the server named lock (i.e. MYLOCK). When the + transaction commits, the lock will be released. If the transaction + is aborted and restarted, which can happen due to a ConflictError, + you'll get an error in the logs, and inconsistent data. In this + respect, it's equivalent to transactions turned off. +
+
+ Transactions are highly recommended. Using a named lock in + conjunctions with transactions is probably pointless. +
+ +
2 + Connection character set +
+
+ The character set the database adapter will use to communicate with + the database. You should choose a character set matching the Zope + application character set, which defaulted to Latin-1 for + Zope 2 and now defaults to UTF-8 for Zope 4. +
+
+ The database will expect all incoming data to be encoded in this + character set, and query results from the database will be encoded + in the same character set unless you check Unicode results. +
+
+ Not set will emulate previous releases' behavior on Python 2, + which used Latin-1 (ISO 8859-1), but if Unicode results is + selected, the connection character set switches to UTF-8 and strings in + query results are decoded to Unicode. On Python 3, Not set + always defaults to UTF-8. +
+
+ For Python 2, you can force the character set to Latin-1 or UTF-8, + regardless of the Unicode results setting. This is useful + when your application wants to use UTF-8, but cannot deal with unicode + return values. +
+
+ Hint: Python 3 only supports the UTF-8 options! +
+
diff --git a/Products/ZMySQLDA/www/connectionEdit.dtml b/Products/ZMySQLDA/www/connectionEdit.dtml index cc0f64c..eb12a31 100644 --- a/Products/ZMySQLDA/www/connectionEdit.dtml +++ b/Products/ZMySQLDA/www/connectionEdit.dtml @@ -1,169 +1,184 @@ +
- - - - - - -
- The database connection is - - OPEN - - CLOSED - . -   - -
- -
- -
- -
-
-
- -

Edit

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Id
Title - -
- Database Connection String 1 - - -
Connect immediately - -
Unicode results - - - -
- Connection character set 2 - - -
Automatically create database - - - -
- Connect timeout - - - - - in seconds -

-
- -
1 Database Connection String
-
-

- Information about how to format the connection string can be found - in the - documentation. -

-
- -
2 Connection character set
-
-

- The character set the database adapter will use to communicate with - the database. You should choose a character set matching the Zope - application character set, which defaulted to Latin-1 for - Zope 2 and now defaults to UTF-8 for Zope 4. -

- -

- The database will expect all incoming - data to be encoded in this character set, and query results from the - database will be encoded in the same character set unless you check - Unicode results. -

- -

- Not set will emulate previous releases' behavior on Python 2, which - used Latin-1 (ISO 8859-1), but if Unicode results is selected, the - connection character set switches to UTF-8 and strings in query results - are decoded to Unicode. On Python 3, Not set always defaults to - UTF-8. -

- -

- For Python 2, you can force the character set to Latin-1 or UTF-8, - regardless of the Unicode results setting. This is useful - when your application wants to use UTF-8, but cannot deal with unicode - return values. -

- -

- Python 3 only supports the UTF-8 options! -

- -
+
+ +
+
+ + +
+ +
+ +
+ +
+
+
+
+
+ + + +
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ + + + in seconds +
+
+ +
+ +
+ +
+ +
+ +
+
1 + Database Connection String +
+
+ Information about how to format the connection string can be found + in the + documentation. +
+ +
2 + Connection character set +
+
+ The character set the database adapter will use to communicate with + the database. You should choose a character set matching the Zope + application character set, which defaulted to Latin-1 for + Zope 2 and now defaults to UTF-8 for Zope 4. +
+
+ The database will expect all incoming data to be encoded in this + character set, and query results from the database will be encoded + in the same character set unless you check Unicode results. +
+
+ Not set will emulate previous releases' behavior on Python 2, + which used Latin-1 (ISO 8859-1), but if Unicode results is + selected, the connection character set switches to UTF-8 and strings in + query results are decoded to Unicode. On Python 3, Not set + always defaults to UTF-8. +
+
+ For Python 2, you can force the character set to Latin-1 or UTF-8, + regardless of the Unicode results setting. This is useful + when your application wants to use UTF-8, but cannot deal with unicode + return values. +
+
+ Hint: Python 3 only supports the UTF-8 options! +
+
diff --git a/Products/ZMySQLDA/www/da.svg b/Products/ZMySQLDA/www/da.svg new file mode 100644 index 0000000..39cf609 --- /dev/null +++ b/Products/ZMySQLDA/www/da.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/date.svg b/Products/ZMySQLDA/www/date.svg new file mode 100644 index 0000000..cb9de08 --- /dev/null +++ b/Products/ZMySQLDA/www/date.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/datetime.svg b/Products/ZMySQLDA/www/datetime.svg new file mode 100644 index 0000000..0cccae5 --- /dev/null +++ b/Products/ZMySQLDA/www/datetime.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/field.svg b/Products/ZMySQLDA/www/field.svg new file mode 100644 index 0000000..84cf164 --- /dev/null +++ b/Products/ZMySQLDA/www/field.svg @@ -0,0 +1,7 @@ + + diff --git a/Products/ZMySQLDA/www/float.svg b/Products/ZMySQLDA/www/float.svg new file mode 100644 index 0000000..69cb454 --- /dev/null +++ b/Products/ZMySQLDA/www/float.svg @@ -0,0 +1,7 @@ + + diff --git a/Products/ZMySQLDA/www/int.svg b/Products/ZMySQLDA/www/int.svg new file mode 100644 index 0000000..3442365 --- /dev/null +++ b/Products/ZMySQLDA/www/int.svg @@ -0,0 +1,6 @@ + + diff --git a/Products/ZMySQLDA/www/stable.svg b/Products/ZMySQLDA/www/stable.svg new file mode 100644 index 0000000..509bc44 --- /dev/null +++ b/Products/ZMySQLDA/www/stable.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/table.svg b/Products/ZMySQLDA/www/table.svg new file mode 100644 index 0000000..eb20594 --- /dev/null +++ b/Products/ZMySQLDA/www/table.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/text.svg b/Products/ZMySQLDA/www/text.svg new file mode 100644 index 0000000..6af3f3b --- /dev/null +++ b/Products/ZMySQLDA/www/text.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/Products/ZMySQLDA/www/time.svg b/Products/ZMySQLDA/www/time.svg new file mode 100644 index 0000000..05e4dca --- /dev/null +++ b/Products/ZMySQLDA/www/time.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/view.svg b/Products/ZMySQLDA/www/view.svg new file mode 100644 index 0000000..9e4efba --- /dev/null +++ b/Products/ZMySQLDA/www/view.svg @@ -0,0 +1,4 @@ + + \ No newline at end of file diff --git a/Products/ZMySQLDA/www/what.svg b/Products/ZMySQLDA/www/what.svg new file mode 100644 index 0000000..c4922d8 --- /dev/null +++ b/Products/ZMySQLDA/www/what.svg @@ -0,0 +1,5 @@ + + From 93153303263ee36aa1fc4c9c69559aac18dd4988 Mon Sep 17 00:00:00 2001 From: drfho Date: Mon, 13 Jul 2020 16:26:21 +0200 Subject: [PATCH 2/6] replaced formatting (tab vs space), --- Products/ZMySQLDA/www/browse.dtml | 13 +- Products/ZMySQLDA/www/connectionAdd.dtml | 340 +++++++++++----------- Products/ZMySQLDA/www/connectionEdit.dtml | 322 ++++++++++---------- 3 files changed, 337 insertions(+), 338 deletions(-) diff --git a/Products/ZMySQLDA/www/browse.dtml b/Products/ZMySQLDA/www/browse.dtml index 0102167..11125ad 100644 --- a/Products/ZMySQLDA/www/browse.dtml +++ b/Products/ZMySQLDA/www/browse.dtml @@ -1,23 +1,22 @@ - +
- &dtml-type; -    + &dtml-type; +   
diff --git a/Products/ZMySQLDA/www/connectionAdd.dtml b/Products/ZMySQLDA/www/connectionAdd.dtml index f7d5bb6..cbaf22e 100644 --- a/Products/ZMySQLDA/www/connectionAdd.dtml +++ b/Products/ZMySQLDA/www/connectionAdd.dtml @@ -5,181 +5,181 @@
-
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- - Open the database connection after instantiation. -
-
- -
- -
- - Should database query results be decoded to Unicode? -
-
- -
- -
- -
-
- -
- -
- - Create database from connection string if it does not exist yet. -
-
- -
- -
- - in seconds -
-
- -
- -
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Open the database connection after instantiation. +
+
+ +
+ +
+ + Should database query results be decoded to Unicode? +
+
+ +
+ +
+ +
+
+ +
+ +
+ + Create database from connection string if it does not exist yet. +
+
+ +
+ +
+ + in seconds +
+
+ +
+ +

-
1 - Database Connection String -
-
- The connection string used for Z MySQL Database Connection is of the form: -
- [*lock] [+/-][database][@host[:port]] [user [password [unix_socket]]] -
- or typically: -
- database user password -
- to use a MySQL server on localhost via the standard UNIX socket. - Only specify host if the server is on a remote system. You can - use a non-standard port, if necessary. Hint: To use a non-standard - port on the local system, use 127.0.0.1 for the host instead of - localhost. -
-
- Either a database or a host or both must be specified. - If the UNIX socket is in a non-standard location, you can specify - the full path to it after the password. -
-
- A '-' in front of the database tells ZMySQLDA to not use Zope's - Transaction Manager, even if the server supports transactions. A - '+' in front of the database tells ZMySQLDA that it must use - transactions; an exception will be raised if they are not - supported by the server. If neither '-' or '+' are present, then - transactions will be enabled if the server supports them. If you - are using non-transaction safe tables (TSTs) on a server that - supports TSTs, use '-'. If you require transactions, use '+'. If - you aren't sure, don't use either. -
-
- *lock at the begining of the connection string means to - pseudo-transactional. When the transaction begins, it will acquire - a lock on the server named lock (i.e. MYLOCK). When the - transaction commits, the lock will be released. If the transaction - is aborted and restarted, which can happen due to a ConflictError, - you'll get an error in the logs, and inconsistent data. In this - respect, it's equivalent to transactions turned off. -
-
- Transactions are highly recommended. Using a named lock in - conjunctions with transactions is probably pointless. -
- -
2 - Connection character set -
-
- The character set the database adapter will use to communicate with - the database. You should choose a character set matching the Zope - application character set, which defaulted to Latin-1 for - Zope 2 and now defaults to UTF-8 for Zope 4. -
-
- The database will expect all incoming data to be encoded in this - character set, and query results from the database will be encoded - in the same character set unless you check Unicode results. -
-
- Not set will emulate previous releases' behavior on Python 2, - which used Latin-1 (ISO 8859-1), but if Unicode results is - selected, the connection character set switches to UTF-8 and strings in - query results are decoded to Unicode. On Python 3, Not set - always defaults to UTF-8. -
-
- For Python 2, you can force the character set to Latin-1 or UTF-8, - regardless of the Unicode results setting. This is useful - when your application wants to use UTF-8, but cannot deal with unicode - return values. -
-
- Hint: Python 3 only supports the UTF-8 options! -
+
1 + Database Connection String +
+
+ The connection string used for Z MySQL Database Connection is of the form: +
+ [*lock] [+/-][database][@host[:port]] [user [password [unix_socket]]] +
+ or typically: +
+ database user password +
+ to use a MySQL server on localhost via the standard UNIX socket. + Only specify host if the server is on a remote system. You can + use a non-standard port, if necessary. Hint: To use a non-standard + port on the local system, use 127.0.0.1 for the host instead of + localhost. +
+
+ Either a database or a host or both must be specified. + If the UNIX socket is in a non-standard location, you can specify + the full path to it after the password. +
+
+ A '-' in front of the database tells ZMySQLDA to not use Zope's + Transaction Manager, even if the server supports transactions. A + '+' in front of the database tells ZMySQLDA that it must use + transactions; an exception will be raised if they are not + supported by the server. If neither '-' or '+' are present, then + transactions will be enabled if the server supports them. If you + are using non-transaction safe tables (TSTs) on a server that + supports TSTs, use '-'. If you require transactions, use '+'. If + you aren't sure, don't use either. +
+
+ *lock at the begining of the connection string means to + pseudo-transactional. When the transaction begins, it will acquire + a lock on the server named lock (i.e. MYLOCK). When the + transaction commits, the lock will be released. If the transaction + is aborted and restarted, which can happen due to a ConflictError, + you'll get an error in the logs, and inconsistent data. In this + respect, it's equivalent to transactions turned off. +
+
+ Transactions are highly recommended. Using a named lock in + conjunctions with transactions is probably pointless. +
+ +
2 + Connection character set +
+
+ The character set the database adapter will use to communicate with + the database. You should choose a character set matching the Zope + application character set, which defaulted to Latin-1 for + Zope 2 and now defaults to UTF-8 for Zope 4. +
+
+ The database will expect all incoming data to be encoded in this + character set, and query results from the database will be encoded + in the same character set unless you check Unicode results. +
+
+ Not set will emulate previous releases' behavior on Python 2, + which used Latin-1 (ISO 8859-1), but if Unicode results is + selected, the connection character set switches to UTF-8 and strings in + query results are decoded to Unicode. On Python 3, Not set + always defaults to UTF-8. +
+
+ For Python 2, you can force the character set to Latin-1 or UTF-8, + regardless of the Unicode results setting. This is useful + when your application wants to use UTF-8, but cannot deal with unicode + return values. +
+
+ Hint: Python 3 only supports the UTF-8 options! +
diff --git a/Products/ZMySQLDA/www/connectionEdit.dtml b/Products/ZMySQLDA/www/connectionEdit.dtml index eb12a31..46f1a3e 100644 --- a/Products/ZMySQLDA/www/connectionEdit.dtml +++ b/Products/ZMySQLDA/www/connectionEdit.dtml @@ -5,179 +5,179 @@
- -
-
- - -
- -
- -
- -
-
-
-
+ +
+
+ + +
+ +
+ +
+ +
+
+
+
-
- -
- -
-
- -
- -
- -
-
- - -
- -
- -
-
- -
- -
- -
-
- -
- -
- - - -
-
- -
- -
- -
-
- -
- -
- - - -
-
- -
- -
- - - - in seconds -
-
- -
- -
+
+ +
+ +
+
+ +
+ +
+ +
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ +
+
+ +
+ +
+ + + +
+
+ +
+ +
+ + + + in seconds +
+
+ +
+ +

-
1 - Database Connection String -
-
- Information about how to format the connection string can be found - in the - documentation. -
- -
2 - Connection character set -
-
- The character set the database adapter will use to communicate with - the database. You should choose a character set matching the Zope - application character set, which defaulted to Latin-1 for - Zope 2 and now defaults to UTF-8 for Zope 4. -
-
- The database will expect all incoming data to be encoded in this - character set, and query results from the database will be encoded - in the same character set unless you check Unicode results. -
-
- Not set will emulate previous releases' behavior on Python 2, - which used Latin-1 (ISO 8859-1), but if Unicode results is - selected, the connection character set switches to UTF-8 and strings in - query results are decoded to Unicode. On Python 3, Not set - always defaults to UTF-8. -
-
- For Python 2, you can force the character set to Latin-1 or UTF-8, - regardless of the Unicode results setting. This is useful - when your application wants to use UTF-8, but cannot deal with unicode - return values. -
-
- Hint: Python 3 only supports the UTF-8 options! -
+
1 + Database Connection String +
+
+ Information about how to format the connection string can be found + in the + documentation. +
+ +
2 + Connection character set +
+
+ The character set the database adapter will use to communicate with + the database. You should choose a character set matching the Zope + application character set, which defaulted to Latin-1 for + Zope 2 and now defaults to UTF-8 for Zope 4. +
+
+ The database will expect all incoming data to be encoded in this + character set, and query results from the database will be encoded + in the same character set unless you check Unicode results. +
+
+ Not set will emulate previous releases' behavior on Python 2, + which used Latin-1 (ISO 8859-1), but if Unicode results is + selected, the connection character set switches to UTF-8 and strings in + query results are decoded to Unicode. On Python 3, Not set + always defaults to UTF-8. +
+
+ For Python 2, you can force the character set to Latin-1 or UTF-8, + regardless of the Unicode results setting. This is useful + when your application wants to use UTF-8, but cannot deal with unicode + return values. +
+
+ Hint: Python 3 only supports the UTF-8 options! +
From 31efb130b67baff9fa83c6e23059116f9f80d25d Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Mon, 13 Jul 2020 17:53:30 +0200 Subject: [PATCH 3/6] - fix linter and apply lint fixes --- Products/ZMySQLDA/tests/base.py | 1 + Products/ZMySQLDA/tests/test_db.py | 4 ++-- buildout.cfg | 7 ------- setup.cfg | 2 -- tox.ini | 7 +++---- 5 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Products/ZMySQLDA/tests/base.py b/Products/ZMySQLDA/tests/base.py index 8d5a632..2e5b5da 100644 --- a/Products/ZMySQLDA/tests/base.py +++ b/Products/ZMySQLDA/tests/base.py @@ -98,6 +98,7 @@ def setUp(cls): @classmethod def testSetUp(cls): from Products.ZMySQLDA import DA + # Clean out the test table before every test if have_test_database(): dbconn = real_connect() diff --git a/Products/ZMySQLDA/tests/test_db.py b/Products/ZMySQLDA/tests/test_db.py index 7770d50..66a978f 100644 --- a/Products/ZMySQLDA/tests/test_db.py +++ b/Products/ZMySQLDA/tests/test_db.py @@ -45,8 +45,8 @@ def test_DateTime_or_None(self): class DBPoolTests(unittest.TestCase): def _makeOne(self, *args, **kw): - from Products.ZMySQLDA.db import DBPool from Products.ZMySQLDA.db import DB + from Products.ZMySQLDA.db import DBPool return DBPool(DB, **kw) def test_instantiate_defaults(self): @@ -111,8 +111,8 @@ def test_name(self): class PatchedDBPoolTests(PatchedConnectionTestsBase): def _makeOne(self, *args, **kw): - from Products.ZMySQLDA.db import DBPool from Products.ZMySQLDA.db import DB + from Products.ZMySQLDA.db import DBPool return DBPool(DB, **kw) def test_variables(self): diff --git a/buildout.cfg b/buildout.cfg index f7ce1bb..f30df14 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -6,7 +6,6 @@ develop = . parts = test docs - scripts [test] @@ -22,9 +21,3 @@ eggs = Products.ZMySQLDA[docs] scripts = sphinx-build - - -[scripts] -recipe = zc.recipe.egg -eggs = - tox diff --git a/setup.cfg b/setup.cfg index 84f84d2..f229756 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,8 +16,6 @@ known_zope = AccessControl, Acquisition, App, OFS, Products, Shared, Zope2 default_section = ZOPE line_length = 79 lines_after_imports = 2 -not_skip = - __init__.py [flake8] no-accept-encodings = True diff --git a/tox.ini b/tox.ini index c81e529..75d263f 100644 --- a/tox.ini +++ b/tox.ini @@ -53,9 +53,9 @@ basepython = python3.6 commands_pre = mkdir -p {toxinidir}/parts/flake8 commands = - isort --check-only --diff --recursive {toxinidir}/Products setup.py - - flake8 --format=html Products tests setup.py - flake8 Products tests setup.py + isort --check-only --diff {toxinidir}/Products setup.py + - flake8 --format=html Products setup.py + flake8 Products setup.py deps = isort flake8 @@ -66,7 +66,6 @@ deps = flake8-debugger flake8-deprecated flake8-todo - flake8-isort mccabe flake8-blind-except flake8-commas From ce157ee45b2a2ef2ad1078c65d15169bc6f1d6a4 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Mon, 13 Jul 2020 17:53:53 +0200 Subject: [PATCH 4/6] - small last fixes --- Products/ZMySQLDA/www/connectionEdit.dtml | 2 -- 1 file changed, 2 deletions(-) diff --git a/Products/ZMySQLDA/www/connectionEdit.dtml b/Products/ZMySQLDA/www/connectionEdit.dtml index 46f1a3e..2df6f45 100644 --- a/Products/ZMySQLDA/www/connectionEdit.dtml +++ b/Products/ZMySQLDA/www/connectionEdit.dtml @@ -31,7 +31,6 @@ -
@@ -54,7 +53,6 @@ -