do not continue when an invalid service is loaded

This commit is contained in:
Andreas Preikschat 2013-03-13 14:43:28 +01:00
parent 3b1dd3e764
commit 3a9e6c8ec0

View File

@ -636,14 +636,17 @@ class ServiceItem(object):
for frame in self._raw_frames:
if self.is_image() and not os.path.exists(frame[u'path']):
self.is_valid = False
break
elif self.is_command():
file_name = os.path.join(frame[u'path'], frame[u'title'])
if not os.path.exists(file_name):
self.is_valid = False
break
if suffix_list and not self.is_text():
file_suffix = frame[u'title'].split(u'.')[-1]
if file_suffix.lower() not in suffix_list:
self.is_valid = False
break
def _get_renderer(self):
"""