Merge lp:~mardy/account-plugins/account-console-1309433 into lp:account-plugins

Proposed by Alberto Mardegan
Status: Merged
Approved by: Alberto Mardegan
Approved revision: 176
Merged at revision: 176
Proposed branch: lp:~mardy/account-plugins/account-console-1309433
Merge into: lp:account-plugins
Diff against target: 92 lines (+10/-10)
1 file modified
tools/account-console (+10/-10)
To merge this branch: bzr merge lp:~mardy/account-plugins/account-console-1309433
Reviewer Review Type Date Requested Status
Online Accounts Pending
Review via email: mp+309820@code.launchpad.net

Commit message

Fix error handling in account-console

Description of the change

Fix error handling in account-console

To post a comment you must log in.

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 2013-02-08 16:08:15 +0000
+++ tools/account-console 2016-11-02 08:27:58 +0000
@@ -33,7 +33,7 @@
33 self.args = args33 self.args = args
34 account = self.manager.get_account(args.account)34 account = self.manager.get_account(args.account)
35 if not account:35 if not account:
36 print >> sys.stderr, 'Account "%s" not found' % args.account36 print('Account "%s" not found' % args.account, file=sys.stderr)
37 sys.exit(1)37 sys.exit(1)
3838
39 enabledness = 'enabled' if account.get_enabled() else 'disabled'39 enabledness = 'enabled' if account.get_enabled() else 'disabled'
@@ -65,14 +65,14 @@
65 self.args = args65 self.args = args
66 account = self.manager.get_account(args.account)66 account = self.manager.get_account(args.account)
67 if not account:67 if not account:
68 print >> sys.stderr, 'Account "%s" not found' % args.account68 print('Account "%s" not found' % args.account, file=sys.stderr)
69 sys.exit(1)69 sys.exit(1)
70 self.account = account70 self.account = account
7171
72 if args.service:72 if args.service:
73 service = self.manager.get_service(args.service)73 service = self.manager.get_service(args.service)
74 if not service:74 if not service:
75 print >> sys.stderr, 'Service "%s" not found' % args.service75 print('Service "%s" not found' % args.service, file=sys.stderr)
76 sys.exit(1)76 sys.exit(1)
77 account.select_service(service)77 account.select_service(service)
7878
@@ -105,7 +105,7 @@
105105
106 def on_info_ready(self, identity, info, error, userdata):106 def on_info_ready(self, identity, info, error, userdata):
107 if error:107 if error:
108 print >> sys.stderr, 'Couldn\'t get identity info'108 print('Couldn\'t get identity info', file=sys.stderr)
109 sys.exit(1)109 sys.exit(1)
110110
111 self.write_signon_info(info)111 self.write_signon_info(info)
@@ -132,7 +132,7 @@
132 self.args = args132 self.args = args
133 account = self.manager.get_account(args.account)133 account = self.manager.get_account(args.account)
134 if not account:134 if not account:
135 print >> sys.stderr, 'Account "%s" not found' % args.account135 print('Account "%s" not found' % args.account, file=sys.stderr)
136 sys.exit(1)136 sys.exit(1)
137137
138 account.delete()138 account.delete()
@@ -152,7 +152,7 @@
152 self.args = args152 self.args = args
153 account = self.manager.get_account(args.account)153 account = self.manager.get_account(args.account)
154 if not account:154 if not account:
155 print >> sys.stderr, 'Account "%s" not found' % args.account155 print('Account "%s" not found' % args.account, file=sys.stderr)
156 sys.exit(1)156 sys.exit(1)
157 self.account = account157 self.account = account
158158
@@ -160,7 +160,7 @@
160 if args.service:160 if args.service:
161 service = self.manager.get_service(args.service)161 service = self.manager.get_service(args.service)
162 if not service:162 if not service:
163 print >> sys.stderr, 'Service "%s" not found' % args.service163 print('Service "%s" not found' % args.service, file=sys.stderr)
164 sys.exit(1)164 sys.exit(1)
165165
166 account_service = Accounts.AccountService.new(account, service)166 account_service = Accounts.AccountService.new(account, service)
@@ -211,7 +211,7 @@
211211
212 def login_process_cb(self, session, reply, error, userdata):212 def login_process_cb(self, session, reply, error, userdata):
213 if error:213 if error:
214 print >> sys.stderr, 'Got authentication error:', error.message214 print('Got authentication error: %s' % error.message, file=sys.stderr)
215 sys.exit(1)215 sys.exit(1)
216216
217 print('Got reply: ', reply)217 print('Got reply: ', reply)
@@ -222,7 +222,7 @@
222 if not error:222 if not error:
223 print('OK')223 print('OK')
224 else:224 else:
225 print >> sys.stderr, 'Error occurred: ', error.message225 print('Error occurred: %s' % error.message, file=sys.stderr)
226 main_loop.quit()226 main_loop.quit()
227227
228 def on_account_stored(self, account, error, userdata):228 def on_account_stored(self, account, error, userdata):
@@ -232,7 +232,7 @@
232 else:232 else:
233 print('OK %s' % (account.id))233 print('OK %s' % (account.id))
234 else:234 else:
235 print >> sys.stderr, 'Error occurred: ', error.message235 print('Error occurred: %s' % error.message, file=sys.stderr)
236 main_loop.quit()236 main_loop.quit()
237237
238 def enumerate_settings(self, iterator):238 def enumerate_settings(self, iterator):

Subscribers

People subscribed via source and target branches