@@ -167,18 +167,18 @@ def redirect_tag( tag, address ):
167167 Make sure we stay with only str type tags (mostly for Python2, in case somehow we get a Unicode
168168 tag). Multi-segment symbolic tags are expected to be looked up as: symbol["<symbol1>.<symbol2>"]
169169
170+ All Tag lookups are case-insensitive, so are stored lower-case.
170171 """
171- tag = str ( tag )
172172 assert isinstance ( address , dict )
173173 assert all ( k in symbol_keys for k in address )
174174 assert all ( k in address for k in symbol_keys )
175- symbol [tag ] = address
175+ symbol [str ( tag ). lower ()] = address
176176 return tuple ( address [k ] for k in symbol_keys )
177177
178178
179179def resolve_tag ( tag ):
180180 """Return the (class_id, instance_id, attribute_id) tuple corresponding to tag, or None if not specified"""
181- address = symbol .get ( str ( tag ), None )
181+ address = symbol .get ( str ( tag ). lower () , None )
182182 if address :
183183 return tuple ( address [k ] for k in symbol_keys )
184184 return None
@@ -205,7 +205,7 @@ def resolve( path, attribute=False ):
205205 if ( result ['class' ] is not None and result ['instance' ] is not None
206206 and ( not attribute or result ['attribute' ] is not None )):
207207 break # All desired terms specified; done! (ie. ignore 'element')
208- working = dict ( term )
208+ working = dict ( term )
209209 while working :
210210 # Each term is something like {'class':5}, {'instance':1}, or (from symbol table):
211211 # {'class':5,'instance':1}. Pull each key (eg. 'class') from working into result,
@@ -216,17 +216,17 @@ def resolve( path, attribute=False ):
216216 assert result [key ] is None , \
217217 "Failed to override %r==%r with %r from path segment %r in path %r" % (
218218 key , result [key ], working [key ], term , path ['segment' ] )
219- result [key ] = working .pop ( key ) # single 'class'/'instance'/'attribute' seg.
219+ result [key ] = working .pop ( key ) # single 'class'/'instance'/'attribute' seg.
220220 if working :
221221 assert 'symbolic' in working , \
222222 ( "Unrecognized symbolic name %r found in path %r" % ( tag , path ['segment' ] )
223223 if tag
224224 else "Invalid term %r found in path %r" % ( working , path ['segment' ] ))
225- tag += ( '.' if tag else '' ) + str ( working ['symbolic' ] )
226- working = None
227- if tag in symbol :
228- working = dict ( symbol [tag ] )
229- tag = ''
225+ tag += ( '.' if tag else '' ) + str ( working ['symbolic' ] )
226+ working = None
227+ if tag . lower () in symbol :
228+ working = dict ( symbol [tag . lower () ] )
229+ tag = ''
230230
231231 # Any tag not recognized will remain after all resolution complete
232232 assert not tag , \
@@ -237,7 +237,7 @@ def resolve( path, attribute=False ):
237237 "Failed to resolve required Class (%r), Instance (%r) %s Attribute(%r) from path: %r" % (
238238 result ['class' ], result ['instance' ], "and the" if attribute else "but not" ,
239239 result ['attribute' ], path ['segment' ] )
240- result = result ['class' ], result ['instance' ], result ['attribute' ] if attribute else None
240+ result = result ['class' ], result ['instance' ], result ['attribute' ] if attribute else None
241241 log .detail ( "Class %5d/0x%04x, Instance %3d, Attribute %5r <== %r" ,
242242 result [0 ], result [0 ], result [1 ], result [2 ], path ['segment' ] )
243243
0 commit comments