fix for ticket #142

This commit is contained in:
Andreas Preikschat 2011-03-27 20:28:03 +02:00
parent 90236dedad
commit 26f144e1ec

View File

@ -406,24 +406,28 @@ class ServiceItem(object):
def get_rendered_frame(self, row): def get_rendered_frame(self, row):
""" """
Returns the correct frame for a given list and Returns the correct frame for a given list and renders it if required.
renders it if required.
""" """
try:
if self.service_item_type == ServiceItemType.Text: if self.service_item_type == ServiceItemType.Text:
return self._display_frames[row][u'html'].split(u'\n')[0] frame = self._display_frames[row][u'html'].split(u'\n')[0]
elif self.service_item_type == ServiceItemType.Image: elif self.service_item_type == ServiceItemType.Image:
return self._raw_frames[row][u'title'] frame = self._raw_frames[row][u'title']
else: else:
return self._raw_frames[row][u'image'] frame = self._raw_frames[row][u'image']
except IndexError:
frame = u''
return frame
def get_frame_title(self, row=0): def get_frame_title(self, row=0):
""" """
Returns the title of the raw frame Returns the title of the raw frame
""" """
try: try:
return self._raw_frames[row][u'title'] title = self._raw_frames[row][u'title']
except IndexError: except IndexError:
return u'' title = u''
return title
def get_frame_path(self, row=0): def get_frame_path(self, row=0):
""" """