Merge lp:~dobey/ubuntuone-control-panel/fix-689800 into lp:ubuntuone-control-panel

Proposed by dobey
Status: Merged
Approved by: Natalia Bidart
Approved revision: 32
Merged at revision: 32
Proposed branch: lp:~dobey/ubuntuone-control-panel/fix-689800
Merge into: lp:ubuntuone-control-panel
Diff against target: 15 lines (+3/-1)
1 file modified
ubuntuone/controlpanel/dbus_service.py (+3/-1)
To merge this branch: bzr merge lp:~dobey/ubuntuone-control-panel/fix-689800
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Roberto Alsina (community) Approve
Review via email: mp+43567@code.launchpad.net

Commit message

Default to None and initialize if None in code, instead of mutable defaults

To post a comment you must log in.
Revision history for this message
Roberto Alsina (ralsina) wrote :

This is a good practice in general.

review: Approve
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Awesome catch! Thanks

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'ubuntuone/controlpanel/dbus_service.py'
--- ubuntuone/controlpanel/dbus_service.py 2010-12-09 16:59:06 +0000
+++ ubuntuone/controlpanel/dbus_service.py 2010-12-13 20:27:23 +0000
@@ -328,8 +328,10 @@
328 return dbus.service.BusName(DBUS_BUS_NAME, bus=dbus.SessionBus())328 return dbus.service.BusName(DBUS_BUS_NAME, bus=dbus.SessionBus())
329329
330330
331def publish_backend(backend=ControlBackend()):331def publish_backend(backend=None):
332 """Publish the backend on the DBus."""332 """Publish the backend on the DBus."""
333 if backend is None:
334 backend = ControlBackend()
333 return ControlPanelBackend(backend=backend,335 return ControlPanelBackend(backend=backend,
334 object_path=DBUS_PREFERENCES_PATH,336 object_path=DBUS_PREFERENCES_PATH,
335 bus_name=get_busname())337 bus_name=get_busname())

Subscribers

People subscribed via source and target branches

to all changes: