Merge lp://qastaging/~thisfred/desktopcouch/remove-recordtype-from-dict into lp://qastaging/desktopcouch

Proposed by Eric Casteleijn
Status: Merged
Approved by: Vincenzo Di Somma
Approved revision: 218
Merged at revision: 207
Proposed branch: lp://qastaging/~thisfred/desktopcouch/remove-recordtype-from-dict
Merge into: lp://qastaging/desktopcouch
Diff against target: 444 lines (+116/-69)
6 files modified
desktopcouch/contacts/tests/test_record.py (+2/-3)
desktopcouch/records/doc/an_example_application.txt (+1/-1)
desktopcouch/records/record.py (+93/-58)
desktopcouch/records/tests/test_record.py (+17/-5)
desktopcouch/records/tests/test_server.py (+2/-1)
utilities/lint.sh (+1/-1)
To merge this branch: bzr merge lp://qastaging/~thisfred/desktopcouch/remove-recordtype-from-dict
Reviewer Review Type Date Requested Status
Vincenzo Di Somma (community) Approve
Nicola Larosa (community) Approve
Review via email: mp+40916@code.qastaging.launchpad.net

Commit message

Fixes #674487 where the record_type ended up in the dictionary of the record, where almost all client code had to filter it out again.
Fixes #669133 because the record_type version was never saved to CouchDB.
Fixes #575772 where the couchdb attachments API was defined on the wrong class.
Fixes #675787 where MergeableList.pop() could not be called without an index.

Description of the change

Fixed too much on this branch because I got a little frustrated with the number of bugs I ran into. If it's impossible to review, please tell me and I'll try and split all the fixes out into their own branches...

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

Fixes #674487 where the record_type ended up in the dictionary of the record, where almost all client code had to filter it out again.
Fixes #669133 because the record_type version was never saved to CouchDB.
Fixes #575772 where the couchdb attachments API was defined on the wrong class.
Fixes #675787 where MergeableList.pop() could not be called without an index.

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

Note that the frustration is mostly aimed at myself, since this shows that I suck at reviewing and writing code, since I did at least one of those for all of the code that was buggy.

Revision history for this message
Nicola Larosa (teknico) wrote :

I like this branch. A couple comments:

- since you don't need current_value anymore here:

- for index, current_value in enumerate(self):
+ for index, _ in enumerate(self):

you might as well write:

     for index in range(len(self)):

Also, what's with the double blank lines before or after functions and methods? You only need double between classes. Don't get overboard with that automatic pep8 thing. ;-)

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

> - since you don't need current_value anymore here:
>
> - for index, current_value in enumerate(self):
> + for index, _ in enumerate(self):
>
> you might as well write:
>
> for index in range(len(self)):

Yeah that's better

> Also, what's with the double blank lines before or after functions and
> methods? You only need double between classes. Don't get overboard with that
> automatic pep8 thing. ;-)

Actually I like having two lines between top level definitions no matter what they are (so functions or Classes, *not* methods.) It makes me have to think less, and improves readability. Also a top level function and a class definition are rather similar things IMO.

218. By Eric Casteleijn

microbeautification

Revision history for this message
Vincenzo Di Somma (vds) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches