def _(string_id): if string_id in STRINGS: return addon.getLocalizedString(STRINGS[string_id]) else: xbmc_log('String is missing: %s' % string_id) return string_id
def __log(self, msg): xbmc_log(u'%s: %s' % (ADDON_TITLE, msg))
def __log(msg): xbmc_log(u'%s: %s' % (ADDON_ID, msg))
def __log(self, msg): xbmc_log(u'%s: %s' % (ADDON_NAME, msg))
def _(string_id): if string_id in STRINGS: return REAL_SETTINGS.getLocalizedString(STRINGS[string_id]) else: xbmc_log("String is missing: %s" % string_id) return string_id
def log(self, msg): xbmc_log(u'%s: %s' % (ADDON_NAME, msg))
def log(self, msg): xbmc_log(u"%s: %s" % (ADDON_NAME, msg))
found_logs.append({ 'title': 'kodi.old.log', 'path': log_old }) if log_crash and os.path.isfile(log_crash): found_logs.append({ 'title': 'crash.log', 'path': log_crash }) return found_logs def __sort_files_by_date(self, path, files): files.sort(key=lambda f: os.path.getmtime(os.path.join(path, f))) return files def log(self, msg): xbmc_log(u'%s: %s' % (ADDON_NAME, msg)) def _(string_id): if string_id in STRINGS: return REAL_SETTINGS.getLocalizedString(STRINGS[string_id]) else: xbmc_log('String is missing: %s' % string_id) return string_id if __name__ == '__main__': Uploader = LogUploader()
li = xbmcgui.ListItem(file['name'], iconImage='DefaultFolder.png') xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=False) elif '.jpg' in file['name'] or '.png' in file['name'] or '.jpeg' in file['name']: url = build_url({'mode': 'picture', 'foldername': '/' + file['name']}) li = xbmcgui.ListItem(file['name'], iconImage='DefaultFolder.png') xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li) xbmcplugin.endOfDirectory(addon_handle) elif mode[0] == 'folder': listing = [] foldername = args['foldername'][0] files = s.get(api_base + '/api/v2/mounts/' + mount['id'] + '/files/list', params = {'path': foldername + '/'}).json()['files'] for file in files: if file['type'] == 'dir': xbmc_log(u'%s: %s' % ('Digi Storage Player', file['name'])) url = build_url({'mode': 'folder', 'foldername': foldername + '/' + file['name']}) li = xbmcgui.ListItem(foldername + '/' + file['name'], iconImage='DefaultFolder.png') xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=True) elif '.mp3' in file['name'] or '.mkv' in file['name']: tempoUrl = s.get(api_base + '/api/v2/mounts/' + mount['id'] + '/files/download', params = {'path': foldername + '/' + file['name']}, verify=False).json()['link'] url = build_url({'mode': 'picture', 'foldername': tempoUrl}) li = xbmcgui.ListItem(file['name'], iconImage='DefaultFolder.png') li.addContextMenuItems([ ('Play', 'PlayMedia('+tempoUrl+')')]) xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li, isFolder=False) elif '.jpg' in file['name'] or '.png' in file['name'] or '.jpeg' in file['name']: url = build_url({'mode': 'picture', 'foldername': foldername + '/' + file['name']}) li = xbmcgui.ListItem(file['name'], iconImage='DefaultFolder.png')
def __log(self, msg): xbmc_log(u"%s: %s" % (ADDON_TITLE, msg))
def log(msg, level=LOGNOTICE): xbmc_log("[ADDON][%s] %s" % (ADDON_NAME, msg.encode("utf-8")), level=level)