def about(): try: import xbmc KODI_LANGUAGE = xbmc.getLanguage() except: KODI_LANGUAGE = 'English' path = kodi.vfs.join(kodi.get_path(), 'resources/language/%s/github_help.txt', KODI_LANGUAGE) if not kodi.vfs.exists(path): path = kodi.vfs.join(kodi.get_path(), 'resources/language/English/github_help.txt') text = kodi.vfs.read_file(path) kodi.dialog_textbox('GitHub Browser Instructions', text)
def show_about(): interval = int(kodi.get_setting('last_about')) if interval == 0: interval = 5 try: import xbmc KODI_LANGUAGE = xbmc.getLanguage() except: KODI_LANGUAGE = 'English' path = kodi.vfs.join(kodi.get_path(), 'resources/language/%s/github_help.txt', KODI_LANGUAGE) if not kodi.vfs.exists(path): path = kodi.vfs.join(kodi.get_path(), 'resources/language/English/github_help.txt') text = kodi.vfs.read_file(path) kodi.dialog_textbox('GitHub Browser Instructions', text) else: interval -= 1 kodi.set_setting('last_about', interval)
def update_scraper(file_name, scraper_url, scraper_key): py_path = os.path.join(kodi.get_path(), 'scrapers', file_name) exists = os.path.exists(py_path) if not exists or (time.time() - os.path.getmtime(py_path)) > (8 * 60 * 60): new_py = utils2.get_and_decrypt(scraper_url, scraper_key) if new_py: if exists: with open(py_path, 'r') as f: old_py = f.read() else: old_py = '' log_utils.log('%s path: %s, new_py: %s, match: %s' % (__file__, py_path, bool(new_py), new_py == old_py), log_utils.LOGDEBUG) if old_py != new_py: with open(py_path, 'w') as f: f.write(new_py)