diff options
author | Shane Wang <shane.wang@intel.com> | 2012-03-16 15:17:37 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-03-20 15:21:33 +0000 |
commit | 491c87d1674b0447aa2e37d67bcba3aa55eec677 (patch) | |
tree | 6ce2f3f00f6e0f3e8fb4ba1c6a3c86542226e7bf | |
parent | 9ecdbc377c6ab6848afb0a378c5804918951f6b7 (diff) | |
download | poky-491c87d1674b0447aa2e37d67bcba3aa55eec677.tar.gz |
Hob: fix '!= None' and '== None' in the code
This patch is to fix the following:
if foo != None -----> if foo
if foo == None -----> if not foo
(From Poky rev: d771343b1726f166ed8d75543ba68bd2a20aee7b)
(Bitbake rev: 23c140a4d00293d922cbd34b6b837493cac2e93a)
Signed-off-by: Shane Wang <shane.wang@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobeventhandler.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hoblistmodel.py | 2 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/hobpages.py | 4 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/hobwidget.py | 6 | ||||
-rwxr-xr-x | bitbake/lib/bb/ui/crumbs/imagedetailspage.py | 12 | ||||
-rw-r--r-- | bitbake/lib/bb/ui/crumbs/runningbuild.py | 4 |
6 files changed, 16 insertions, 16 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py index 790e2ef819..1e1151e7ae 100644 --- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py +++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py | |||
@@ -119,7 +119,7 @@ class HobHandler(gobject.GObject): | |||
119 | self.generating = False | 119 | self.generating = False |
120 | 120 | ||
121 | def run_next_command(self, initcmd=None): | 121 | def run_next_command(self, initcmd=None): |
122 | if initcmd != None: | 122 | if initcmd: |
123 | self.initcmd = initcmd | 123 | self.initcmd = initcmd |
124 | 124 | ||
125 | if self.commands_async: | 125 | if self.commands_async: |
@@ -127,7 +127,7 @@ class HobHandler(gobject.GObject): | |||
127 | next_command = self.commands_async.pop(0) | 127 | next_command = self.commands_async.pop(0) |
128 | else: | 128 | else: |
129 | self.clear_busy() | 129 | self.clear_busy() |
130 | if self.initcmd != None: | 130 | if self.initcmd: |
131 | self.emit("command-succeeded", self.initcmd) | 131 | self.emit("command-succeeded", self.initcmd) |
132 | return | 132 | return |
133 | 133 | ||
diff --git a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py index caf31bc325..69e13cf9fe 100644 --- a/bitbake/lib/bb/ui/crumbs/hoblistmodel.py +++ b/bitbake/lib/bb/ui/crumbs/hoblistmodel.py | |||
@@ -713,7 +713,7 @@ class RecipeListModel(gtk.ListStore): | |||
713 | return None | 713 | return None |
714 | 714 | ||
715 | def set_selected_image(self, img): | 715 | def set_selected_image(self, img): |
716 | if img == None: | 716 | if not img: |
717 | return | 717 | return |
718 | path = self.find_path_for_item(img) | 718 | path = self.find_path_for_item(img) |
719 | self.include_item(item_path=path, | 719 | self.include_item(item_path=path, |
diff --git a/bitbake/lib/bb/ui/crumbs/hobpages.py b/bitbake/lib/bb/ui/crumbs/hobpages.py index bd4b292381..63ee3dd835 100755 --- a/bitbake/lib/bb/ui/crumbs/hobpages.py +++ b/bitbake/lib/bb/ui/crumbs/hobpages.py | |||
@@ -34,7 +34,7 @@ class HobPage (gtk.VBox): | |||
34 | self.builder = builder | 34 | self.builder = builder |
35 | self.builder_width, self.builder_height = self.builder.size_request() | 35 | self.builder_width, self.builder_height = self.builder.size_request() |
36 | 36 | ||
37 | if title == None: | 37 | if not title: |
38 | self.title = "HOB -- Image Creator" | 38 | self.title = "HOB -- Image Creator" |
39 | else: | 39 | else: |
40 | self.title = title | 40 | self.title = title |
@@ -62,7 +62,7 @@ class HobPage (gtk.VBox): | |||
62 | label.set_markup("<span font_desc=\'14\'>%s</span>" % self.title) | 62 | label.set_markup("<span font_desc=\'14\'>%s</span>" % self.title) |
63 | hbox.pack_start(label, expand=False, fill=False, padding=20) | 63 | hbox.pack_start(label, expand=False, fill=False, padding=20) |
64 | 64 | ||
65 | if widget != None: | 65 | if widget: |
66 | # add the widget in the event box | 66 | # add the widget in the event box |
67 | hbox.pack_end(widget, expand=False, fill=False, padding=padding) | 67 | hbox.pack_end(widget, expand=False, fill=False, padding=padding) |
68 | eventbox.add(hbox) | 68 | eventbox.add(hbox) |
diff --git a/bitbake/lib/bb/ui/crumbs/hobwidget.py b/bitbake/lib/bb/ui/crumbs/hobwidget.py index 247bbd1de4..f0d9cbcc98 100644 --- a/bitbake/lib/bb/ui/crumbs/hobwidget.py +++ b/bitbake/lib/bb/ui/crumbs/hobwidget.py | |||
@@ -366,7 +366,7 @@ class HobTabBar(gtk.DrawingArea): | |||
366 | child["x"] = self.tab_x + i * self.tab_width | 366 | child["x"] = self.tab_x + i * self.tab_width |
367 | child["y"] = self.tab_y | 367 | child["y"] = self.tab_y |
368 | 368 | ||
369 | if self.blank_rectangle != None: | 369 | if self.blank_rectangle: |
370 | self.resize_blank_rectangle() | 370 | self.resize_blank_rectangle() |
371 | 371 | ||
372 | def resize_blank_rectangle(self): | 372 | def resize_blank_rectangle(self): |
@@ -553,7 +553,7 @@ class HobTabBar(gtk.DrawingArea): | |||
553 | self.queue_draw() | 553 | self.queue_draw() |
554 | 554 | ||
555 | def set_blank_size(self, x, y, w, h): | 555 | def set_blank_size(self, x, y, w, h): |
556 | if self.blank_rectangle == None or self.blank_rectangle.x != x or self.blank_rectangle.width != w: | 556 | if not self.blank_rectangle or self.blank_rectangle.x != x or self.blank_rectangle.width != w: |
557 | self.emit("blank-area-changed", x, y, w, h) | 557 | self.emit("blank-area-changed", x, y, w, h) |
558 | 558 | ||
559 | return gtk.gdk.Rectangle(x, y, w, h) | 559 | return gtk.gdk.Rectangle(x, y, w, h) |
@@ -640,7 +640,7 @@ class HobNotebook(gtk.VBox): | |||
640 | if not notebook: | 640 | if not notebook: |
641 | return | 641 | return |
642 | title = notebook.get_tab_label_text(notebook_child) | 642 | title = notebook.get_tab_label_text(notebook_child) |
643 | if title == None: | 643 | if not title: |
644 | return | 644 | return |
645 | for child in self.tabbar.children: | 645 | for child in self.tabbar.children: |
646 | if child["title"] == title: | 646 | if child["title"] == title: |
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py index c063d74228..30c25aa5d9 100755 --- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py +++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py | |||
@@ -64,9 +64,9 @@ class ImageDetailsPage (HobPage): | |||
64 | self.hbox.set_border_width(15) | 64 | self.hbox.set_border_width(15) |
65 | self.add(self.hbox) | 65 | self.add(self.hbox) |
66 | 66 | ||
67 | if widget != None: | 67 | if widget: |
68 | row = 1 | 68 | row = 1 |
69 | elif varlist != None and vallist != None: | 69 | elif varlist and vallist: |
70 | # pack the icon and the text on the left | 70 | # pack the icon and the text on the left |
71 | row = len(varlist) | 71 | row = len(varlist) |
72 | self.table = gtk.Table(row, 20, True) | 72 | self.table = gtk.Table(row, 20, True) |
@@ -75,18 +75,18 @@ class ImageDetailsPage (HobPage): | |||
75 | 75 | ||
76 | colid = 0 | 76 | colid = 0 |
77 | self.line_widgets = {} | 77 | self.line_widgets = {} |
78 | if icon != None: | 78 | if icon: |
79 | self.table.attach(icon, colid, colid + 2, 0, 1) | 79 | self.table.attach(icon, colid, colid + 2, 0, 1) |
80 | colid = colid + 2 | 80 | colid = colid + 2 |
81 | if widget != None: | 81 | if widget: |
82 | self.table.attach(widget, colid, 20, 0, 1) | 82 | self.table.attach(widget, colid, 20, 0, 1) |
83 | elif varlist != None and vallist != None: | 83 | elif varlist and vallist: |
84 | for line in range(0, row): | 84 | for line in range(0, row): |
85 | self.line_widgets[varlist[line]] = self.text2label(varlist[line], vallist[line]) | 85 | self.line_widgets[varlist[line]] = self.text2label(varlist[line], vallist[line]) |
86 | self.table.attach(self.line_widgets[varlist[line]], colid, 20, line, line + 1) | 86 | self.table.attach(self.line_widgets[varlist[line]], colid, 20, line, line + 1) |
87 | 87 | ||
88 | # pack the button on the right | 88 | # pack the button on the right |
89 | if button != None: | 89 | if button: |
90 | self.hbox.pack_end(button, expand=False, fill=False) | 90 | self.hbox.pack_end(button, expand=False, fill=False) |
91 | 91 | ||
92 | def update_line_widgets(self, variable, value): | 92 | def update_line_widgets(self, variable, value): |
diff --git a/bitbake/lib/bb/ui/crumbs/runningbuild.py b/bitbake/lib/bb/ui/crumbs/runningbuild.py index 7343a29caf..4c3fe2cedc 100644 --- a/bitbake/lib/bb/ui/crumbs/runningbuild.py +++ b/bitbake/lib/bb/ui/crumbs/runningbuild.py | |||
@@ -43,7 +43,7 @@ class RunningBuildModel (gtk.TreeStore): | |||
43 | 43 | ||
44 | def config_model_filter(self, model, it): | 44 | def config_model_filter(self, model, it): |
45 | msg = model.get(it, self.COL_MESSAGE)[0] | 45 | msg = model.get(it, self.COL_MESSAGE)[0] |
46 | if msg == None or type(msg) != str: | 46 | if not msg or type(msg) != str: |
47 | return False | 47 | return False |
48 | if msg.startswith("\nOE Build Configuration:\n"): | 48 | if msg.startswith("\nOE Build Configuration:\n"): |
49 | return True | 49 | return True |
@@ -51,7 +51,7 @@ class RunningBuildModel (gtk.TreeStore): | |||
51 | 51 | ||
52 | def failure_model_filter(self, model, it): | 52 | def failure_model_filter(self, model, it): |
53 | color = model.get(it, self.COL_COLOR)[0] | 53 | color = model.get(it, self.COL_COLOR)[0] |
54 | if color == None: | 54 | if not color: |
55 | return False | 55 | return False |
56 | if color == HobColors.ERROR: | 56 | if color == HobColors.ERROR: |
57 | return True | 57 | return True |