def refresh_all(): """Reload watchlists for all wikis where a watchlist is already present.""" cache_path = CachedRequest._get_cache_dir() files = os.scandir(cache_path) seen = set() for filename in files: entry = CacheEntry(cache_path, filename) entry._load_cache() entry.parse_key() entry._rebuild() if entry.site not in seen and 'watchlistraw' in entry._data: refresh(entry.site) seen.add(entry.site)
def refresh_all(sysop=False): """Reload watchlists for all wikis where a watchlist is already present.""" cache_path = CachedRequest._get_cache_dir() files = os.listdir(cache_path) seen = [] for filename in files: entry = CacheEntry(cache_path, filename) entry._load_cache() entry.parse_key() entry._rebuild() if entry.site not in seen: if entry._data['watchlistraw']: refresh(entry.site) seen.append(entry.site)
def refresh_all(sysop=False): """Reload watchlists for all wikis where a watchlist is already present.""" cache_path = CachedRequest._get_cache_dir() files = os.listdir(cache_path) seen = [] for filename in files: entry = CacheEntry(cache_path, filename) entry._load_cache() entry.parse_key() entry._rebuild() if entry.site not in seen: if entry._data.get('watchlistraw'): refresh(entry.site, sysop) seen.append(entry.site)