Protected member accessed from outside the class PYL-W0212
Bug risk
Minor
4 days ago2 years old
Access to a protected member _data of a client class
102            modules_found = any(module.endswith('watchlistraw')
103                                for module in modules)
104            # for list API usage 'watchlistraw' is directly found
105            if modules_found or 'watchlistraw' in entry._data:106                executor.submit(refresh, entry.site)
107                seen.add(entry.site)
108
Access to a protected member _params of a client class
 98                continue
 99
100            # for generator API usage we have to check the modules
101            modules = entry._params.get('modules', [])102            modules_found = any(module.endswith('watchlistraw')
103                                for module in modules)
104            # for list API usage 'watchlistraw' is directly found
Access to a protected member _rebuild of a client class
 93            entry = CacheEntry(cache_path, filename)
 94            entry._load_cache()
 95            entry.parse_key()
 96            entry._rebuild() 97            if entry.site in seen:
 98                continue
 99
Access to a protected member _load_cache of a client class
 91    with ThreadPoolExecutor() as executor:
 92        for filename in files:
 93            entry = CacheEntry(cache_path, filename)
 94            entry._load_cache() 95            entry.parse_key()
 96            entry._rebuild()
 97            if entry.site in seen:
Access to a protected member _get_cache_dir of a client class
 85
 86def refresh_all() -> None:
 87    """Reload watchlists for all wikis where a watchlist is already present."""
 88    cache_path = CachedRequest._get_cache_dir() 89    files = os.scandir(cache_path)
 90    seen = set()
 91    with ThreadPoolExecutor() as executor: