[SCM] watchdog branch, master, updated. a2cd8b138dfb7297a5a7d543c17d0ac7720aec0e

1 view
Skip to first unread message

aaronsw

unread,
Aug 13, 2009, 4:32:12 PM8/13/09
to watchdo...@googlegroups.com
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 "watchdog".

The branch, master has been updated
via a2cd8b138dfb7297a5a7d543c17d0ac7720aec0e (commit)
from 5808702326ab5595d221d3468adffb287f2c1e97 (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 -----------------------------------------------------------------
commit a2cd8b138dfb7297a5a7d543c17d0ac7720aec0e
Author: Aaron Swartz <m...@aaronsw.com>
Date: Thu Aug 13 16:32:08 2009 -0400

bug fixes

-----------------------------------------------------------------------

Summary of changes:
vendor/webpy/web/db.py | 22 ++++++----------------
1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/vendor/webpy/web/db.py b/vendor/webpy/web/db.py
index 2d697cc..d205f09 100644
--- a/vendor/webpy/web/db.py
+++ b/vendor/webpy/web/db.py
@@ -704,7 +704,7 @@ class DB:
if _test: return sql_query

db_cursor = self._db_cursor()
- if seqname is not False:
+ if seqname is not False:
sql_query = self._process_insert_query(sql_query, tablename, seqname)

if isinstance(sql_query, tuple):
@@ -729,7 +729,6 @@ class DB:
"""
Inserts multiple rows into `tablename`. The `values` must be a list of dictioanries,
one for each row to be inserted, each with the same set of keys.
- Returns the list of ids of the inserted rows.
Set `seqname` to the ID if it's not the default, or to `False`
if there isn't one.

@@ -739,16 +738,15 @@ class DB:
>>> db.multiple_insert('person', values=values, _test=True)
<sql: "INSERT INTO person (name, email) VALUES ('foo', 'f...@example.com'), ('bar', 'b...@example.com')">
"""
- if _test:
- return self._multiple_insert(tablename, values, seqname, _test)
- out = []
+ doit = lambda x: self._multiple_insert(tablename, x, seqname, _test)
rows = []
for row in values:
rows.append(row)
- if len(rows) > percall:
- out.extend(self._multiple_insert(tablename, rows, seqname, _test))
+ if len(rows) >= percall:
+ doit(rows)
rows = []
- out.extend(self._multiple_insert(tablename, rows, seqname, _test))
+ doit(rows)
+ return out

def _multiple_insert(self, tablename, values, seqname=None, _test=False):
if not values:
@@ -791,16 +789,8 @@ class DB:
else:
self._db_execute(db_cursor, sql_query)

- try:
- out = db_cursor.fetchone()[0]
- out = range(out-count+1, out+1)
- except Exception:
- out = None
-
if not self.ctx.transactions:
self.ctx.commit()
- return out
-

def update(self, tables, where, vars=None, _test=False, **values):
"""


hooks/post-receive
--
watchdog

Reply all
Reply to author
Forward
0 new messages