Merge lp:~seif/zeitgeist/fix-673922 into lp:zeitgeist/0.1

Proposed by Seif Lotfy
Status: Merged
Merged at revision: 1633
Proposed branch: lp:~seif/zeitgeist/fix-673922
Merge into: lp:zeitgeist/0.1
Diff against target: 33 lines (+6/-9)
1 file modified
_zeitgeist/engine/main.py (+6/-9)
To merge this branch: bzr merge lp:~seif/zeitgeist/fix-673922
Reviewer Review Type Date Requested Status
Markus Korn Approve
Review via email: mp+40734@code.launchpad.net

Description of the change

I removed rows from get_events since it is not being used at all
this fixes bug #673922

To post a comment you must log in.
lp:~seif/zeitgeist/fix-673922 updated
1633. By Seif Lotfy

updated to trunk

Revision history for this message
Markus Korn (thekorn) wrote :

Just for a reference, the last usage of the 'row' argument was removed with https://code.launchpad.net/~zeitgeist/zeitgeist/small-find-events-optimization/+merge/34065

lp:~seif/zeitgeist/fix-673922 updated
1634. By Seif Lotfy

make ids argument mandatory and chck if len(ids)== 0 instead of None

1635. By Seif Lotfy

revert len(ids)== 0 to ids == None

Revision history for this message
Markus Korn (thekorn) wrote :

looks good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '_zeitgeist/engine/main.py'
--- _zeitgeist/engine/main.py 2010-11-12 11:38:31 +0000
+++ _zeitgeist/engine/main.py 2010-11-12 16:59:53 +0000
@@ -155,23 +155,20 @@
155 getattr(self, "_" + field).value(row["subj_" + field]))155 getattr(self, "_" + field).value(row["subj_" + field]))
156 return subject156 return subject
157 157
158 def get_events(self, ids=None, rows=None, sender=None):158 def get_events(self, ids, sender=None):
159 """159 """
160 Look up a list of events.160 Look up a list of events.
161 """161 """
162 162
163 t = time.time()163 t = time.time()
164 164
165 if not ids and not rows:165 if not ids:
166 return []166 return []
167 167
168 if ids:168 rows = self._cursor.execute("""
169 rows = self._cursor.execute("""169 SELECT * FROM event_view
170 SELECT * FROM event_view170 WHERE id IN (%s)
171 WHERE id IN (%s)171 """ % ",".join("%d" % id for id in ids)).fetchall()
172 """ % ",".join("%d" % id for id in ids)).fetchall()
173 else:
174 ids = (row[0] for row in rows)
175 172
176 id_hash = defaultdict(list)173 id_hash = defaultdict(list)
177 for n, id in enumerate(ids):174 for n, id in enumerate(ids):

Subscribers

People subscribed via source and target branches