Merge lp://qastaging/~thisfred/desktopcouch/split-attempt-2 into lp://qastaging/desktopcouch

Proposed by Eric Casteleijn
Status: Merged
Approved by: Eric Casteleijn
Approved revision: 226
Merged at revision: 216
Proposed branch: lp://qastaging/~thisfred/desktopcouch/split-attempt-2
Merge into: lp://qastaging/desktopcouch
Diff against target: 4040 lines (+1093/-878)
78 files modified
bin/desktopcouch-pair (+1/-1)
desktopcouch/__init__.py (+1/-0)
desktopcouch/application/local_files.py (+67/-53)
desktopcouch/application/migration/__init__.py (+3/-3)
desktopcouch/application/migration/tests/test_migration.py (+6/-6)
desktopcouch/application/pair/couchdb_pairing/couchdb_io.py (+5/-5)
desktopcouch/application/pair/couchdb_pairing/dbus_io.py (+65/-40)
desktopcouch/application/pair/couchdb_pairing/network_io.py (+68/-58)
desktopcouch/application/pair/couchdb_pairing/ubuntuone_pairing.py (+1/-1)
desktopcouch/application/pair/tests/test_couchdb_io.py (+4/-4)
desktopcouch/application/pair/tests/test_network_io.py (+47/-125)
desktopcouch/application/pair/tests/test_ubuntuone_pairing.py (+2/-2)
desktopcouch/application/platform/__init__.py (+17/-9)
desktopcouch/application/platform/linux/ipc.py (+11/-5)
desktopcouch/application/platform/linux/keyring.py (+24/-19)
desktopcouch/application/replication.py (+48/-31)
desktopcouch/application/replication_services/ubuntuone.py (+20/-10)
desktopcouch/application/service.py (+34/-31)
desktopcouch/application/start_local_couchdb.py (+2/-2)
desktopcouch/application/stop_local_couchdb.py (+6/-2)
desktopcouch/application/tests/__init__.py (+53/-31)
desktopcouch/application/tests/test_local_files.py (+34/-19)
desktopcouch/application/tests/test_replication.py (+17/-10)
desktopcouch/application/tests/test_service.py (+20/-16)
desktopcouch/application/tests/test_start_local_couchdb.py (+7/-3)
desktopcouch/bookmarks/__init__.py (+0/-20)
desktopcouch/bookmarks/record.py (+9/-0)
desktopcouch/contacts/__init__.py (+0/-20)
desktopcouch/contacts/record.py (+9/-0)
desktopcouch/contacts/view.py (+9/-0)
desktopcouch/local_files.py (+9/-0)
desktopcouch/notes/__init__.py (+0/-19)
desktopcouch/notes/record.py (+9/-0)
desktopcouch/notes/tests/__init__.py (+0/-18)
desktopcouch/pair/__init__.py (+9/-0)
desktopcouch/pair/couchdb_pairing/__init__.py (+1/-0)
desktopcouch/pair/couchdb_pairing/couchdb_io.py (+10/-0)
desktopcouch/pair/couchdb_pairing/dbus_io.py (+10/-0)
desktopcouch/pair/couchdb_pairing/network_io.py (+10/-0)
desktopcouch/pair/couchdb_pairing/ubuntuone_pairing.py (+10/-0)
desktopcouch/records/__init__.py (+0/-23)
desktopcouch/records/doc/an_example_application.txt (+3/-3)
desktopcouch/records/doc/field_registry.txt (+1/-1)
desktopcouch/records/doc/records.txt (+1/-1)
desktopcouch/records/field_registry.py (+1/-1)
desktopcouch/records/server.py (+5/-4)
desktopcouch/records/server_base.py (+11/-6)
desktopcouch/records/tests/test_field_registry.py (+1/-1)
desktopcouch/records/tests/test_record.py (+4/-4)
desktopcouch/records/tests/test_server.py (+4/-4)
desktopcouch/recordtypes/__init__.py (+1/-0)
desktopcouch/recordtypes/bookmarks.py (+14/-6)
desktopcouch/recordtypes/contacts/__init__.py (+2/-2)
desktopcouch/recordtypes/contacts/testing/create.py (+23/-9)
desktopcouch/recordtypes/contacts/tests/__init__.py (+2/-3)
desktopcouch/recordtypes/contacts/tests/test_create.py (+15/-13)
desktopcouch/recordtypes/contacts/tests/test_record.py (+1/-1)
desktopcouch/recordtypes/contacts/tests/test_view.py (+220/-62)
desktopcouch/recordtypes/contacts/view.py (+1/-1)
desktopcouch/recordtypes/notes.py (+1/-1)
desktopcouch/recordtypes/tasks.py (+1/-1)
desktopcouch/recordtypes/tests/__init__.py (+1/-0)
desktopcouch/recordtypes/tests/test_bookmarks.py (+1/-2)
desktopcouch/recordtypes/tests/test_notes.py (+1/-1)
desktopcouch/recordtypes/tests/test_tasks.py (+1/-1)
desktopcouch/replication.py (+9/-0)
desktopcouch/replication_services/__init__.py (+10/-0)
desktopcouch/replication_services/example.py (+10/-0)
desktopcouch/replication_services/ubuntuone.py (+10/-0)
desktopcouch/service.py (+9/-0)
desktopcouch/start_local_couchdb.py (+16/-0)
desktopcouch/stop_local_couchdb.py (+15/-0)
desktopcouch/tasks/__init__.py (+0/-19)
desktopcouch/tasks/record.py (+9/-0)
desktopcouch/tests/__init__.py (+9/-0)
desktopcouch/util.py (+9/-0)
po/desktopcouch.pot (+0/-137)
runtests.py (+13/-8)
To merge this branch: bzr merge lp://qastaging/~thisfred/desktopcouch/split-attempt-2
Reviewer Review Type Date Requested Status
dobey (community) Abstain
Vincenzo Di Somma (community) Approve
Manuel de la Peña (community) Approve
Chad Miller (community) Approve
Review via email: mp+41257@code.qastaging.launchpad.net

Commit message

This reorganizes the code in preparation for the actual split into two or more packages. All the old import paths should still work.

Description of the change

This reorganizes the code in preparation for the actual split into two or more packages. All the old import paths should still work.

This had so much lint that it wasn't funny, and I'm not doing that again, so be prepared to be shouted at, or at least passive aggressively leered at when creating new lint issues. Shit looked like Perl.

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

I escaped a *lot* of lint issues that will need looking at at some point, because I wasn't really able whether judge if pylint was full of it, or these were really problems/bugs. Please look at the parts of the code you are most familiar with.

I left all XXX/FIXME/TODO issues unescaped (and even added a few), so that we'll keep seeing them, and hopefully fix them.

The other issues left are refactoring hints, which I think will be useful, but I didn't fell like fixem them now. We went from something like 600 issues to something like 20, though.

Revision history for this message
Chad Miller (cmiller) wrote :

200 - logging.exception("failed to back-up %s" % (srcname,))
201 + logging.exception("failed to back-up %s", (srcname,))

Shouldn't be a tuple now.

236 - super(Exception, self).__init__()
237 + super(NoOAuthTokenException, self).__init__()

Good catch. I wonder where that came from.

1895 + # XXX: is this here to swallow exceptions or ny mistake?

It's there to swallow exceptions. It's okay if couchdb isn't running.

2013 - logging.warn("There is no keyring to store our admin credentials.")
2014 + pass
2015 + ## logging.warn(
2016 + ## "There is no keyring to store our admin credentials.")
2017 except gnomekeyring.CancelledError:
2018 - logging.warn("There is no keyring to store our admin credentials.")
2019 + pass
2020 + ## logging.warn(
2021 + ## "There is no keyring to store our admin credentials.")

I don't understand this change.

2323 - self._mainloop.stop
2324 + # XXX: call this?
2325 + self._mainloop.stop # pylint: disable=W0104

Hrm, good question. Mocker is interesting this way. I'll look into this.

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

> 200 - logging.exception("failed to back-up %s" %
> (srcname,))
> 201 + logging.exception("failed to back-up %s",
> (srcname,))
>
> Shouldn't be a tuple now.

Ah, will fix.

>
> 236 - super(Exception, self).__init__()
> 237 + super(NoOAuthTokenException, self).__init__()
>
> Good catch. I wonder where that came from.
>
>
> 1895 + # XXX: is this here to swallow exceptions or ny
> mistake?
>
> It's there to swallow exceptions. It's okay if couchdb isn't running.

Will remove the comment

>
> 2013 - logging.warn("There is no keyring to store our admin
> credentials.")
> 2014 + pass
> 2015 + ## logging.warn(
> 2016 + ## "There is no keyring to store our admin
> credentials.")
> 2017 except gnomekeyring.CancelledError:
> 2018 - logging.warn("There is no keyring to store our admin
> credentials.")
> 2019 + pass
> 2020 + ## logging.warn(
> 2021 + ## "There is no keyring to store our admin
> credentials.")
>
> I don't understand this change.

"logging" is an unknown name, there is nothing by that name defined or imported, so this code coukd only error.

>
> 2323 - self._mainloop.stop
> 2324 + # XXX: call this?
> 2325 + self._mainloop.stop # pylint: disable=W0104
>
> Hrm, good question. Mocker is interesting this way. I'll look into this.

Cool, I have no idea either :)

Revision history for this message
Chad Miller (cmiller) :
review: Approve
Revision history for this message
Manuel de la Peña (mandel) wrote :

Wow, huge branch, I've done my best to find errors, but did not manage ;)

review: Approve
Revision history for this message
dobey (dobey) wrote :

1408 except gnomekeyring.NoKeyringDaemonError:
1409 - logging.warn("There is no keyring to store our admin credentials.")
1410 + logging.warn(
1411 + "There is no keyring to store our admin credentials.")
1412 except gnomekeyring.CancelledError:
1413 - logging.warn("There is no keyring to store our admin credentials.")
1414 + logging.warn(
1415 + "There is no keyring to store our admin credentials.")
1416 except gnomekeyring.IOError:
1417 - logging.warn("There is no keyring to store our admin credentials.")
1418 + logging.warn(
1419 + "There is no keyring to store our admin credentials.")

These should be a single exception clause, rather than repeating the same string N times. If there is intent on providing additional information based on exception time, we should do that instead of just duplicating messages.

2011 except gnomekeyring.NoKeyringDaemonError:
2012 - logging.warn("There is no keyring to store our admin credentials.")
2013 + pass
2014 + ## logging.warn(
2015 + ## "There is no keyring to store our admin credentials.")
2016 except gnomekeyring.CancelledError:
2017 - logging.warn("There is no keyring to store our admin credentials.")
2018 + pass
2019 + ## logging.warn(
2020 + ## "There is no keyring to store our admin credentials.")

2042 except gnomekeyring.NoKeyringDaemonError:
2043 # in this case we do not have a major issue, continue and return
2044 - logging.warn("There is no keyring to store our oauth credentials.")
2045 + pass
2046 + ## logging.warn(
2047 + ## "There is no keyring to store our oauth credentials.")
2048 +
2049 except gnomekeyring.CancelledError:
2050 # in this case we do not have a major issue, continue and return
2051 - logging.warn("There is no keyring to store our admin credentials.")
2052 + pass
2053 + ## logging.warn(
2054 + ## "There is no keyring to store our admin credentials.")

These two sections of code in the tests should also be compressed into single except clauses I think, and should not just comment out code, but either import the logging module or just remove the code.

review: Needs Fixing
Revision history for this message
Vincenzo Di Somma (vds) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

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

Dobey, I filed bug #680076 to fix the issues you reported.

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

Attempt to merge into lp:desktopcouch failed due to conflicts:

text conflict in desktopcouch/records/tests/test_record.py
contents conflict in po/desktopcouch.pot

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

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