diff options
author | Matt Wilson <msw@redhat.com> | 2002-07-18 04:57:19 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 2002-07-18 04:57:19 +0000 |
commit | 0a7c50beb11632c613770705cc3178d807b8aca8 (patch) | |
tree | b5edd120d623f2ffbcaf2db4c8c7f30a7972c0f7 /iw | |
parent | e335604bbd1d16908532a83f68c7b18742d3fc8e (diff) | |
download | anaconda-0a7c50beb11632c613770705cc3178d807b8aca8.tar.gz anaconda-0a7c50beb11632c613770705cc3178d807b8aca8.tar.xz anaconda-0a7c50beb11632c613770705cc3178d807b8aca8.zip |
fix up test for store
Diffstat (limited to 'iw')
-rw-r--r-- | iw/checklist.py | 10 | ||||
-rw-r--r-- | iw/partition_ui_helpers_gui.py | 2 |
2 files changed, 5 insertions, 7 deletions
diff --git a/iw/checklist.py b/iw/checklist.py index f3510fe50..3d9762a3b 100644 --- a/iw/checklist.py +++ b/iw/checklist.py @@ -33,8 +33,7 @@ class CheckList (gtk.TreeView): # XXX need to handle the multicolumn case better still.... def __init__ (self, columns = 1, custom_store=None): - - if not custom_store: + if custom_store is None: self.store = gtk.TreeStore(gobject.TYPE_BOOLEAN, gobject.TYPE_STRING, gobject.TYPE_STRING) @@ -44,7 +43,7 @@ class CheckList (gtk.TreeView): gtk.TreeView.__init__ (self, self.store) # XXX we only handle two text columns right now - if custom_store == None and columns > 2: + if custom_store is None and columns > 2: raise RuntimeError, "CheckList supports a maximum of 2 columns" self.columns = columns @@ -73,14 +72,13 @@ class CheckList (gtk.TreeView): text: text to display in the row init_value: initial state of the indicator""" - textList = ("",) + textList iter = self.store.append(None) self.store.set_value(iter, 0, init_value) # add the text for the number of columns we have i = 1 - for text in textList[1:self.columns + 1]: - self.store.set_value(iter, i, textList[i]) + for text in textList[:self.columns]: + self.store.set_value(iter, i, textList[i - 1]) i = i + 1 self.num_rows = self.num_rows + 1 diff --git a/iw/partition_ui_helpers_gui.py b/iw/partition_ui_helpers_gui.py index 99bae9997..97015e641 100644 --- a/iw/partition_ui_helpers_gui.py +++ b/iw/partition_ui_helpers_gui.py @@ -40,7 +40,7 @@ class WideCheckList(checklist.CheckList): def __init__(self, columns, store, clickCB=None): checklist.CheckList.__init__(self, columns=columns, - custom_store = store) + custom_store=store) selection = self.get_selection() selection.set_mode(gtk.SELECTION_NONE) |