@@ -237,28 +237,13 @@ def make(cls, tpl: 'FilterTemplate', **kwargs):
237237 if len (tpl .anon_params ) < 3 :
238238 raise RuntimeError (_ ('No category values given!' ))
239239
240- # Build category list, catching missing categories as warnings
241- categories = []
242- for cat_name in tpl .anon_params [2 :]:
243- if cat_name .strip () == '' :
244- continue
245- try :
246- cat_page = tpl .sites .resolve_page (cat_name , 14 , True )
247- categories .append (cat_page )
248- except InvalidContestPage as e :
249- logger .warning ('Category does not exist: %s' , cat_name )
250- try :
251- self_site = tpl .sites .homesite
252- self_site .errors .append (_ ('Warning: Category does not exist: %(cat)s' ) % {'cat' : cat_name })
253- except Exception as ex :
254- logger .warning ('Could not attach warning to homesite: %s' , ex )
255- # Do not abort, just skip this category
256- continue
257-
258240 params = {
259241 'sites' : tpl .sites ,
260242 'ignore' : cls .get_ignore_list (tpl , kwargs .get ('cfg' , {}).get ('ignore_page' )),
261- 'categories' : categories ,
243+ 'categories' : [
244+ tpl .sites .resolve_page (cat_name , 14 , True )
245+ for cat_name in tpl .anon_params [2 :] if cat_name .strip () != ''
246+ ],
262247 }
263248
264249 if tpl .has_param ('ignore' ):
@@ -270,16 +255,6 @@ def make(cls, tpl: 'FilterTemplate', **kwargs):
270255 if tpl .has_param ('maxdepth' ):
271256 params ['maxdepth' ] = int (tpl .get_param ('maxdepth' ))
272257
273- # If a category is on an unrecognized wiki, warn but do not abort
274- for cat in params ['categories' ]:
275- if not hasattr (cat , 'site' ) or cat .site .key not in tpl .sites .keys ():
276- logger .warning ('Category on unrecognized wiki: %s' , getattr (cat , 'name' , str (cat )))
277- try :
278- self_site = tpl .sites .homesite
279- self_site .errors .append (_ ('Warning: Category on unrecognized wiki: %(cat)s' ) % {'cat' : getattr (cat , 'name' , str (cat ))})
280- except Exception as e :
281- logger .warning ('Could not attach warning to homesite: %s' , e )
282-
283258 return cls (** params )
284259
285260 def __init__ (self , sites : 'SiteManager' , categories : List [Union ['Page' , WildcardPage ]], maxdepth : int = 5 ,
0 commit comments