Merge lp:~mardy/account-plugins/fix-tool-identity into lp:account-plugins

Proposed by Alberto Mardegan
Status: Merged
Approved by: David King
Approved revision: 79
Merged at revision: 79
Proposed branch: lp:~mardy/account-plugins/fix-tool-identity
Merge into: lp:account-plugins
Diff against target: 40 lines (+7/-8)
1 file modified
tools/account-console (+7/-8)
To merge this branch: bzr merge lp:~mardy/account-plugins/fix-tool-identity
Reviewer Review Type Date Requested Status
David King (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+135864@code.launchpad.net

Description of the change

account-console: don't fail on missing Identity

Also, don't let the program crash when no arguments are given, and remove
unnecessary debug output.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
David King (amigadave) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'tools/account-console'
--- tools/account-console 2012-08-29 07:54:32 +0000
+++ tools/account-console 2012-11-23 10:51:34 +0000
@@ -92,7 +92,7 @@
92 value = GObject.Value()92 value = GObject.Value()
93 value.init(GObject.TYPE_UINT)93 value.init(GObject.TYPE_UINT)
94 signon_id = account.get_value(args.signon_id_field, value)94 signon_id = account.get_value(args.signon_id_field, value)
95 if signon_id != Accounts.SettingSource.NONE:95 if signon_id != Accounts.SettingSource.NONE and value.get_uint() != 0:
96 self.identity = Signon.Identity.new_from_db(value.get_uint())96 self.identity = Signon.Identity.new_from_db(value.get_uint())
97 self.identity.query_info(self.on_info_ready, None)97 self.identity.query_info(self.on_info_ready, None)
98 else:98 else:
@@ -124,12 +124,10 @@
124124
125125
126 def on_credentials_stored(self, identity, id, error, account):126 def on_credentials_stored(self, identity, id, error, account):
127 print('On credentials stored', id)
128 account.set_value(self.args.signon_id_field, int(id))127 account.set_value(self.args.signon_id_field, int(id))
129 account.store(self.on_account_stored, None)128 account.store(self.on_account_stored, None)
130129
131130
132
133 def delete_account(self, args):131 def delete_account(self, args):
134 self.args = args132 self.args = args
135 account = self.manager.get_account(args.account)133 account = self.manager.get_account(args.account)
@@ -356,9 +354,10 @@
356subparser.set_defaults(func=app.login_account)354subparser.set_defaults(func=app.login_account)
357355
358args = parser.parse_args()356args = parser.parse_args()
359357if 'func' in args:
360main_loop = GLib.MainLoop()358 main_loop = GLib.MainLoop()
361GLib.idle_add(args.func, args)359 GLib.idle_add(args.func, args)
362360 main_loop.run()
363main_loop.run()361else:
362 parser.print_help()
364363

Subscribers

People subscribed via source and target branches