This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "SQLObject development repository".
The branch, master has been updated
via ac1e0a9c90126523b6b4d4b82f5783eecb03d620 (commit)
via f62927aeba372c25cf8dd9fb62a3c8c664a42925 (commit)
via 9c300f1b0250618124bf539d4e616ba40b2a1cf4 (commit)
via e1f18e16930cf54fe782eee94be7fc4ea589bdba (commit)
via 253f4f987a212e578ee7f3ca89a0eb295fdc5c5a (commit)
via 67690eb2498a912b3836284653f0ae5e55011dff (commit)
via bd36a6b5eac5fe99a25cce859f42c50e18f941b4 (commit)
via 57eacb3965939a1742b87143e89cb94f50726874 (commit)
via 10b0670f7a03cbcbac8a5e095c67209ace16629c (commit)
from f950f4b028abde17e6b93dc6604a388923fdb26d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceforge.net/p/sqlobject/sqlobject/ci/ac1e0a9c90126523b6b4d4b82f5783eecb03d620
commit ac1e0a9c90126523b6b4d4b82f5783eecb03d620
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 1 02:40:54 2019 +0300
Style: Fix flake8 error E117 over-indented
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index db83eee..024b01c 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -39,14 +39,14 @@ class SQLiteConnection(DBAPI):
continue
try:
if driver in ('sqlite2', 'pysqlite2'):
- from pysqlite2 import dbapi2 as sqlite
- self.using_sqlite2 = True
+ from pysqlite2 import dbapi2 as sqlite
+ self.using_sqlite2 = True
elif driver == 'sqlite3':
- import sqlite3 as sqlite
- self.using_sqlite2 = True
+ import sqlite3 as sqlite
+ self.using_sqlite2 = True
elif driver in ('sqlite', 'sqlite1'):
- import sqlite
- self.using_sqlite2 = False
+ import sqlite
+ self.using_sqlite2 = False
else:
raise ValueError(
'Unknown SQLite driver "%s", '
diff --git a/sqlobject/tests/test_views.py b/sqlobject/tests/test_views.py
index 08f44ab..44ed045 100644
--- a/sqlobject/tests/test_views.py
+++ b/sqlobject/tests/test_views.py
@@ -97,7 +97,7 @@ def testAliasOverride():
def checkAttr(cls, id, attr, value):
- assert getattr(cls.get(id), attr) == value
+ assert getattr(cls.get(id), attr) == value
def testGetVPC():
http://sourceforge.net/p/sqlobject/sqlobject/ci/f62927aeba372c25cf8dd9fb62a3c8c664a42925
commit f62927aeba372c25cf8dd9fb62a3c8c664a42925
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 1 02:17:16 2019 +0300
Tests: Require pytest < 5.0 for Python 2.7
diff --git a/devscripts/requirements/requirements_tests.txt b/devscripts/requirements/requirements_tests.txt
index 8e890d8..ae7bbd9 100644
--- a/devscripts/requirements/requirements_tests.txt
+++ b/devscripts/requirements/requirements_tests.txt
@@ -1,4 +1,4 @@
-r requirements.txt
-pytest
+pytest < 5.0
pytest-cov
http://sourceforge.net/p/sqlobject/sqlobject/ci/9c300f1b0250618124bf539d4e616ba40b2a1cf4
commit 9c300f1b0250618124bf539d4e616ba40b2a1cf4
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 1 02:17:04 2019 +0300
Python 3.7
diff --git a/setup.py b/setup.py
index 0ebca65..8802c9f 100755
--- a/setup.py
+++ b/setup.py
@@ -49,6 +49,7 @@ and `GitHub <https://github.com/sqlobject>`_.
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries :: Python Modules",
http://sourceforge.net/p/sqlobject/sqlobject/ci/e1f18e16930cf54fe782eee94be7fc4ea589bdba
commit e1f18e16930cf54fe782eee94be7fc4ea589bdba
Author: Oleg Broytman <ph...@ph...>
Date: Fri Feb 1 02:02:27 2019 +0300
CI(AppVeyor): Work around a strange problem with Py3.7
Work around a very strange problem with Python 3.7 at AppVeyor
by copying correct validators.py to formencode.
diff --git a/setup.cfg b/setup.cfg
index 461bc50..af28274 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,7 +10,7 @@ tag_date = 0
tag_svn_revision = 0
[flake8]
-exclude = .git,.tox,docs/europython/*.py
+exclude = .git,.tox,docs/europython/*.py,validators.py
# E305: expected 2 blank lines after class or function definition, found 1
# W503 line break before binary operator
# W605 invalid escape sequence
diff --git a/tox.ini b/tox.ini
index 6786932..0af7ecb 100644
--- a/tox.ini
+++ b/tox.ini
@@ -36,6 +36,7 @@ passenv = CI TRAVIS TRAVIS_* APPVEYOR DISTUTILS_USE_SDK MSSdk INCLUDE LIB PGPASS
# Don't fail or warn on uninstalled commands
platform = linux
whitelist_externals =
+ cmd
mysql
createdb
dropdb
@@ -465,7 +466,9 @@ commands = {[mssql-pyodbc-w32]commands}
[testenv:py37-mssql-pyodbc-w32]
platform = win32
-commands = {[mssql-pyodbc-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[mssql-pyodbc-w32]commands}
[mysql-connector-w32]
platform = win32
@@ -494,7 +497,9 @@ commands = {[mysql-connector-w32]commands}
[testenv:py37-mysql-connector-w32]
platform = win32
-commands = {[mysql-connector-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[mysql-connector-w32]commands}
[pymysql-w32]
platform = win32
@@ -523,7 +528,9 @@ commands = {[pymysql-w32]commands}
[testenv:py37-pymysql-w32]
platform = win32
-commands = {[pymysql-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[pymysql-w32]commands}
[mysql-pyodbc-w32]
platform = win32
@@ -553,7 +560,9 @@ commands = {[mysql-pyodbc-w32]commands}
[testenv:py37-mysql-pyodbc-w32]
platform = win32
-commands = {[mysql-pyodbc-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[mysql-pyodbc-w32]commands}
[mysql-pypyodbc-w32]
platform = win32
@@ -583,7 +592,9 @@ commands = {[mysql-pypyodbc-w32]commands}
[testenv:py37-mysql-pypyodbc-w32]
platform = win32
-commands = {[mysql-pypyodbc-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[mysql-pypyodbc-w32]commands}
[psycopg-w32]
platform = win32
@@ -612,7 +623,9 @@ commands = {[psycopg-w32]commands}
[testenv:py37-postgres-psycopg-w32]
platform = win32
-commands = {[psycopg-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[psycopg-w32]commands}
[pygresql-w32]
platform = win32
@@ -641,7 +654,9 @@ commands = {[pygresql-w32]commands}
[testenv:py37-postgres-pygresql-w32]
platform = win32
-commands = {[pygresql-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[pygresql-w32]commands}
[pypostgresql-w32]
platform = win32
@@ -666,7 +681,9 @@ commands = {[pypostgresql-w32]commands}
[testenv:py37-pypostgresql-w32]
platform = win32
-commands = {[pypostgresql-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[pypostgresql-w32]commands}
[pg8000-w32]
platform = win32
@@ -695,7 +712,9 @@ commands = {[pg8000-w32]commands}
[testenv:py37-postgres-pg8000-w32]
platform = win32
-commands = {[pg8000-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[pg8000-w32]commands}
[postgres-pyodbc-w32]
platform = win32
@@ -725,7 +744,9 @@ commands = {[postgres-pyodbc-w32]commands}
[testenv:py37-postgres-pyodbc-w32]
platform = win32
-commands = {[postgres-pyodbc-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[postgres-pyodbc-w32]commands}
[postgres-pypyodbc-w32]
platform = win32
@@ -755,7 +776,9 @@ commands = {[postgres-pypyodbc-w32]commands}
[testenv:py37-postgres-pypyodbc-w32]
platform = win32
-commands = {[postgres-pypyodbc-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[postgres-pypyodbc-w32]commands}
[sqlite-w32]
platform = win32
@@ -781,7 +804,9 @@ commands = {[sqlite-w32]commands}
[testenv:py37-sqlite-w32]
platform = win32
-commands = {[sqlite-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[sqlite-w32]commands}
[sqlite-memory-w32]
platform = win32
@@ -807,4 +832,6 @@ commands = {[sqlite-memory-w32]commands}
[testenv:py37-sqlite-memory-w32]
platform = win32
-commands = {[sqlite-memory-w32]commands}
+commands =
+ cmd /c "copy ..\\validators.py {envsitepackagesdir}\\formencode\\validators.py"
+ {[sqlite-memory-w32]commands}
diff --git a/validators.py b/validators.py
new file mode 100644
index 0000000..233d5dd
--- /dev/null
+++ b/validators.py
@@ -0,0 +1,3089 @@
+## FormEncode, a Form processor
+## Copyright (C) 2003, Ian Bicking <ia...@co...>
+
+"""
+Validator/Converters for use with FormEncode.
+"""
+
+import cgi
+import locale
+import re
+import warnings
+from encodings import idna
+
+try: # import dnspython
+ import dns.resolver
+ import dns.exception
+except (IOError, ImportError):
+ have_dns = False
+else:
+ have_dns = True
+
+
+# These are only imported when needed
+httplib = None
+random = None
+sha1 = None
+socket = None
+urlparse = None
+
+from .api import (FancyValidator, Identity, Invalid, NoDefault, Validator,
+ deprecation_warning, is_empty)
+
+assert Identity and Invalid and NoDefault # silence unused import warnings
+
+# Dummy i18n translation function, nothing is translated here.
+# Instead this is actually done in api.message.
+# The surrounding _('string') of the strings is only for extracting
+# the strings automatically.
+# If you run pygettext with this source comment this function out temporarily.
+_ = lambda s: s
+
+
+############################################################
+## Utility methods
+############################################################
+
+# These all deal with accepting both datetime and mxDateTime modules and types
+datetime_module = None
+mxDateTime_module = None
+
+
+def import_datetime(module_type):
+ global datetime_module, mxDateTime_module
+ module_type = module_type.lower() if module_type else 'datetime'
+ if module_type == 'datetime':
+ if datetime_module is None:
+ import datetime as datetime_module
+ return datetime_module
+ elif module_type == 'mxdatetime':
+ if mxDateTime_module is None:
+ from mx import DateTime as mxDateTime_module
+ return mxDateTime_module
+ else:
+ raise ImportError('Invalid datetime module %r' % module_type)
+
+
+def datetime_now(module):
+ if module.__name__ == 'datetime':
+ return module.datetime.now()
+ else:
+ return module.now()
+
+
+def datetime_makedate(module, year, month, day):
+ if module.__name__ == 'datetime':
+ return module.date(year, month, day)
+ else:
+ try:
+ return module.DateTime(year, month, day)
+ except module.RangeError as e:
+ raise ValueError(str(e))
+
+
+def datetime_time(module):
+ if module.__name__ == 'datetime':
+ return module.time
+ else:
+ return module.Time
+
+
+def datetime_isotime(module):
+ if module.__name__ == 'datetime':
+ return module.time.isoformat
+ else:
+ return module.ISO.Time
+
+
+############################################################
+## Wrapper Validators
+############################################################
+
+class ConfirmType(FancyValidator):
+ """
+ Confirms that the input/output is of the proper type.
+
+ Uses the parameters:
+
+ subclass:
+ The class or a tuple of classes; the item must be an instance
+ of the class or a subclass.
+ type:
+ A type or tuple of types (or classes); the item must be of
+ the exact class or type. Subclasses are not allowed.
+
+ Examples::
+
+ >>> cint = ConfirmType(subclass=int)
+ >>> cint.to_python(True)
+ True
+ >>> cint.to_python('1')
+ Traceback (most recent call last):
+ ...
+ Invalid: '1' is not a subclass of <type 'int'>
+ >>> cintfloat = ConfirmType(subclass=(float, int))
+ >>> cintfloat.to_python(1.0), cintfloat.from_python(1.0)
+ (1.0, 1.0)
+ >>> cintfloat.to_python(1), cintfloat.from_python(1)
+ (1, 1)
+ >>> cintfloat.to_python(None)
+ Traceback (most recent call last):
+ ...
+ Invalid: None is not a subclass of one of the types <type 'float'>, <type 'int'>
+ >>> cint2 = ConfirmType(type=int)
+ >>> cint2(accept_python=False).from_python(True)
+ Traceback (most recent call last):
+ ...
+ Invalid: True must be of the type <type 'int'>
+ """
+
+ accept_iterator = True
+
+ subclass = None
+ type = None
+
+ messages = dict(
+ subclass=_('%(object)r is not a subclass of %(subclass)s'),
+ inSubclass=_('%(object)r is not a subclass of one of the types %(subclassList)s'),
+ inType=_('%(object)r must be one of the types %(typeList)s'),
+ type=_('%(object)r must be of the type %(type)s'))
+
+ def __init__(self, *args, **kw):
+ FancyValidator.__init__(self, *args, **kw)
+ if self.subclass:
+ if isinstance(self.subclass, list):
+ self.subclass = tuple(self.subclass)
+ elif not isinstance(self.subclass, tuple):
+ self.subclass = (self.subclass,)
+ self._validate_python = self.confirm_subclass
+ if self.type:
+ if isinstance(self.type, list):
+ self.type = tuple(self.type)
+ elif not isinstance(self.type, tuple):
+ self.type = (self.type,)
+ self._validate_python = self.confirm_type
+
+ def confirm_subclass(self, value, state):
+ if not isinstance(value, self.subclass):
+ if len(self.subclass) == 1:
+ msg = self.message('subclass', state, object=value,
+ subclass=self.subclass[0])
+ else:
+ subclass_list = ', '.join(map(str, self.subclass))
+ msg = self.message('inSubclass', state, object=value,
+ subclassList=subclass_list)
+ raise Invalid(msg, value, state)
+
+ def confirm_type(self, value, state):
+ for t in self.type:
+ if type(value) is t:
+ break
+ else:
+ if len(self.type) == 1:
+ msg = self.message('type', state, object=value,
+ type=self.type[0])
+ else:
+ msg = self.message('inType', state, object=value,
+ typeList=', '.join(map(str, self.type)))
+ raise Invalid(msg, value, state)
+ return value
+
+ def is_empty(self, value):
+ return False
+
+
+class Wrapper(FancyValidator):
+ """
+ Used to convert functions to validator/converters.
+
+ You can give a simple function for `_convert_to_python`,
+ `_convert_from_python`, `_validate_python` or `_validate_other`.
+ If that function raises an exception, the value is considered invalid.
+ Whatever value the function returns is considered the converted value.
+
+ Unlike validators, the `state` argument is not used. Functions
+ like `int` can be used here, that take a single argument.
+
+ Note that as Wrapper will generate a FancyValidator, empty
+ values (those who pass ``FancyValidator.is_empty)`` will return ``None``.
+ To override this behavior you can use ``Wrapper(empty_value=callable)``.
+ For example passing ``Wrapper(empty_value=lambda val: val)`` will return
+ the value itself when is considered empty.
+
+ Examples::
+
+ >>> def downcase(v):
... 3341 lines suppressed ...
hooks/post-receive
--
SQLObject development repository
|