def _do(self, param={}): backends = self.videoobmc.backends if backends: MenuItem(common_xbmc.get_translation('30000'), constants.SEARCH).add_to_menu() for backend in backends: icon = self.videoobmc.get_backend_icon(backend) MenuItem(backend, constants.DISPLAY_BACKENDS, backend=backend, iconimage=icon).add_to_menu() common_xbmc.end_of_directory(False) else: common_xbmc.display_error(" Please install and configure weboob")
def _json_call_weboob(self, application, command, options={}, argument=""): options['-f'] = 'json' try: result = self._call_weboob(application, command, options, argument) m = re.search(r"(\[{.+\}])", result) if m: result = u'%s' % m.group(1) #print result return json.loads(result) if result else [] except subprocess.CalledProcessError as e: common_xbmc.display_error(" Error while calling weboob : %s " % e)