summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Williams <crdlb@compiz-fusion.org>2008-10-22 14:17:30 -0400
committerChristopher Williams <crdlb@compiz-fusion.org>2008-10-22 14:17:30 -0400
commitbce6a19843b714e37e1c6c982b50d05fe1b0baa3 (patch)
tree13df86bdbb9e7ca26024174ad31623396a54cf09
parent31326c429868a9a1f4711d76d6d44120375234f9 (diff)
downloadccsm-bce6a19843b714e37e1c6c982b50d05fe1b0baa3.tar.gz
ccsm-bce6a19843b714e37e1c6c982b50d05fe1b0baa3.tar.bz2
Remove conditional expression for python 2.4 compatibility
-rw-r--r--ccm/Settings.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ccm/Settings.py b/ccm/Settings.py
index 16b28b5..3f945cb 100644
--- a/ccm/Settings.py
+++ b/ccm/Settings.py
@@ -350,10 +350,14 @@ class RestrictedStringSetting(StockSetting):
return (str, column)
+ def GetItemText (self, val):
+ text = self.ItemsByValue.get(val)
+ if text is None:
+ return NAItemText
+ return self.SortedItems[text[1]][0]
+
def GetForRenderer(self):
- return [(self.SortedItems[self.ItemsByValue[val][1]][0] \
- if self.ItemsByValue.has_key(val) else NAItemText) \
- for val in self.Setting.Value]
+ return [self.GetItemText(val) for val in self.Setting.Value]
def _Read(self):
value = self.Get()