Merge lp://qastaging/~kjoller/desktopcouch/viewparams-497143-2 into lp://qastaging/desktopcouch

Proposed by Niels Kjøller Hansen
Status: Merged
Approved by: Rodrigo Moya
Approved revision: not available
Merged at revision: not available
Proposed branch: lp://qastaging/~kjoller/desktopcouch/viewparams-497143-2
Merge into: lp://qastaging/desktopcouch
Diff against target: 36 lines (+3/-7)
2 files modified
desktopcouch/records/server_base.py (+2/-6)
desktopcouch/records/tests/test_server.py (+1/-1)
To merge this branch: bzr merge lp://qastaging/~kjoller/desktopcouch/viewparams-497143-2
Reviewer Review Type Date Requested Status
Rodrigo Moya (community) Approve
Eric Casteleijn (community) Approve
Review via email: mp+19448@code.qastaging.launchpad.net

Commit message

Use more Pythonic and cleaner kwargs.

To post a comment you must log in.
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Looks good to me, I like the keyword syntax better than passing a dict, and even if I didn't, it's how couchdb-python does it, and there's not much to be gained by making a different choice.

Tests pass (or at least the two errors I get seem to be in trunk already, so I'm going to raise a stink about those elsewhere)

review: Approve
Revision history for this message
Eric Casteleijn (thisfred) wrote :

Oh, Niels, since desktopcouch is covered by the Canonical Contributor's agreement, we need you to sign that before we can merge your patch.

If you have not yet signed it, this page has instructions on how to do so:

http://www.canonical.com/contributors

review: Needs Information
Revision history for this message
Niels Kjøller Hansen (kjoller) wrote :

Hereby done

Revision history for this message
Eric Casteleijn (thisfred) wrote :

Awesome, thanks!

review: Approve
Revision history for this message
Rodrigo Moya (rodrigo-moya) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktopcouch/records/server_base.py'
2--- desktopcouch/records/server_base.py 2010-02-04 23:14:37 +0000
3+++ desktopcouch/records/server_base.py 2010-02-16 22:27:19 +0000
4@@ -349,17 +349,13 @@
5 return deleted_data
6
7 def execute_view(self, view_name, design_doc=DEFAULT_DESIGN_DOCUMENT,
8- params=None):
9+ **params):
10 """Execute view and return results."""
11 if design_doc is None:
12 design_doc = view_name
13
14 view_id_fmt = "_design/%(design_doc)s/_view/%(view_name)s"
15- if params:
16- paramdict = params
17- else:
18- paramdict = {}
19- return self.db.view(view_id_fmt % locals(), **paramdict)
20+ return self.db.view(view_id_fmt % locals(), **params)
21
22 def add_view(self, view_name, map_js, reduce_js,
23 design_doc=DEFAULT_DESIGN_DOCUMENT):
24
25=== modified file 'desktopcouch/records/tests/test_server.py'
26--- desktopcouch/records/tests/test_server.py 2010-01-29 22:14:25 +0000
27+++ desktopcouch/records/tests/test_server.py 2010-02-16 22:27:19 +0000
28@@ -396,7 +396,7 @@
29 # now request descending order and confirm that it *is* descending
30 descdata = [i.key for i in
31 list(self.database.execute_view(view1_name, design_doc,
32- {"descending": True}))]
33+ descending=True))]
34 self.assertEqual(descdata, list(reversed(sorted(data))))
35
36 self.database.delete_view(view1_name, design_doc)

Subscribers

People subscribed via source and target branches