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
1=== modified file 'tools/account-console'
2--- tools/account-console 2013-02-08 16:08:15 +0000
3+++ tools/account-console 2016-11-02 08:27:58 +0000
4@@ -33,7 +33,7 @@
5 self.args = args
6 account = self.manager.get_account(args.account)
7 if not account:
8- print >> sys.stderr, 'Account "%s" not found' % args.account
9+ print('Account "%s" not found' % args.account, file=sys.stderr)
10 sys.exit(1)
11
12 enabledness = 'enabled' if account.get_enabled() else 'disabled'
13@@ -65,14 +65,14 @@
14 self.args = args
15 account = self.manager.get_account(args.account)
16 if not account:
17- print >> sys.stderr, 'Account "%s" not found' % args.account
18+ print('Account "%s" not found' % args.account, file=sys.stderr)
19 sys.exit(1)
20 self.account = account
21
22 if args.service:
23 service = self.manager.get_service(args.service)
24 if not service:
25- print >> sys.stderr, 'Service "%s" not found' % args.service
26+ print('Service "%s" not found' % args.service, file=sys.stderr)
27 sys.exit(1)
28 account.select_service(service)
29
30@@ -105,7 +105,7 @@
31
32 def on_info_ready(self, identity, info, error, userdata):
33 if error:
34- print >> sys.stderr, 'Couldn\'t get identity info'
35+ print('Couldn\'t get identity info', file=sys.stderr)
36 sys.exit(1)
37
38 self.write_signon_info(info)
39@@ -132,7 +132,7 @@
40 self.args = args
41 account = self.manager.get_account(args.account)
42 if not account:
43- print >> sys.stderr, 'Account "%s" not found' % args.account
44+ print('Account "%s" not found' % args.account, file=sys.stderr)
45 sys.exit(1)
46
47 account.delete()
48@@ -152,7 +152,7 @@
49 self.args = args
50 account = self.manager.get_account(args.account)
51 if not account:
52- print >> sys.stderr, 'Account "%s" not found' % args.account
53+ print('Account "%s" not found' % args.account, file=sys.stderr)
54 sys.exit(1)
55 self.account = account
56
57@@ -160,7 +160,7 @@
58 if args.service:
59 service = self.manager.get_service(args.service)
60 if not service:
61- print >> sys.stderr, 'Service "%s" not found' % args.service
62+ print('Service "%s" not found' % args.service, file=sys.stderr)
63 sys.exit(1)
64
65 account_service = Accounts.AccountService.new(account, service)
66@@ -211,7 +211,7 @@
67
68 def login_process_cb(self, session, reply, error, userdata):
69 if error:
70- print >> sys.stderr, 'Got authentication error:', error.message
71+ print('Got authentication error: %s' % error.message, file=sys.stderr)
72 sys.exit(1)
73
74 print('Got reply: ', reply)
75@@ -222,7 +222,7 @@
76 if not error:
77 print('OK')
78 else:
79- print >> sys.stderr, 'Error occurred: ', error.message
80+ print('Error occurred: %s' % error.message, file=sys.stderr)
81 main_loop.quit()
82
83 def on_account_stored(self, account, error, userdata):
84@@ -232,7 +232,7 @@
85 else:
86 print('OK %s' % (account.id))
87 else:
88- print >> sys.stderr, 'Error occurred: ', error.message
89+ print('Error occurred: %s' % error.message, file=sys.stderr)
90 main_loop.quit()
91
92 def enumerate_settings(self, iterator):

Subscribers

People subscribed via source and target branches