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 e1b5f794f78ad91dcbe01589994cdb76d5507997 (commit)
via 46c7a9ec9748261ffc8a41112c2220ff48cc19a2 (commit)
via f38227c73347b11c0bc8be066a84be4e4509d7c2 (commit)
via e0dcd43d4bae2e2262668b982fbf1b9206cc4024 (commit)
via 066f269b2de98a9336e37b6208c55e78e6c18558 (commit)
via 2795fdc1dc4a20a054552802605d2d0edd66c2e1 (commit)
via 537e1abf0afe981e6a4e2cf1447e967053c23072 (commit)
via 4347f3887fac8b13e2c358613922b58f7e7fdbad (commit)
via f2e80477601641c8c313dd204abeda41fed787e7 (commit)
from b1a11f087f1528dffaa89101ba350442fd355c39 (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/e1b5f794f78ad91dcbe01589994cdb76d5507997
commit e1b5f794f78ad91dcbe01589994cdb76d5507997
Merge: 066f269 46c7a9e
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:55:29 2015 +0300
Merge branch '2.1'
http://sourceforge.net/p/sqlobject/sqlobject/ci/46c7a9ec9748261ffc8a41112c2220ff48cc19a2
commit 46c7a9ec9748261ffc8a41112c2220ff48cc19a2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:49:13 2015 +0300
MySQLConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index 6ace404..1b15502 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,9 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
-* PostgresConnection and SQLiteConnection have got a new method
- listDatabases() that lists databases in the connection and returns a
- list of names.
+* MySQLConnection, PostgresConnection and SQLiteConnection have got
+ a new method listDatabases() that lists databases in the connection
+ and returns a list of names.
SQLObject 2.0.0
===============
diff --git a/docs/TODO.txt b/docs/TODO.txt
index 9334565..43ef935 100644
--- a/docs/TODO.txt
+++ b/docs/TODO.txt
@@ -16,8 +16,6 @@ TODO
* SQLObject.fastInsert().
-* List databases in the connection.
-
* List tables/indices in the DB. The query in MySQL is ``SHOW TABLES``;
in SQLite it is
diff --git a/sqlobject/mysql/mysqlconnection.py b/sqlobject/mysql/mysqlconnection.py
index df02b9b..f51eed6 100644
--- a/sqlobject/mysql/mysqlconnection.py
+++ b/sqlobject/mysql/mysqlconnection.py
@@ -297,6 +297,9 @@ class MySQLConnection(DBAPI):
else:
return col.Col, {}
+ def listDatabases(self):
+ return [v[0] for v in self.queryAll("SHOW DATABASES")]
+
def _createOrDropDatabase(self, op="CREATE"):
self.query('%s DATABASE %s' % (op, self.db))
diff --git a/sqlobject/tests/test_mysql.py b/sqlobject/tests/test_mysql.py
new file mode 100644
index 0000000..c22a0ed
--- /dev/null
+++ b/sqlobject/tests/test_mysql.py
@@ -0,0 +1,8 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "mysql":
+ return
+ assert connection.db in connection.listDatabases()
http://sourceforge.net/p/sqlobject/sqlobject/ci/f38227c73347b11c0bc8be066a84be4e4509d7c2
commit f38227c73347b11c0bc8be066a84be4e4509d7c2
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:41:56 2015 +0300
PostgresConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index ad9f168..6ace404 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,8 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
-* SQLiteConnection has got a new method listDatabases() that list
- databases in the connection and return a list of names.
+* PostgresConnection and SQLiteConnection have got a new method
+ listDatabases() that lists databases in the connection and returns a
+ list of names.
SQLObject 2.0.0
===============
diff --git a/sqlobject/postgres/pgconnection.py b/sqlobject/postgres/pgconnection.py
index 1f94ee3..6809ab6 100644
--- a/sqlobject/postgres/pgconnection.py
+++ b/sqlobject/postgres/pgconnection.py
@@ -426,6 +426,9 @@ class PostgresConnection(DBAPI):
cur.close()
conn.close()
+ def listDatabases(self):
+ return [v[0] for v in self.queryAll("SELECT datname FROM pg_database")]
+
def createEmptyDatabase(self):
self._createOrDropDatabase()
diff --git a/sqlobject/tests/test_postgres.py b/sqlobject/tests/test_postgres.py
new file mode 100644
index 0000000..abf6674
--- /dev/null
+++ b/sqlobject/tests/test_postgres.py
@@ -0,0 +1,8 @@
+from sqlobject import *
+from sqlobject.tests.dbtest import *
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "postgres":
+ return
+ assert connection.db in connection.listDatabases()
http://sourceforge.net/p/sqlobject/sqlobject/ci/e0dcd43d4bae2e2262668b982fbf1b9206cc4024
commit e0dcd43d4bae2e2262668b982fbf1b9206cc4024
Author: Oleg Broytman <ph...@ph...>
Date: Tue Jan 6 00:31:37 2015 +0300
SQLiteConnection has got a new method listDatabases
diff --git a/docs/News.txt b/docs/News.txt
index 8bb3165..ad9f168 100644
--- a/docs/News.txt
+++ b/docs/News.txt
@@ -21,6 +21,9 @@ Minor features
* Tables in SELECT...FROM clause are sorted alphabetically.
+* SQLiteConnection has got a new method listDatabases() that list
+ databases in the connection and return a list of names.
+
SQLObject 2.0.0
===============
diff --git a/sqlobject/sqlite/sqliteconnection.py b/sqlobject/sqlite/sqliteconnection.py
index 66a6e04..452fd1c 100644
--- a/sqlobject/sqlite/sqliteconnection.py
+++ b/sqlobject/sqlite/sqliteconnection.py
@@ -397,6 +397,12 @@ class SQLiteConnection(DBAPI):
else:
return col.Col, {}
+ def listDatabases(self):
+ results = []
+ for index, name, filename in self.queryAll("PRAGMA database_list"):
+ results.append(name)
+ return results
+
def createEmptyDatabase(self):
if self._memory:
return
diff --git a/sqlobject/tests/test_sqlite.py b/sqlobject/tests/test_sqlite.py
index 136e7f4..3d5d4a4 100644
--- a/sqlobject/tests/test_sqlite.py
+++ b/sqlobject/tests/test_sqlite.py
@@ -117,3 +117,9 @@ def test_memorydb():
connection.close() # create a new connection to an in-memory database
TestSO1.setConnection(connection)
TestSO1.createTable()
+
+def test_list_databases():
+ connection = getConnection()
+ if connection.dbName != "sqlite":
+ return
+ assert connection.listDatabases() == ['main']
http://sourceforge.net/p/sqlobject/sqlobject/ci/066f269b2de98a9336e37b6208c55e78e6c18558
commit 066f269b2de98a9336e37b6208c55e78e6c18558
Author: Oleg Broytman <ph...@ph...>
Date: Mon Jan 5 00:36:27 2015 +0300
Run flake8 with default number of jobs
The problem with threads was fixed in flake8 2.3.0.
diff --git a/setup.cfg b/setup.cfg
index b041d96..65d890f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,10 +10,6 @@ tag_svn_revision = 0
[flake8]
exclude = .git,docs/europython/*.py,ez_setup.py
-; flake8 has problems when running with number of threads >1
-; see https://gitlab.com/pycqa/flake8/issues/17
-jobs = 1
-
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
; E124: closing bracket does not match visual indentation
http://sourceforge.net/p/sqlobject/sqlobject/ci/2795fdc1dc4a20a054552802605d2d0edd66c2e1
commit 2795fdc1dc4a20a054552802605d2d0edd66c2e1
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 23:14:56 2015 +0300
Run flake8 with 1 thread
diff --git a/setup.cfg b/setup.cfg
index 65d890f..b041d96 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -10,6 +10,10 @@ tag_svn_revision = 0
[flake8]
exclude = .git,docs/europython/*.py,ez_setup.py
+; flake8 has problems when running with number of threads >1
+; see https://gitlab.com/pycqa/flake8/issues/17
+jobs = 1
+
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
; E124: closing bracket does not match visual indentation
http://sourceforge.net/p/sqlobject/sqlobject/ci/537e1abf0afe981e6a4e2cf1447e967053c23072
commit 537e1abf0afe981e6a4e2cf1447e967053c23072
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 22:24:31 2015 +0300
flake8: exclude ez_setup.py
diff --git a/setup.cfg b/setup.cfg
index 09bbe8d..65d890f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,7 +8,7 @@ tag_date = 1
tag_svn_revision = 0
[flake8]
-exclude = .git,docs/europython/*.py
+exclude = .git,docs/europython/*.py,ez_setup.py
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
http://sourceforge.net/p/sqlobject/sqlobject/ci/4347f3887fac8b13e2c358613922b58f7e7fdbad
commit 4347f3887fac8b13e2c358613922b58f7e7fdbad
Author: Oleg Broytman <ph...@ph...>
Date: Sun Jan 4 22:23:04 2015 +0300
flake8: exclude old europython slides
diff --git a/setup.cfg b/setup.cfg
index 9aee39f..09bbe8d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,7 +8,7 @@ tag_date = 1
tag_svn_revision = 0
[flake8]
-exclude = .git,docs/europython/europython_sqlobj.py
+exclude = .git,docs/europython/*.py
; Ignore:
; E123: closing bracket does not match indentation of opening bracket's line
http://sourceforge.net/p/sqlobject/sqlobject/ci/f2e80477601641c8c313dd204abeda41fed787e7
commit f2e80477601641c8c313dd204abeda41fed787e7
Author: Oleg Broytman <ph...@ph...>
Date: Sat Jan 3 17:10:20 2015 +0300
Silence the most obnoxious errors from flake8
diff --git a/setup.cfg b/setup.cfg
index bfc84e6..9aee39f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -7,6 +7,29 @@ tag_build = dev
tag_date = 1
tag_svn_revision = 0
+[flake8]
+exclude = .git,docs/europython/europython_sqlobj.py
+
+; Ignore:
+; E123: closing bracket does not match indentation of opening bracket's line
+; E124: closing bracket does not match visual indentation
+; E126: continuation line over-indented for hanging indent
+; E127: continuation line over-indented for visual indent
+; E128: continuation line under-indented for visual indent
+; E221 multiple spaces before operator
+; E225: missing whitespace around operator
+; E226 missing whitespace around arithmetic operator
+; E231 missing whitespace after ','
+; E261: at least two spaces before inline comment
+; E265 block comment should start with '# '
+; E301 expected 1 blank line, found 0
+; E302: expected 2 blank lines, found <n>
+; E401: multiple imports on one line
+; E501 line too long (168 > 79 characters)
+; E502 the backslash is redundant between brackets
+; E701: multiple statements on one line (colon)
+ignore = E123,E124,E126,E127,E128,E221,E225,E226,E231,E261,E265,E301,E302,E401,E501,E502,E701,F
+
[pudge]
theme = pythonpaste.org
docs = docs/index.txt docs/Authors.txt docs/DeveloperGuide.txt docs/FAQ.txt
-----------------------------------------------------------------------
Summary of changes:
docs/News.txt | 4 ++++
docs/TODO.txt | 2 --
setup.cfg | 23 +++++++++++++++++++++++
sqlobject/mysql/mysqlconnection.py | 3 +++
sqlobject/postgres/pgconnection.py | 3 +++
sqlobject/sqlite/sqliteconnection.py | 6 ++++++
sqlobject/tests/test_mysql.py | 8 ++++++++
sqlobject/tests/test_postgres.py | 8 ++++++++
sqlobject/tests/test_sqlite.py | 6 ++++++
9 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 sqlobject/tests/test_mysql.py
create mode 100644 sqlobject/tests/test_postgres.py
hooks/post-receive
--
SQLObject development repository
|