sqlobject-cvs Mailing List for SQLObject (Page 24)
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
(9) |
Apr
(74) |
May
(29) |
Jun
(16) |
Jul
(28) |
Aug
(10) |
Sep
(57) |
Oct
(9) |
Nov
(29) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(14) |
Mar
(6) |
Apr
(3) |
May
(12) |
Jun
(34) |
Jul
(9) |
Aug
(29) |
Sep
(22) |
Oct
(2) |
Nov
(15) |
Dec
(52) |
| 2005 |
Jan
(47) |
Feb
(78) |
Mar
(14) |
Apr
(35) |
May
(33) |
Jun
(16) |
Jul
(26) |
Aug
(63) |
Sep
(40) |
Oct
(96) |
Nov
(96) |
Dec
(123) |
| 2006 |
Jan
(159) |
Feb
(144) |
Mar
(64) |
Apr
(31) |
May
(88) |
Jun
(48) |
Jul
(16) |
Aug
(64) |
Sep
(87) |
Oct
(92) |
Nov
(56) |
Dec
(76) |
| 2007 |
Jan
(94) |
Feb
(103) |
Mar
(126) |
Apr
(123) |
May
(85) |
Jun
(11) |
Jul
(130) |
Aug
(47) |
Sep
(65) |
Oct
(70) |
Nov
(12) |
Dec
(11) |
| 2008 |
Jan
(30) |
Feb
(55) |
Mar
(88) |
Apr
(20) |
May
(50) |
Jun
|
Jul
(38) |
Aug
(1) |
Sep
(9) |
Oct
(5) |
Nov
(6) |
Dec
(39) |
| 2009 |
Jan
(8) |
Feb
(16) |
Mar
(3) |
Apr
(33) |
May
(44) |
Jun
(1) |
Jul
(10) |
Aug
(33) |
Sep
(74) |
Oct
(22) |
Nov
|
Dec
(15) |
| 2010 |
Jan
(28) |
Feb
(22) |
Mar
(46) |
Apr
(29) |
May
(1) |
Jun
(1) |
Jul
(27) |
Aug
(8) |
Sep
(5) |
Oct
(33) |
Nov
(24) |
Dec
(41) |
| 2011 |
Jan
(4) |
Feb
(12) |
Mar
(35) |
Apr
(29) |
May
(19) |
Jun
(16) |
Jul
(32) |
Aug
(25) |
Sep
(5) |
Oct
(11) |
Nov
(21) |
Dec
(12) |
| 2012 |
Jan
(3) |
Feb
(4) |
Mar
(20) |
Apr
(4) |
May
(25) |
Jun
(13) |
Jul
|
Aug
|
Sep
(2) |
Oct
(25) |
Nov
(9) |
Dec
(1) |
| 2013 |
Jan
(6) |
Feb
(8) |
Mar
|
Apr
(10) |
May
(31) |
Jun
(7) |
Jul
(18) |
Aug
(33) |
Sep
(4) |
Oct
(16) |
Nov
|
Dec
(27) |
| 2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
(11) |
May
(39) |
Jun
(8) |
Jul
(11) |
Aug
(4) |
Sep
|
Oct
(27) |
Nov
|
Dec
(71) |
| 2015 |
Jan
(17) |
Feb
(47) |
Mar
(33) |
Apr
|
May
|
Jun
(9) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(8) |
| 2016 |
Jan
(4) |
Feb
(4) |
Mar
|
Apr
|
May
(12) |
Jun
(7) |
Jul
(9) |
Aug
(31) |
Sep
(8) |
Oct
(3) |
Nov
(15) |
Dec
(1) |
| 2017 |
Jan
(13) |
Feb
(7) |
Mar
(14) |
Apr
(8) |
May
(10) |
Jun
(4) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(4) |
Dec
(5) |
| 2018 |
Jan
(2) |
Feb
(8) |
Mar
|
Apr
(4) |
May
|
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(16) |
Mar
(1) |
Apr
(3) |
May
(5) |
Jun
(1) |
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
(2) |
Nov
|
Dec
(2) |
| 2021 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(1) |
Nov
(1) |
Dec
(4) |
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(4) |
Dec
|
| 2024 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(9) |
| 2025 |
Jan
|
Feb
(4) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
|
From: <sub...@co...> - 2013-12-20 13:39:51
|
Author: phd Date: Fri Dec 20 06:39:42 2013 New Revision: 4689 Log: Upgrade ez_setup to 1.4.2 Added: SQLObject/trunk/ez_setup.py Modified: SQLObject/trunk/ (props changed) SQLObject/trunk/docs/News.txt SQLObject/trunk/docs/TODO.txt SQLObject/trunk/setup.py Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Fri Dec 20 06:08:43 2013 (r4688) +++ SQLObject/trunk/docs/News.txt Fri Dec 20 06:39:42 2013 (r4689) @@ -24,6 +24,8 @@ with microseconds cannot be read back with older versions of SQLObject. +* Upgrade ez_setup to 1.4.2. + SQLObject 1.5.1 =============== Modified: SQLObject/trunk/docs/TODO.txt ============================================================================== --- SQLObject/trunk/docs/TODO.txt Fri Dec 20 06:08:43 2013 (r4688) +++ SQLObject/trunk/docs/TODO.txt Fri Dec 20 06:39:42 2013 (r4689) @@ -1,8 +1,6 @@ TODO ---- -* Upgrade ez_setup to 1.4.2. - * RelatedJoin.hasOther(otherObject[.id]) * createParamsPre/Post:: Added: SQLObject/trunk/ez_setup.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ SQLObject/trunk/ez_setup.py Fri Dec 20 06:39:42 2013 (r4689) @@ -0,0 +1,382 @@ +#!python +"""Bootstrap setuptools installation + +If you want to use setuptools in your package's setup.py, just include this +file in the same directory with it, and add this to the top of your setup.py:: + + from ez_setup import use_setuptools + use_setuptools() + +If you want to require a specific version of setuptools, set a download +mirror, or use an alternate download directory, you can do so by supplying +the appropriate options to ``use_setuptools()``. + +This file can also be run as a script to install or upgrade setuptools. +""" +import os +import shutil +import sys +import tempfile +import tarfile +import optparse +import subprocess +import platform + +from distutils import log + +try: + from site import USER_SITE +except ImportError: + USER_SITE = None + +DEFAULT_VERSION = "1.4.2" +DEFAULT_URL = "https://pypi.python.org/packages/source/s/setuptools/" + +def _python_cmd(*args): + args = (sys.executable,) + args + return subprocess.call(args) == 0 + +def _check_call_py24(cmd, *args, **kwargs): + res = subprocess.call(cmd, *args, **kwargs) + class CalledProcessError(Exception): + pass + if not res == 0: + msg = "Command '%s' return non-zero exit status %d" % (cmd, res) + raise CalledProcessError(msg) +vars(subprocess).setdefault('check_call', _check_call_py24) + +def _install(tarball, install_args=()): + # extracting the tarball + tmpdir = tempfile.mkdtemp() + log.warn('Extracting in %s', tmpdir) + old_wd = os.getcwd() + try: + os.chdir(tmpdir) + tar = tarfile.open(tarball) + _extractall(tar) + tar.close() + + # going in the directory + subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) + os.chdir(subdir) + log.warn('Now working in %s', subdir) + + # installing + log.warn('Installing Setuptools') + if not _python_cmd('setup.py', 'install', *install_args): + log.warn('Something went wrong during the installation.') + log.warn('See the error message above.') + # exitcode will be 2 + return 2 + finally: + os.chdir(old_wd) + shutil.rmtree(tmpdir) + + +def _build_egg(egg, tarball, to_dir): + # extracting the tarball + tmpdir = tempfile.mkdtemp() + log.warn('Extracting in %s', tmpdir) + old_wd = os.getcwd() + try: + os.chdir(tmpdir) + tar = tarfile.open(tarball) + _extractall(tar) + tar.close() + + # going in the directory + subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0]) + os.chdir(subdir) + log.warn('Now working in %s', subdir) + + # building an egg + log.warn('Building a Setuptools egg in %s', to_dir) + _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) + + finally: + os.chdir(old_wd) + shutil.rmtree(tmpdir) + # returning the result + log.warn(egg) + if not os.path.exists(egg): + raise IOError('Could not build the egg.') + + +def _do_download(version, download_base, to_dir, download_delay): + egg = os.path.join(to_dir, 'setuptools-%s-py%d.%d.egg' + % (version, sys.version_info[0], sys.version_info[1])) + if not os.path.exists(egg): + tarball = download_setuptools(version, download_base, + to_dir, download_delay) + _build_egg(egg, tarball, to_dir) + sys.path.insert(0, egg) + + # Remove previously-imported pkg_resources if present (see + # https://bitbucket.org/pypa/setuptools/pull-request/7/ for details). + if 'pkg_resources' in sys.modules: + del sys.modules['pkg_resources'] + + import setuptools + setuptools.bootstrap_install_from = egg + + +def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, + to_dir=os.curdir, download_delay=15): + # making sure we use the absolute path + to_dir = os.path.abspath(to_dir) + was_imported = 'pkg_resources' in sys.modules or \ + 'setuptools' in sys.modules + try: + import pkg_resources + except ImportError: + return _do_download(version, download_base, to_dir, download_delay) + try: + pkg_resources.require("setuptools>=" + version) + return + except pkg_resources.VersionConflict: + e = sys.exc_info()[1] + if was_imported: + sys.stderr.write( + "The required version of setuptools (>=%s) is not available,\n" + "and can't be installed while this script is running. Please\n" + "install a more recent version first, using\n" + "'easy_install -U setuptools'." + "\n\n(Currently using %r)\n" % (version, e.args[0])) + sys.exit(2) + else: + del pkg_resources, sys.modules['pkg_resources'] # reload ok + return _do_download(version, download_base, to_dir, + download_delay) + except pkg_resources.DistributionNotFound: + return _do_download(version, download_base, to_dir, + download_delay) + +def _clean_check(cmd, target): + """ + Run the command to download target. If the command fails, clean up before + re-raising the error. + """ + try: + subprocess.check_call(cmd) + except subprocess.CalledProcessError: + if os.access(target, os.F_OK): + os.unlink(target) + raise + +def download_file_powershell(url, target): + """ + Download the file at url to target using Powershell (which will validate + trust). Raise an exception if the command cannot complete. + """ + target = os.path.abspath(target) + cmd = [ + 'powershell', + '-Command', + "(new-object System.Net.WebClient).DownloadFile(%(url)r, %(target)r)" % vars(), + ] + _clean_check(cmd, target) + +def has_powershell(): + if platform.system() != 'Windows': + return False + cmd = ['powershell', '-Command', 'echo test'] + devnull = open(os.path.devnull, 'wb') + try: + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False + finally: + devnull.close() + return True + +download_file_powershell.viable = has_powershell + +def download_file_curl(url, target): + cmd = ['curl', url, '--silent', '--output', target] + _clean_check(cmd, target) + +def has_curl(): + cmd = ['curl', '--version'] + devnull = open(os.path.devnull, 'wb') + try: + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False + finally: + devnull.close() + return True + +download_file_curl.viable = has_curl + +def download_file_wget(url, target): + cmd = ['wget', url, '--quiet', '--output-document', target] + _clean_check(cmd, target) + +def has_wget(): + cmd = ['wget', '--version'] + devnull = open(os.path.devnull, 'wb') + try: + try: + subprocess.check_call(cmd, stdout=devnull, stderr=devnull) + except: + return False + finally: + devnull.close() + return True + +download_file_wget.viable = has_wget + +def download_file_insecure(url, target): + """ + Use Python to download the file, even though it cannot authenticate the + connection. + """ + try: + from urllib.request import urlopen + except ImportError: + from urllib2 import urlopen + src = dst = None + try: + src = urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = src.read() + dst = open(target, "wb") + dst.write(data) + finally: + if src: + src.close() + if dst: + dst.close() + +download_file_insecure.viable = lambda: True + +def get_best_downloader(): + downloaders = [ + download_file_powershell, + download_file_curl, + download_file_wget, + download_file_insecure, + ] + + for dl in downloaders: + if dl.viable(): + return dl + +def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, + to_dir=os.curdir, delay=15, + downloader_factory=get_best_downloader): + """Download setuptools from a specified location and return its filename + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end + with a '/'). `to_dir` is the directory where the egg will be downloaded. + `delay` is the number of seconds to pause before an actual download + attempt. + + ``downloader_factory`` should be a function taking no arguments and + returning a function for downloading a URL to a target. + """ + # making sure we use the absolute path + to_dir = os.path.abspath(to_dir) + tgz_name = "setuptools-%s.tar.gz" % version + url = download_base + tgz_name + saveto = os.path.join(to_dir, tgz_name) + if not os.path.exists(saveto): # Avoid repeated downloads + log.warn("Downloading %s", url) + downloader = downloader_factory() + downloader(url, saveto) + return os.path.realpath(saveto) + + +def _extractall(self, path=".", members=None): + """Extract all members from the archive to the current working + directory and set owner, modification time and permissions on + directories afterwards. `path' specifies a different directory + to extract to. `members' is optional and must be a subset of the + list returned by getmembers(). + """ + import copy + import operator + from tarfile import ExtractError + directories = [] + + if members is None: + members = self + + for tarinfo in members: + if tarinfo.isdir(): + # Extract directories with a safe mode. + directories.append(tarinfo) + tarinfo = copy.copy(tarinfo) + tarinfo.mode = 448 # decimal for oct 0700 + self.extract(tarinfo, path) + + # Reverse sort directories. + if sys.version_info < (2, 4): + def sorter(dir1, dir2): + return cmp(dir1.name, dir2.name) + directories.sort(sorter) + directories.reverse() + else: + directories.sort(key=operator.attrgetter('name'), reverse=True) + + # Set correct owner, mtime and filemode on directories. + for tarinfo in directories: + dirpath = os.path.join(path, tarinfo.name) + try: + self.chown(tarinfo, dirpath) + self.utime(tarinfo, dirpath) + self.chmod(tarinfo, dirpath) + except ExtractError: + e = sys.exc_info()[1] + if self.errorlevel > 1: + raise + else: + self._dbg(1, "tarfile: %s" % e) + + +def _build_install_args(options): + """ + Build the arguments to 'python setup.py install' on the setuptools package + """ + install_args = [] + if options.user_install: + if sys.version_info < (2, 6): + log.warn("--user requires Python 2.6 or later") + raise SystemExit(1) + install_args.append('--user') + return install_args + +def _parse_args(): + """ + Parse the command line for options + """ + parser = optparse.OptionParser() + parser.add_option( + '--user', dest='user_install', action='store_true', default=False, + help='install in user site package (requires Python 2.6 or later)') + parser.add_option( + '--download-base', dest='download_base', metavar="URL", + default=DEFAULT_URL, + help='alternative URL from where to download the setuptools package') + parser.add_option( + '--insecure', dest='downloader_factory', action='store_const', + const=lambda: download_file_insecure, default=get_best_downloader, + help='Use internal, non-validating downloader' + ) + options, args = parser.parse_args() + # positional arguments are ignored + return options + +def main(version=DEFAULT_VERSION): + """Install or upgrade setuptools and EasyInstall""" + options = _parse_args() + tarball = download_setuptools(download_base=options.download_base, + downloader_factory=options.downloader_factory) + return _install(tarball, _build_install_args(options)) + +if __name__ == '__main__': + sys.exit(main()) Modified: SQLObject/trunk/setup.py ============================================================================== --- SQLObject/trunk/setup.py Fri Dec 20 06:08:43 2013 (r4688) +++ SQLObject/trunk/setup.py Fri Dec 20 06:39:42 2013 (r4689) @@ -26,6 +26,16 @@ [paste.filter_app_factory] main = sqlobject.wsgi_middleware:make_middleware """ + kw['install_requires'] = ["FormEncode>=1.1.1"] + kw['extras_require'] = { + 'mysql': ['MySQLdb'], + 'postgresql': ['psycopg'], # or pgdb from PyGreSQL + 'sqlite': ['pysqlite'], + 'firebird': ['kinterbasdb'], + 'sybase': ['Sybase'], + 'mssql': ['adodbapi'], # or pymssql + 'sapdb': ['sapdb'], + } setup(name="SQLObject", version=version, @@ -60,16 +70,6 @@ license="LGPL", packages=["sqlobject"] + ['sqlobject.%s' % package for package in subpackages], scripts=["scripts/sqlobject-admin", "scripts/sqlobject-convertOldURI"], - install_requires=["FormEncode>=1.1.1"], - extras_require={ - 'mysql': ['MySQLdb'], - 'postgresql': ['psycopg'], # or pgdb from PyGreSQL - 'sqlite': ['pysqlite'], - 'firebird': ['kinterbasdb'], - 'sybase': ['Sybase'], - 'mssql': ['adodbapi'], # or pymssql - 'sapdb': ['sapdb'], - }, **kw ) |
|
From: <sub...@co...> - 2013-12-20 13:08:51
|
Author: phd Date: Fri Dec 20 06:08:43 2013 New Revision: 4688 Log: WARNING: backward compatibility problem Date/Time columns created with microseconds cannot be read back with older versions of SQLObject. Modified: SQLObject/trunk/docs/News.txt Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Fri Dec 20 06:03:56 2013 (r4687) +++ SQLObject/trunk/docs/News.txt Fri Dec 20 06:08:43 2013 (r4688) @@ -20,6 +20,10 @@ Python 2.6+ because in Python 2.5 datetime.strptime doesn't support '%f' format. + WARNING: backward compatibility problem! Date/Time columns created + with microseconds cannot be read back with older versions of + SQLObject. + SQLObject 1.5.1 =============== |
|
From: <sub...@co...> - 2013-12-20 13:04:10
|
Author: phd Date: Fri Dec 20 06:03:56 2013 New Revision: 4687 Log: Python 2.4 is no longer supported Modified: SQLObject/trunk/README.txt Modified: SQLObject/trunk/README.txt ============================================================================== --- SQLObject/trunk/README.txt Wed Dec 18 13:14:04 2013 (r4686) +++ SQLObject/trunk/README.txt Fri Dec 20 06:03:56 2013 (r4687) @@ -7,7 +7,7 @@ It currently supports MySQL through the `MySQLdb` package, PostgreSQL through the `psycopg` package, SQLite, Firebird, MaxDB (SAP DB), MS SQL -Sybase and Rdbhost. It should support Python versions back to 2.4. +Sybase and Rdbhost. It should support Python versions back to 2.5. For more information please see the documentation in docs/SQLObject.txt, or online at http://sqlobject.org/ |
|
From: <sub...@co...> - 2013-12-18 20:14:11
|
Author: phd Date: Wed Dec 18 13:14:04 2013 New Revision: 4686 Log: Fix doc-dest URLs Modified: SQLObject/trunk/setup.cfg Modified: SQLObject/trunk/setup.cfg ============================================================================== --- SQLObject/trunk/setup.cfg Wed Dec 18 13:13:21 2013 (r4685) +++ SQLObject/trunk/setup.cfg Wed Dec 18 13:14:04 2013 (r4686) @@ -40,6 +40,6 @@ make-dirs = 1 ## For live documentation: -# doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/ +# doc-dest = scp://web.sourceforge.net:/home/project-web/sqlobject/ ## For in-development documentation: -doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/devel/ +doc-dest = scp://web.sourceforge.net:/home/project-web/sqlobject/devel/ |
|
From: <sub...@co...> - 2013-12-18 20:13:30
|
Author: phd Date: Wed Dec 18 13:13:21 2013 New Revision: 4685 Log: Fix doc-dest URLs. Uncomment doc-dest URL for stable branch. Modified: SQLObject/branches/1.5/setup.cfg Modified: SQLObject/branches/1.5/setup.cfg ============================================================================== --- SQLObject/branches/1.5/setup.cfg Tue Dec 17 23:51:22 2013 (r4684) +++ SQLObject/branches/1.5/setup.cfg Wed Dec 18 13:13:21 2013 (r4685) @@ -40,6 +40,6 @@ make-dirs = 1 ## For live documentation: -# doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/ +doc-dest = scp://web.sourceforge.net:/home/project-web/sqlobject/ ## For in-development documentation: -doc-dest = scp://ianbicking@shell.sf.net/home/groups/s/sq/sqlobject/htdocs/devel/ +# doc-dest = scp://web.sourceforge.net:/home/project-web/sqlobject/devel/ |
|
From: <sub...@co...> - 2013-12-18 06:51:31
|
Author: phd Date: Tue Dec 17 23:51:22 2013 New Revision: 4684 Log: TODO: upgrade ez_setup Modified: SQLObject/trunk/docs/TODO.txt Modified: SQLObject/trunk/docs/TODO.txt ============================================================================== --- SQLObject/trunk/docs/TODO.txt Tue Dec 17 09:14:06 2013 (r4683) +++ SQLObject/trunk/docs/TODO.txt Tue Dec 17 23:51:22 2013 (r4684) @@ -1,6 +1,8 @@ TODO ---- +* Upgrade ez_setup to 1.4.2. + * RelatedJoin.hasOther(otherObject[.id]) * createParamsPre/Post:: @@ -47,7 +49,7 @@ * Stop supporting Python 2.5: remove import sets; use ``with lock``; make ConnectionHub a context manager instead of .doInTransaction(); - replace time.strptime with datetime.strptime. Upgrade setuptools. + replace time.strptime with datetime.strptime. Upgrade ez_setup to 2.0+. * Create JSONCol. |
|
From: <sub...@co...> - 2013-12-17 16:14:15
|
Author: phd Date: Tue Dec 17 09:14:06 2013 New Revision: 4683 Log: Upgrade setuptools after stopping supporting Python 2.5 Modified: SQLObject/trunk/docs/TODO.txt Modified: SQLObject/trunk/docs/TODO.txt ============================================================================== --- SQLObject/trunk/docs/TODO.txt Sun Dec 15 08:03:08 2013 (r4682) +++ SQLObject/trunk/docs/TODO.txt Tue Dec 17 09:14:06 2013 (r4683) @@ -47,7 +47,7 @@ * Stop supporting Python 2.5: remove import sets; use ``with lock``; make ConnectionHub a context manager instead of .doInTransaction(); - replace time.strptime with datetime.strptime. + replace time.strptime with datetime.strptime. Upgrade setuptools. * Create JSONCol. |
|
From: <sub...@co...> - 2013-12-15 15:03:15
|
Author: phd Date: Sun Dec 15 08:03:08 2013 New Revision: 4682 Log: Stable version 1.5.1 Modified: SQLObject/tags/1.5.1/README.txt SQLObject/tags/1.5.1/setup.cfg SQLObject/tags/1.5.1/sqlobject/__version__.py Modified: SQLObject/tags/1.5.1/README.txt ============================================================================== --- SQLObject/tags/1.5.1/README.txt Sun Dec 15 08:01:20 2013 (r4681) +++ SQLObject/tags/1.5.1/README.txt Sun Dec 15 08:03:08 2013 (r4682) @@ -1,5 +1,5 @@ -SQLObject 1.5 -============= +SQLObject 1.5.1 +=============== Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/1.5.1/setup.cfg ============================================================================== --- SQLObject/tags/1.5.1/setup.cfg Sun Dec 15 08:01:20 2013 (r4681) +++ SQLObject/tags/1.5.1/setup.cfg Sun Dec 15 08:03:08 2013 (r4682) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/1.5.1/sqlobject/__version__.py ============================================================================== --- SQLObject/tags/1.5.1/sqlobject/__version__.py Sun Dec 15 08:01:20 2013 (r4681) +++ SQLObject/tags/1.5.1/sqlobject/__version__.py Sun Dec 15 08:03:08 2013 (r4682) @@ -1,8 +1,8 @@ -version = '1.5' +version = '1.5.1' major = 1 minor = 5 -micro = 0 -release_level = 'branch' +micro = 1 +release_level = 'final' serial = 0 version_info = (major, minor, micro, release_level, serial) |
|
From: <sub...@co...> - 2013-12-15 15:01:27
|
Author: phd
Date: Sun Dec 15 08:01:20 2013
New Revision: 4681
Log:
Tagging 1.5.1
Added:
SQLObject/tags/1.5.1/
- copied from r4680, SQLObject/branches/1.5/
|
|
From: <sub...@co...> - 2013-12-15 15:00:47
|
Author: phd Date: Sun Dec 15 08:00:37 2013 New Revision: 4680 Log: Merge revision 4679 from branch 1.5: SQLObject 1.5.1 was released 15 Dec 2013 Modified: SQLObject/trunk/docs/News.txt Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Sun Dec 15 07:58:10 2013 (r4679) +++ SQLObject/trunk/docs/News.txt Sun Dec 15 08:00:37 2013 (r4680) @@ -23,6 +23,8 @@ SQLObject 1.5.1 =============== +Released 15 Dec 2013. + * SQLiteConnection.close() now closes and reopens a connection to in-memory database. |
|
From: <sub...@co...> - 2013-12-15 14:58:20
|
Author: phd Date: Sun Dec 15 07:58:10 2013 New Revision: 4679 Log: SQLObject 1.5.1 was released 15 Dec 2013 Modified: SQLObject/branches/1.5/docs/News.txt Modified: SQLObject/branches/1.5/docs/News.txt ============================================================================== --- SQLObject/branches/1.5/docs/News.txt Sun Dec 8 08:59:20 2013 (r4678) +++ SQLObject/branches/1.5/docs/News.txt Sun Dec 15 07:58:10 2013 (r4679) @@ -10,6 +10,8 @@ SQLObject 1.5.1 =============== +Released 15 Dec 2013. + * SQLiteConnection.close() now closes and reopens a connection to in-memory database. |
|
From: <sub...@co...> - 2013-12-08 16:38:25
|
Author: phd
Date: Sun Dec 8 08:59:20 2013
New Revision: 4678
Log:
DateTimeCol and TimeCol preserve microseconds
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/docs/TODO.txt
SQLObject/trunk/sqlobject/col.py
SQLObject/trunk/sqlobject/converters.py
SQLObject/trunk/sqlobject/tests/test_converters.py
SQLObject/trunk/sqlobject/tests/test_datetime.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/docs/News.txt Sun Dec 8 08:59:20 2013 (r4678)
@@ -16,6 +16,10 @@
* Python 2.4 is no longer supported. The minimal supported version is
Python 2.5.
+* DateTimeCol and TimeCol preserve microseconds. The feature requires
+ Python 2.6+ because in Python 2.5 datetime.strptime doesn't support
+ '%f' format.
+
SQLObject 1.5.1
===============
Modified: SQLObject/trunk/docs/TODO.txt
==============================================================================
--- SQLObject/trunk/docs/TODO.txt Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/docs/TODO.txt Sun Dec 8 08:59:20 2013 (r4678)
@@ -46,7 +46,8 @@
* Cache columns in sqlmeta.getColumns(); reset the cache on add/del Column/Join.
* Stop supporting Python 2.5: remove import sets; use ``with lock``;
- make ConnectionHub a context manager instead of .doInTransaction().
+ make ConnectionHub a context manager instead of .doInTransaction();
+ replace time.strptime with datetime.strptime.
* Create JSONCol.
Modified: SQLObject/trunk/sqlobject/col.py
==============================================================================
--- SQLObject/trunk/sqlobject/col.py Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/sqlobject/col.py Sun Dec 8 08:59:20 2013 (r4678)
@@ -20,7 +20,9 @@
from array import array
from itertools import count
-import re, time
+import re
+import sys
+import time
try:
import cPickle as pickle
except ImportError:
@@ -1098,11 +1100,23 @@
else:
return datetime.time(value.hour, value.minute, int(value.second))
try:
- stime = time.strptime(value, self.format)
+ if self.format.find(".%f") >= 0:
+ if '.' in value:
+ _value = value.split('.')
+ microseconds = _value[-1]
+ if len(microseconds) > 6:
+ _value[-1] = microseconds[:6]
+ value = '.'.join(_value)
+ else:
+ value += '.0'
+ if sys.version_info[:3] < (2, 6, 0): # datetime.strptime in python2.5 doesn't support '%f' format
+ stime = time.strptime(value, self.format)
+ return datetime.datetime(*stime[:6])
+ else:
+ return datetime.datetime.strptime(value, self.format)
except:
raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
(self.format, self.name, type(value), value), value, state)
- return datetime.datetime(*stime[:6])
def from_python(self, value, state):
if value is None:
@@ -1129,11 +1143,25 @@
elif isinstance(value, datetime.time):
return DateTime.Time(value.hour, value.minute, value.second)
try:
- stime = time.strptime(value, self.format)
+ if self.format.find(".%f") >= 0:
+ if '.' in value:
+ _value = value.split('.')
+ microseconds = _value[-1]
+ if len(microseconds) > 6:
+ _value[-1] = microseconds[:6]
+ value = '.'.join(_value)
+ else:
+ value += '.0'
+ if sys.version_info[:3] < (2, 6, 0): # datetime.strptime in python2.5 doesn't support '%f' format
+ stime = time.strptime(value, self.format)
+ return DateTime.mktime(stime)
+ else:
+ value = datetime.datetime.strptime(value, self.format)
+ return DateTime.DateTime(value.year, value.month, value.day,
+ value.hour, value.minute, value.second)
except:
raise validators.Invalid("expected a date/time string of the '%s' format in the DateTimeCol '%s', got %s %r instead" % \
(self.format, self.name, type(value), value), value, state)
- return DateTime.mktime(stime)
def from_python(self, value, state):
if value is None:
@@ -1146,7 +1174,7 @@
(self.name, type(value), value), value, state)
class SODateTimeCol(SOCol):
- datetimeFormat = '%Y-%m-%d %H:%M:%S'
+ datetimeFormat = '%Y-%m-%d %H:%M:%S.%f'
def __init__(self, **kw):
datetimeFormat = kw.pop('datetimeFormat', None)
@@ -1277,7 +1305,7 @@
from_python = to_python
class SOTimeCol(SOCol):
- timeFormat = '%H:%M:%S'
+ timeFormat = '%H:%M:%S.%f'
def __init__(self, **kw):
timeFormat = kw.pop('timeFormat', None)
Modified: SQLObject/trunk/sqlobject/converters.py
==============================================================================
--- SQLObject/trunk/sqlobject/converters.py Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/sqlobject/converters.py Sun Dec 8 08:59:20 2013 (r4678)
@@ -7,16 +7,11 @@
try:
- import mx.DateTime.ISO
- origISOStr = mx.DateTime.ISO.strGMT
from mx.DateTime import DateTimeType, DateTimeDeltaType
except ImportError:
try:
- import DateTime.ISO
- origISOStr = DateTime.ISO.strGMT
from DateTime import DateTimeType, DateTimeDeltaType
except ImportError:
- origISOStr = None
DateTimeType = None
DateTimeDeltaType = None
@@ -41,17 +36,6 @@
('\t', '\\t'),
]
-def isoStr(val):
- """
- Gets rid of time zone information
- (@@: should we convert to GMT?)
- """
- val = origISOStr(val)
- if val.find('+') == -1:
- return val
- else:
- return val[:val.find('+')]
-
class ConverterRegistry:
def __init__(self):
@@ -133,12 +117,12 @@
if DateTimeType:
def DateTimeConverter(value, db):
- return "'%s'" % isoStr(value)
+ return "'%s'" % value.strftime("%Y-%m-%d %H:%M:%S.%s")
registerConverter(DateTimeType, DateTimeConverter)
def TimeConverter(value, db):
- return "'%s'" % value.strftime("%T")
+ return "'%s'" % value.strftime("%H:%M:%S")
registerConverter(DateTimeDeltaType, TimeConverter)
@@ -167,9 +151,9 @@
registerConverter(time.struct_time, StructTimeConverter)
def DateTimeConverter(value, db):
- return "'%04d-%02d-%02d %02d:%02d:%02d'" % (
+ return "'%04d-%02d-%02d %02d:%02d:%02d.%d'" % (
value.year, value.month, value.day,
- value.hour, value.minute, value.second)
+ value.hour, value.minute, value.second, value.microsecond)
registerConverter(datetime.datetime, DateTimeConverter)
@@ -179,7 +163,7 @@
registerConverter(datetime.date, DateConverter)
def TimeConverter(value, db):
- return "'%02d:%02d:%02d'" % (value.hour, value.minute, value.second)
+ return "'%02d:%02d:%02d.%d'" % (value.hour, value.minute, value.second, value.microsecond)
registerConverter(datetime.time, TimeConverter)
Modified: SQLObject/trunk/sqlobject/tests/test_converters.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_converters.py Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/sqlobject/tests/test_converters.py Sun Dec 8 08:59:20 2013 (r4678)
@@ -88,11 +88,11 @@
def test_datetime():
from datetime import datetime, date, time
- assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == "'2005-07-14 13:31:02'"
+ assert sqlrepr(datetime(2005, 7, 14, 13, 31, 2)) == "'2005-07-14 13:31:02.0'"
assert sqlrepr(date(2005, 7, 14)) == "'2005-07-14'"
- assert sqlrepr(time(13, 31, 2)) == "'13:31:02'"
+ assert sqlrepr(time(13, 31, 2)) == "'13:31:02.0'"
# now dates before 1900
- assert sqlrepr(datetime(1428, 7, 14, 13, 31, 2)) == "'1428-07-14 13:31:02'"
+ assert sqlrepr(datetime(1428, 7, 14, 13, 31, 2)) == "'1428-07-14 13:31:02.0'"
assert sqlrepr(date(1428, 7, 14)) == "'1428-07-14'"
def test_instance():
Modified: SQLObject/trunk/sqlobject/tests/test_datetime.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_datetime.py Sun Dec 8 08:57:03 2013 (r4677)
+++ SQLObject/trunk/sqlobject/tests/test_datetime.py Sun Dec 8 08:59:20 2013 (r4678)
@@ -25,7 +25,8 @@
assert dt1.col1.day == _now.day
assert dt1.col1.hour == _now.hour
assert dt1.col1.minute == _now.minute
- assert dt1.col1.second == int(_now.second)
+ assert dt1.col1.second == _now.second
+ assert dt1.col1.microsecond == _now.microsecond
assert isinstance(dt1.col2, date)
assert not isinstance(dt1.col2, datetime)
@@ -36,7 +37,8 @@
assert isinstance(dt1.col3, time)
assert dt1.col3.hour == _now.hour
assert dt1.col3.minute == _now.minute
- assert dt1.col3.second == int(_now.second)
+ assert dt1.col3.second == _now.second
+ assert dt1.col3.microsecond == _now.microsecond
if mxdatetime_available:
col.default_datetime_implementation = MXDATETIME_IMPLEMENTATION
@@ -47,7 +49,7 @@
if connection.dbName == "sqlite":
if connection.using_sqlite2:
# mxDateTime sends and PySQLite2 returns full date/time for dates
- dateFormat = "%Y-%m-%d %H:%M:%S"
+ dateFormat = "%Y-%m-%d %H:%M:%S.%f"
class DateTime2(SQLObject):
col1 = DateTimeCol()
@@ -57,7 +59,7 @@
def test_mxDateTime():
setupClass(DateTime2)
_now = now()
- dt2 = DateTime2(col1=_now, col2=_now, col3=Time(_now.hour, _now.minute, int(_now.second)))
+ dt2 = DateTime2(col1=_now, col2=_now, col3=Time(_now.hour, _now.minute, _now.second))
assert isinstance(dt2.col1, col.DateTimeType)
assert dt2.col1.year == _now.year
|
|
From: <sub...@co...> - 2013-12-08 16:38:18
|
Author: phd
Date: Sun Dec 8 08:57:03 2013
New Revision: 4677
Log:
Merge revision 4676 from branch 1.5: SQLiteConnection.close()
now closes and reopens a connection to in-memory database.
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
SQLObject/trunk/sqlobject/tests/dbtest.py
SQLObject/trunk/sqlobject/tests/test_sqlite.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sun Dec 8 08:54:13 2013 (r4676)
+++ SQLObject/trunk/docs/News.txt Sun Dec 8 08:57:03 2013 (r4677)
@@ -16,6 +16,12 @@
* Python 2.4 is no longer supported. The minimal supported version is
Python 2.5.
+SQLObject 1.5.1
+===============
+
+* SQLiteConnection.close() now closes and reopens a connection
+ to in-memory database.
+
SQLObject 1.5.0
===============
Modified: SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py
==============================================================================
--- SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py Sun Dec 8 08:54:13 2013 (r4676)
+++ SQLObject/trunk/sqlobject/sqlite/sqliteconnection.py Sun Dec 8 08:57:03 2013 (r4677)
@@ -89,11 +89,7 @@
self._threadPool = {}
self._threadOrigination = {}
if self._memory:
- self._memoryConn = sqlite.connect(
- self.filename, **self._connOptions)
- # Convert text data from SQLite to str, not unicode -
- # SQLObject converts it to unicode itself.
- self._memoryConn.text_factory = str
+ self.makeMemoryConnection()
@classmethod
def _connectionFromParams(cls, user, password, host, port, path, args):
@@ -184,6 +180,13 @@
return
conn.isolation_level = level
+ def makeMemoryConnection(self):
+ self._memoryConn = self.module.connect(
+ self.filename, **self._connOptions)
+ # Convert text data from SQLite to str, not unicode -
+ # SQLObject converts it to unicode itself.
+ self._memoryConn.text_factory = str
+
def makeConnection(self):
if self._memory:
return self._memoryConn
@@ -194,6 +197,9 @@
def close(self):
DBAPI.close(self)
self._threadPool = {}
+ if self._memory:
+ self._memoryConn.close()
+ self.makeMemoryConnection()
def _executeRetry(self, conn, cursor, query):
if self.debug:
Modified: SQLObject/trunk/sqlobject/tests/dbtest.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/dbtest.py Sun Dec 8 08:54:13 2013 (r4676)
+++ SQLObject/trunk/sqlobject/tests/dbtest.py Sun Dec 8 08:57:03 2013 (r4677)
@@ -41,6 +41,7 @@
'-emptyTable': 'mssql',
'-limitSelect' : 'mssql',
'+schema' : 'postgres',
+ '+memorydb': 'sqlite',
}
Modified: SQLObject/trunk/sqlobject/tests/test_sqlite.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_sqlite.py Sun Dec 8 08:54:13 2013 (r4676)
+++ SQLObject/trunk/sqlobject/tests/test_sqlite.py Sun Dec 8 08:57:03 2013 (r4677)
@@ -104,3 +104,16 @@
test = TestSO1(name=None, passwd='')
assert test.name is None
assert test.passwd == ''
+
+def test_memorydb():
+ if not supports("memorydb"):
+ return
+ connection = getConnection()
+ if connection.dbName != "sqlite":
+ return
+ if not connection._memory:
+ return
+ setupClass(TestSO1)
+ connection.close() # create a new connection to an in-memory database
+ TestSO1.setConnection(connection)
+ TestSO1.createTable()
|
|
From: <sub...@co...> - 2013-12-08 16:38:11
|
Author: phd
Date: Sun Dec 8 08:54:13 2013
New Revision: 4676
Log:
SQLiteConnection.close() now closes and reopens a connection
to in-memory database.
Modified:
SQLObject/branches/1.5/docs/News.txt
SQLObject/branches/1.5/sqlobject/sqlite/sqliteconnection.py
SQLObject/branches/1.5/sqlobject/tests/dbtest.py
SQLObject/branches/1.5/sqlobject/tests/test_sqlite.py
Modified: SQLObject/branches/1.5/docs/News.txt
==============================================================================
--- SQLObject/branches/1.5/docs/News.txt Mon Oct 14 11:16:48 2013 (r4675)
+++ SQLObject/branches/1.5/docs/News.txt Sun Dec 8 08:54:13 2013 (r4676)
@@ -7,6 +7,12 @@
.. _start:
+SQLObject 1.5.1
+===============
+
+* SQLiteConnection.close() now closes and reopens a connection
+ to in-memory database.
+
SQLObject 1.5.0
===============
Modified: SQLObject/branches/1.5/sqlobject/sqlite/sqliteconnection.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/sqlite/sqliteconnection.py Mon Oct 14 11:16:48 2013 (r4675)
+++ SQLObject/branches/1.5/sqlobject/sqlite/sqliteconnection.py Sun Dec 8 08:54:13 2013 (r4676)
@@ -89,11 +89,7 @@
self._threadPool = {}
self._threadOrigination = {}
if self._memory:
- self._memoryConn = sqlite.connect(
- self.filename, **self._connOptions)
- # Convert text data from SQLite to str, not unicode -
- # SQLObject converts it to unicode itself.
- self._memoryConn.text_factory = str
+ self.makeMemoryConnection()
@classmethod
def _connectionFromParams(cls, user, password, host, port, path, args):
@@ -184,6 +180,13 @@
return
conn.isolation_level = level
+ def makeMemoryConnection(self):
+ self._memoryConn = self.module.connect(
+ self.filename, **self._connOptions)
+ # Convert text data from SQLite to str, not unicode -
+ # SQLObject converts it to unicode itself.
+ self._memoryConn.text_factory = str
+
def makeConnection(self):
if self._memory:
return self._memoryConn
@@ -194,6 +197,9 @@
def close(self):
DBAPI.close(self)
self._threadPool = {}
+ if self._memory:
+ self._memoryConn.close()
+ self.makeMemoryConnection()
def _executeRetry(self, conn, cursor, query):
if self.debug:
Modified: SQLObject/branches/1.5/sqlobject/tests/dbtest.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/dbtest.py Mon Oct 14 11:16:48 2013 (r4675)
+++ SQLObject/branches/1.5/sqlobject/tests/dbtest.py Sun Dec 8 08:54:13 2013 (r4676)
@@ -41,6 +41,7 @@
'-emptyTable': 'mssql',
'-limitSelect' : 'mssql',
'+schema' : 'postgres',
+ '+memorydb': 'sqlite',
}
Modified: SQLObject/branches/1.5/sqlobject/tests/test_sqlite.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_sqlite.py Mon Oct 14 11:16:48 2013 (r4675)
+++ SQLObject/branches/1.5/sqlobject/tests/test_sqlite.py Sun Dec 8 08:54:13 2013 (r4676)
@@ -104,3 +104,16 @@
test = TestSO1(name=None, passwd='')
assert test.name is None
assert test.passwd == ''
+
+def test_memorydb():
+ if not supports("memorydb"):
+ return
+ connection = getConnection()
+ if connection.dbName != "sqlite":
+ return
+ if not connection._memory:
+ return
+ setupClass(TestSO1)
+ connection.close() # create a new connection to an in-memory database
+ TestSO1.setConnection(connection)
+ TestSO1.createTable()
|
|
From: <sub...@co...> - 2013-10-14 17:16:56
|
Author: phd
Date: Mon Oct 14 11:16:48 2013
New Revision: 4675
Log:
Stop supporting Python 2.4; use hashlib instead of md5
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/docs/TODO.txt
SQLObject/trunk/docs/test.py
SQLObject/trunk/sqlobject/include/hashcol.py
SQLObject/trunk/sqlobject/main.py
SQLObject/trunk/sqlobject/tests/test_md5.py
Modified: SQLObject/trunk/docs/News.txt
==============================================================================
--- SQLObject/trunk/docs/News.txt Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/News.txt Mon Oct 14 11:16:48 2013 (r4675)
@@ -10,6 +10,12 @@
SQLObject (trunk)
=================
+Features & Interface
+--------------------
+
+* Python 2.4 is no longer supported. The minimal supported version is
+ Python 2.5.
+
SQLObject 1.5.0
===============
Modified: SQLObject/trunk/docs/TODO.txt
==============================================================================
--- SQLObject/trunk/docs/TODO.txt Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/TODO.txt Mon Oct 14 11:16:48 2013 (r4675)
@@ -45,8 +45,6 @@
* Cache columns in sqlmeta.getColumns(); reset the cache on add/del Column/Join.
-* Stop supporting Python 2.4: use hashlib instead of md5.
-
* Stop supporting Python 2.5: remove import sets; use ``with lock``;
make ConnectionHub a context manager instead of .doInTransaction().
Modified: SQLObject/trunk/docs/test.py
==============================================================================
--- SQLObject/trunk/docs/test.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/docs/test.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -1,9 +1,5 @@
import sys, os
-
-if sys.version_info >= (2, 4):
- import doctest
-else:
- raise ImportError("Python 2.4 doctest required")
+import doctest
sys.path.insert(
0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
Modified: SQLObject/trunk/sqlobject/include/hashcol.py
==============================================================================
--- SQLObject/trunk/sqlobject/include/hashcol.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/include/hashcol.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -42,7 +42,7 @@
def __init__( self, **kw ):
if 'hashMethod' not in kw:
- from md5 import md5
+ from hashlib import md5
self.hashMethod = lambda v: md5( v ).hexdigest()
if 'length' not in kw:
kw['length'] = 32
Modified: SQLObject/trunk/sqlobject/main.py
==============================================================================
--- SQLObject/trunk/sqlobject/main.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/main.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -43,8 +43,8 @@
from util.threadinglocal import local
import sys
-if sys.version_info[:3] < (2, 4, 0):
- raise ImportError, "SQLObject requires Python 2.4.0 or later"
+if sys.version_info[:3] < (2, 5, 0):
+ raise ImportError, "SQLObject requires Python 2.5.0 or later"
"""
This thread-local storage is needed for RowCreatedSignals. It gathers
@@ -648,8 +648,8 @@
if warnings_level is not None and warnings_level <= level:
warnings.warn(message, DeprecationWarning, stacklevel=stacklevel)
-if sys.version_info[:3] < (2, 5, 0):
- deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
+#if sys.version_info[:3] < (2, 5, 0):
+# deprecated("Support for Python 2.4 has been declared obsolete and will be removed in the next release of SQLObject")
def setDeprecationLevel(warning=1, exception=None):
"""
Modified: SQLObject/trunk/sqlobject/tests/test_md5.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_md5.py Sat Oct 12 11:54:31 2013 (r4674)
+++ SQLObject/trunk/sqlobject/tests/test_md5.py Mon Oct 14 11:16:48 2013 (r4675)
@@ -1,7 +1,7 @@
-from md5 import md5
+from hashlib import md5
########################################
-## md5.md5
+## hashlib.md5
########################################
def test_md5():
|
|
From: <sub...@co...> - 2013-10-12 17:54:37
|
Author: phd
Date: Sat Oct 12 11:54:31 2013
New Revision: 4674
Log:
Merge revision 4673 from branch 1.5: add a few tests for md5.md5
Added:
SQLObject/trunk/sqlobject/tests/test_md5.py
- copied unchanged from r4673, SQLObject/branches/1.5/sqlobject/tests/test_md5.py
Copied: SQLObject/trunk/sqlobject/tests/test_md5.py (from r4673, SQLObject/branches/1.5/sqlobject/tests/test_md5.py)
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ SQLObject/trunk/sqlobject/tests/test_md5.py Sat Oct 12 11:54:31 2013 (r4674, copy of r4673, SQLObject/branches/1.5/sqlobject/tests/test_md5.py)
@@ -0,0 +1,11 @@
+from md5 import md5
+
+########################################
+## md5.md5
+########################################
+
+def test_md5():
+ assert md5('').hexdigest() == 'd41d8cd98f00b204e9800998ecf8427e'
+ assert md5('\n').hexdigest() == '68b329da9893e34099c7d8ad5cb9c940'
+ assert md5('123').hexdigest() == '202cb962ac59075b964b07152d234b70'
+ assert md5('123\n').hexdigest() == 'ba1f2511fc30423bdbb183fe33f3dd0f'
|
|
From: <sub...@co...> - 2013-10-12 17:52:55
|
Author: phd
Date: Sat Oct 12 11:52:47 2013
New Revision: 4673
Log:
Add a few tests for md5.md5
Added:
SQLObject/branches/1.5/sqlobject/tests/test_md5.py
Added: SQLObject/branches/1.5/sqlobject/tests/test_md5.py
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ SQLObject/branches/1.5/sqlobject/tests/test_md5.py Sat Oct 12 11:52:47 2013 (r4673)
@@ -0,0 +1,11 @@
+from md5 import md5
+
+########################################
+## md5.md5
+########################################
+
+def test_md5():
+ assert md5('').hexdigest() == 'd41d8cd98f00b204e9800998ecf8427e'
+ assert md5('\n').hexdigest() == '68b329da9893e34099c7d8ad5cb9c940'
+ assert md5('123').hexdigest() == '202cb962ac59075b964b07152d234b70'
+ assert md5('123\n').hexdigest() == 'ba1f2511fc30423bdbb183fe33f3dd0f'
|
|
From: <sub...@co...> - 2013-10-05 12:37:25
|
Author: phd Date: Sat Oct 5 06:37:20 2013 New Revision: 4672 Log: SQLObject 1.5.0 final Modified: SQLObject/tags/1.5.0/README.txt SQLObject/tags/1.5.0/setup.cfg SQLObject/tags/1.5.0/sqlobject/__version__.py Modified: SQLObject/tags/1.5.0/README.txt ============================================================================== --- SQLObject/tags/1.5.0/README.txt Sat Oct 5 06:35:39 2013 (r4671) +++ SQLObject/tags/1.5.0/README.txt Sat Oct 5 06:37:20 2013 (r4672) @@ -1,5 +1,5 @@ -SQLObject 1.5 -============= +SQLObject 1.5.0 +=============== Thanks for looking at SQLObject. SQLObject is an object-relational mapper, i.e., a library that will wrap your database tables in Python Modified: SQLObject/tags/1.5.0/setup.cfg ============================================================================== --- SQLObject/tags/1.5.0/setup.cfg Sat Oct 5 06:35:39 2013 (r4671) +++ SQLObject/tags/1.5.0/setup.cfg Sat Oct 5 06:37:20 2013 (r4672) @@ -5,10 +5,6 @@ [easy_install] #find_links = http://svn.pythonpaste.org/package_index.html -[egg_info] -tag_build = dev -tag_svn_revision = true - [pudge] theme = pythonpaste.org docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt Modified: SQLObject/tags/1.5.0/sqlobject/__version__.py ============================================================================== --- SQLObject/tags/1.5.0/sqlobject/__version__.py Sat Oct 5 06:35:39 2013 (r4671) +++ SQLObject/tags/1.5.0/sqlobject/__version__.py Sat Oct 5 06:37:20 2013 (r4672) @@ -1,8 +1,8 @@ -version = '1.5' +version = '1.5.0' major = 1 minor = 5 micro = 0 -release_level = 'branch' +release_level = 'final' serial = 0 version_info = (major, minor, micro, release_level, serial) |
|
From: <sub...@co...> - 2013-10-05 12:35:45
|
Author: phd
Date: Sat Oct 5 06:35:39 2013
New Revision: 4671
Log:
Tagging 1.5.0
Added:
SQLObject/tags/1.5.0/
- copied from r4670, SQLObject/branches/1.5/
|
|
From: <sub...@co...> - 2013-10-05 12:35:16
|
Author: phd Date: Sat Oct 5 06:35:04 2013 New Revision: 4670 Log: Merge revision 4669 from branch 1.5: SQLObject 1.5.0 was released 5 Oct 2013 Modified: SQLObject/trunk/docs/News.txt Modified: SQLObject/trunk/docs/News.txt ============================================================================== --- SQLObject/trunk/docs/News.txt Sat Oct 5 06:33:59 2013 (r4669) +++ SQLObject/trunk/docs/News.txt Sat Oct 5 06:35:04 2013 (r4670) @@ -13,6 +13,8 @@ SQLObject 1.5.0 =============== +Released 5 Oct 2013. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2013-10-05 12:34:19
|
Author: phd Date: Sat Oct 5 06:33:59 2013 New Revision: 4669 Log: SQLObject 1.5.0 was released 5 Oct 2013 Modified: SQLObject/branches/1.5/docs/News.txt Modified: SQLObject/branches/1.5/docs/News.txt ============================================================================== --- SQLObject/branches/1.5/docs/News.txt Sat Oct 5 06:31:51 2013 (r4668) +++ SQLObject/branches/1.5/docs/News.txt Sat Oct 5 06:33:59 2013 (r4669) @@ -10,6 +10,8 @@ SQLObject 1.5.0 =============== +Released 5 Oct 2013. + Features & Interface -------------------- |
|
From: <sub...@co...> - 2013-10-05 12:31:56
|
Author: phd Date: Sat Oct 5 06:31:51 2013 New Revision: 4668 Log: Merge revision 4667 from branch 1.5: remove mentions of non-existing examples Modified: SQLObject/trunk/MANIFEST.in SQLObject/trunk/debian/examples Modified: SQLObject/trunk/MANIFEST.in ============================================================================== --- SQLObject/trunk/MANIFEST.in Sat Oct 5 06:30:27 2013 (r4667) +++ SQLObject/trunk/MANIFEST.in Sat Oct 5 06:31:51 2013 (r4668) @@ -1,7 +1,6 @@ include *.txt include *.html include *.css -include examples/*.py include docs/LICENSE include docs/*.txt include docs/*.html Modified: SQLObject/trunk/debian/examples ============================================================================== --- SQLObject/trunk/debian/examples Sat Oct 5 06:30:27 2013 (r4667) +++ SQLObject/trunk/debian/examples Sat Oct 5 06:31:51 2013 (r4668) @@ -1,2 +1 @@ -examples/* tests/ |
|
From: <sub...@co...> - 2013-10-05 12:30:34
|
Author: phd Date: Sat Oct 5 06:30:27 2013 New Revision: 4667 Log: Remove mentions of non-existing examples directory Modified: SQLObject/branches/1.5/MANIFEST.in SQLObject/branches/1.5/debian/examples Modified: SQLObject/branches/1.5/MANIFEST.in ============================================================================== --- SQLObject/branches/1.5/MANIFEST.in Sat Oct 5 06:24:36 2013 (r4666) +++ SQLObject/branches/1.5/MANIFEST.in Sat Oct 5 06:30:27 2013 (r4667) @@ -1,7 +1,6 @@ include *.txt include *.html include *.css -include examples/*.py include docs/LICENSE include docs/*.txt include docs/*.html Modified: SQLObject/branches/1.5/debian/examples ============================================================================== --- SQLObject/branches/1.5/debian/examples Sat Oct 5 06:24:36 2013 (r4666) +++ SQLObject/branches/1.5/debian/examples Sat Oct 5 06:30:27 2013 (r4667) @@ -1,2 +1 @@ -examples/* tests/ |
|
From: <sub...@co...> - 2013-10-05 12:24:41
|
Author: phd
Date: Sat Oct 5 06:24:36 2013
New Revision: 4666
Log:
Merge revision 4665 from branch 1.5: add a test for pgcode
Modified:
SQLObject/trunk/sqlobject/tests/test_exceptions.py
Modified: SQLObject/trunk/sqlobject/tests/test_exceptions.py
==============================================================================
--- SQLObject/trunk/sqlobject/tests/test_exceptions.py Sat Oct 5 06:23:22 2013 (r4665)
+++ SQLObject/trunk/sqlobject/tests/test_exceptions.py Sat Oct 5 06:24:36 2013 (r4666)
@@ -1,5 +1,5 @@
from sqlobject import *
-from sqlobject.dberrors import DuplicateEntryError
+from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
########################################
@@ -9,9 +9,23 @@
class TestException(SQLObject):
name = StringCol(unique=True, length=100)
+class TestExceptionWithNonexistingTable(SQLObject):
+ pass
+
def test_exceptions():
if not supports("exceptions"):
return
setupClass(TestException)
TestException(name="test")
raises(DuplicateEntryError, TestException, name="test")
+
+ connection = getConnection()
+ if connection.module.__name__ != 'psycopg2':
+ return
+ TestExceptionWithNonexistingTable.setConnection(connection)
+ try:
+ list(TestExceptionWithNonexistingTable.select())
+ except ProgrammingError, e:
+ assert e.args[0].code == '42P01'
+ else:
+ assert False, "DID NOT RAISE"
|
|
From: <sub...@co...> - 2013-10-05 12:23:29
|
Author: phd
Date: Sat Oct 5 06:23:22 2013
New Revision: 4665
Log:
Add a test for pgcode
Modified:
SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py
Modified: SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py
==============================================================================
--- SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py Sat Oct 5 06:04:46 2013 (r4664)
+++ SQLObject/branches/1.5/sqlobject/tests/test_exceptions.py Sat Oct 5 06:23:22 2013 (r4665)
@@ -1,5 +1,5 @@
from sqlobject import *
-from sqlobject.dberrors import DuplicateEntryError
+from sqlobject.dberrors import *
from sqlobject.tests.dbtest import *
########################################
@@ -9,9 +9,23 @@
class TestException(SQLObject):
name = StringCol(unique=True, length=100)
+class TestExceptionWithNonexistingTable(SQLObject):
+ pass
+
def test_exceptions():
if not supports("exceptions"):
return
setupClass(TestException)
TestException(name="test")
raises(DuplicateEntryError, TestException, name="test")
+
+ connection = getConnection()
+ if connection.module.__name__ != 'psycopg2':
+ return
+ TestExceptionWithNonexistingTable.setConnection(connection)
+ try:
+ list(TestExceptionWithNonexistingTable.select())
+ except ProgrammingError, e:
+ assert e.args[0].code == '42P01'
+ else:
+ assert False, "DID NOT RAISE"
|