Merge lp:~mvo/weblive/new-pep8-client into lp:weblive

Proposed by Michael Vogt on 2012-08-07
Status: Needs review
Proposed branch: lp:~mvo/weblive/new-pep8-client
Merge into: lp:weblive
Prerequisite: lp:~elachuni/weblive/pep8-client
Diff against target: 56 lines (+6/-6)
1 file modified
client/weblive.py (+6/-6)
To merge this branch: bzr merge lp:~mvo/weblive/new-pep8-client
Reviewer Review Type Date Requested Status
WebLive developers 2012-08-07 Pending
Review via email: mp+118561@code.launchpad.net

Description of the change

This fixes some pep8 issues that the quantal version of pep8 complains about. It builds on top of lp:~elachuni/weblive/pep8-client

To post a comment you must log in.

Unmerged revisions

160. By Michael Vogt on 2012-08-07

use isinstance instead of comparing types as suggested by the quantal pep8 checker

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/weblive.py'
2--- client/weblive.py 2012-08-07 13:38:45 +0000
3+++ client/weblive.py 2012-08-07 13:38:45 +0000
4@@ -118,7 +118,7 @@
5 query['locale'] = locale
6 reply = self.do_query(query)
7
8- if type(reply['message']) != type([]):
9+ if not isinstance(reply['message'], []):
10 if reply['message'] == 1:
11 raise WebLiveError("Reached user limit, return false.")
12 elif reply['message'] == 2:
13@@ -145,7 +145,7 @@
14 query['action'] = 'list_everything'
15 reply = self.do_query(query)
16
17- if type(reply['message']) != type({}):
18+ if not isinstance(reply['message'], {}):
19 raise WebLiveError("Invalid value, expected '%s' and got '%s'."
20 % (type({}), type(reply['message'])))
21
22@@ -173,7 +173,7 @@
23 query['serverid'] = serverid
24 reply = self.do_query(query)
25
26- if type(reply['message']) != type([]):
27+ if not isinstance(reply['message'], []):
28 raise WebLiveError("Invalid value, expected '%s' and got '%s'."
29 % (type({}), type(reply['message'])))
30
31@@ -187,7 +187,7 @@
32 query['action'] = 'list_package_blacklist'
33 reply = self.do_query(query)
34
35- if type(reply['message']) != type([]):
36+ if not isinstance(reply['message'], []):
37 raise WebLiveError("Invalid value, expected '%s' and got '%s'."
38 % (type({}), type(reply['message'])))
39
40@@ -202,7 +202,7 @@
41 query['serverid'] = serverid
42 reply = self.do_query(query)
43
44- if type(reply['message']) != type([]):
45+ if not isinstance(reply['message'], []):
46 raise WebLiveError("Invalid value, expected '%s' and got '%s'."
47 % (type({}), type(reply['message'])))
48
49@@ -216,7 +216,7 @@
50 query['action'] = 'list_servers'
51 reply = self.do_query(query)
52
53- if type(reply['message']) != type({}):
54+ if isinstance(reply['message'], {}):
55 raise WebLiveError("Invalid value, expected '%s' and got '%s'."
56 % (type({}), type(reply['message'])))
57

Subscribers

People subscribed via source and target branches