Merge lp:~brian.curtin/ubuntuone-control-panel/autostart-clean into lp:ubuntuone-control-panel
| Status: | Merged |
|---|---|
| Approved by: | Roberto Alsina on 2012-03-26 |
| Approved revision: | 306 |
| Merged at revision: | 298 |
| Proposed branch: | lp:~brian.curtin/ubuntuone-control-panel/autostart-clean |
| Merge into: | lp:ubuntuone-control-panel |
| Diff against target: |
216 lines (+128/-0) 5 files modified
ubuntuone/controlpanel/gui/qt/gui.py (+2/-0) ubuntuone/controlpanel/gui/qt/tests/test_gui.py (+16/-0) ubuntuone/controlpanel/utils/__init__.py (+2/-0) ubuntuone/controlpanel/utils/tests/test_windows.py (+88/-0) ubuntuone/controlpanel/utils/windows.py (+20/-0) |
| To merge this branch: | bzr merge lp:~brian.curtin/ubuntuone-control-panel/autostart-clean |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Roberto Alsina (community) | 2012-03-23 | Approve on 2012-03-26 | |
| Natalia Bidart | Approve on 2012-03-26 | ||
| Manuel de la Peña (community) | Approve on 2012-03-23 | ||
|
Review via email:
|
|||
Commit Message
- Add Ubuntu One to the Windows auto-start registry key
Description of the Change
Introduce add_to_autostart (from ubuntuone-
| Manuel de la Peña (mandel) wrote : | # |
Adding tho the comments of natalia, I would call the parents setup before I do any patching or operations. Also I would not add the setup of we only have one test, but im lazy :)
- 301. By Brian Curtin on 2012-03-23
-
Removed an add_to_autostart call which is no longer needed.
| Brian Curtin (brian.curtin) wrote : | # |
Rev 301 removes the call Natalia was talking about.
Manuel: I need that ordering in the setUp because I need add_to_autostart patched before anything else up the chain runs. The add_to_autostart is called when MainWindow is created, and it's created within BaseTestCase, so I have to get patched in before then.
- 302. By Brian Curtin on 2012-03-23
-
Add docstrings to two test classes
| Natalia Bidart (nataliabidart) wrote : | # |
ubuntuone/
130: [C0111, AutoStartTestCa
ubuntuone/
162: [W0622, AutostartTestCa
ubuntuone/
22: [F0401] Unable to import '_winreg'
- 303. By Brian Curtin on 2012-03-23
-
fix lint errors
| Brian Curtin (brian.curtin) wrote : | # |
Rev 303 fixes the remaining lint issues.
| Natalia Bidart (nataliabidart) wrote : | # |
Lookis at the logic inside add_to_autostart, is there any reason to have the "else: return" in the middle of the code? Why not just:
def add_to_autostart():
"""Add syncdaemon to the session's autostart."""
if getattr(sys, "frozen", False):
sd_path = '"%s"' % os.path.
u1cp_path = '"%s"' % os.path.
with _winreg.
# pylint: disable=E0602
| Brian Curtin (brian.curtin) wrote : | # |
That was an artifact of the old implementation from ubuntuone-
- 304. By Brian Curtin on 2012-03-23
-
Remove unnecessary else/return block
| Manuel de la Peña (mandel) wrote : | # |
> Rev 301 removes the call Natalia was talking about.
>
> Manuel: I need that ordering in the setUp because I need add_to_autostart
> patched before anything else up the chain runs. The add_to_autostart is called
> when MainWindow is created, and it's created within BaseTestCase, so I have to
> get patched in before then.
Very well then.. I would have added a comment to state so to avoid stupid reviewers :)
Few things:
8 +from ubuntuone.
I know we do take a lot of effort in doing alphabetical ordered imports, can you move the import a few lines? I'm the first one to ignore this rule, but is a style we try to keep.
Besides that every thing looks good so I'll approve assuming you will order the imports!
PS: I had no idea _winreg could be a context manager!
- 305. By Brian Curtin on 2012-03-26
-
Alphabetical import ordering
- 306. By Brian Curtin on 2012-03-26
-
Add comment explaining patching order


If we're a already calling add_to_autostart from ubuntuone/ controlpanel/ gui/qt/ gui.py, why would you also add it in the wizard code?
Unless I'm missing something (please let me know), there is no need to do that. Also, semantically, the wizard is a 're usable' widget, and we would not like to leak thing like adding to autostart when using it.