@@ -304,18 +304,46 @@ def with_ver(self, ver):
304304 return self
305305
306306
307+ class NormalizedKeyDict (dict ):
308+ def _normalize_key (self , key ):
309+ if isinstance (key , str ):
310+ return key .strip ().lower ()
311+ return key
312+
313+ def __setitem__ (self , key , value ):
314+ super ().__setitem__ (self ._normalize_key (key ), value )
315+
316+ def __getitem__ (self , key ):
317+ return super ().__getitem__ (self ._normalize_key (key ))
318+
319+ def __delitem__ (self , key ):
320+ return super ().__delitem__ (self ._normalize_key (key ))
321+
322+ def __contains__ (self , key ):
323+ return super ().__contains__ (self ._normalize_key (key ))
324+
325+ def get (self , key , default = None ):
326+ return super ().get (self ._normalize_key (key ), default )
327+
328+ def setdefault (self , key , default = None ):
329+ return super ().setdefault (self ._normalize_key (key ), default )
330+
331+ def pop (self , key , default = None ):
332+ return super ().pop (self ._normalize_key (key ), default )
333+
334+
307335class UnifiedManager :
308336 def __init__ (self ):
309337 self .installed_node_packages : dict [str , InstalledNodePackage ] = {}
310338
311- self .cnr_inactive_nodes = {} # node_id -> node_version -> fullpath
312- self .nightly_inactive_nodes = {} # node_id -> fullpath
313- self .unknown_inactive_nodes = {} # node_id -> repo url * fullpath
314- self .active_nodes = {} # node_id -> node_version * fullpath
315- self .unknown_active_nodes = {} # node_id -> repo url * fullpath
316- self .cnr_map = {} # node_id -> cnr info
317- self .repo_cnr_map = {} # repo_url -> cnr info
318- self .custom_node_map_cache = {} # (channel, mode) -> augmented custom node list json
339+ self .cnr_inactive_nodes = NormalizedKeyDict () # node_id -> node_version -> fullpath
340+ self .nightly_inactive_nodes = NormalizedKeyDict () # node_id -> fullpath
341+ self .unknown_inactive_nodes = {} # node_id -> repo url * fullpath
342+ self .active_nodes = NormalizedKeyDict () # node_id -> node_version * fullpath
343+ self .unknown_active_nodes = {} # node_id -> repo url * fullpath
344+ self .cnr_map = NormalizedKeyDict () # node_id -> cnr info
345+ self .repo_cnr_map = {} # repo_url -> cnr info
346+ self .custom_node_map_cache = {} # (channel, mode) -> augmented custom node list json
319347 self .processed_install = set ()
320348
321349 def get_module_name (self , x ):
@@ -2791,7 +2819,7 @@ async def get_unified_total_nodes(channel, mode, regsitry_cache_mode='cache'):
27912819
27922820 if cnr_id is not None :
27932821 # cnr or nightly version
2794- cnr_ids .remove (cnr_id )
2822+ cnr_ids .discard (cnr_id )
27952823 updatable = False
27962824 cnr = unified_manager .cnr_map [cnr_id ]
27972825
0 commit comments