def on_github_refreshed(races, items): for name, data in races.items(): option = PagedOption(name, name) repository = data['repository'] if repository is None or data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['repositories'][repository][ 'last_modified']: option.text = f'*{option.text}' wcsadmin_github_races_menu.append(option) for name, data in items.items(): option = PagedOption(name, name) repository = data['repository'] if repository is None or data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['repositories'][repository][ 'last_modified']: option.text = f'*{option.text}' wcsadmin_github_items_menu.append(option) wcsadmin_github_menu[2].selectable = wcsadmin_github_menu[ 2].highlight = bool(races) wcsadmin_github_menu[3].selectable = wcsadmin_github_menu[ 3].highlight = bool(items)
def on_github_refreshed(races, items): for name, data in races.items(): option = PagedOption(name, name) if data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['last_modified']: option.text = f'*{option.text}' wcsadmin_github_races_menu.append(option) for name, data in items.items(): option = PagedOption(name, name) if data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['last_modified']: option.text = f'*{option.text}' wcsadmin_github_items_menu.append(option) if races: wcsadmin_github_menu[2].selectable = wcsadmin_github_menu[ 2].highlight = True if items: wcsadmin_github_menu[3].selectable = wcsadmin_github_menu[ 3].highlight = True
def on_github_item_module_update(name, data): option = PagedOption(name, name) repository = data['repository'] if repository is None or data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['repositories'][repository]['last_modified']: option.text = f'*{option.text}' wcsadmin_github_items_menu.append(option) for index in wcsadmin_github_items_menu._player_pages: if wcsadmin_github_items_menu.is_active_menu(index): wcsadmin_github_items_menu._refresh(index)
def on_github_modules_refreshed(races, items): wcsadmin_github_races_menu.clear() wcsadmin_github_items_menu.clear() wcsadmin_github_races_menu._cycle = None wcsadmin_github_items_menu._cycle = None for name, data in races.items(): option = PagedOption(name, name) repository = data['repository'] if repository is None or data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['repositories'][repository][ 'last_modified']: option.text = f'*{option.text}' wcsadmin_github_races_menu.append(option) for name, data in items.items(): option = PagedOption(name, name) repository = data['repository'] if repository is None or data['last_updated'] is None: option.text = f'+{option.text}' else: if data['last_updated'] < data['repositories'][repository][ 'last_modified']: option.text = f'*{option.text}' wcsadmin_github_items_menu.append(option) wcsadmin_github_menu[2].selectable = wcsadmin_github_menu[ 2].highlight = bool(races) wcsadmin_github_menu[3].selectable = wcsadmin_github_menu[ 3].highlight = bool(items) if not races: wcsadmin_github_menu.send([*wcsadmin_github_races_menu._player_pages]) wcsadmin_github_races_menu.close( [*wcsadmin_github_races_menu._player_pages]) if not items: wcsadmin_github_menu.send([*wcsadmin_github_items_menu._player_pages]) wcsadmin_github_items_menu.close( [*wcsadmin_github_items_menu._player_pages])