@rtype: bool @return: C{True} if the given name could refer to this module. It may not be exactly the same returned by L{get_name}.
(self, name)
| 350 | return modName |
| 351 | |
| 352 | def match_name(self, name): |
| 353 | """ |
| 354 | @rtype: bool |
| 355 | @return: |
| 356 | C{True} if the given name could refer to this module. |
| 357 | It may not be exactly the same returned by L{get_name}. |
| 358 | """ |
| 359 | |
| 360 | # If the given name is exactly our name, return True. |
| 361 | # Comparison is case insensitive. |
| 362 | my_name = self.get_name().lower() |
| 363 | if name.lower() == my_name: |
| 364 | return True |
| 365 | |
| 366 | # If the given name is a base address, compare it with ours. |
| 367 | try: |
| 368 | base = HexInput.integer(name) |
| 369 | except ValueError: |
| 370 | base = None |
| 371 | if base is not None and base == self.get_base(): |
| 372 | return True |
| 373 | |
| 374 | # If the given name is a filename, convert it to a module name. |
| 375 | # Then compare it with ours, case insensitive. |
| 376 | modName = self.__filename_to_modname(name) |
| 377 | if modName.lower() == my_name: |
| 378 | return True |
| 379 | |
| 380 | # No match. |
| 381 | return False |
| 382 | |
| 383 | # ------------------------------------------------------------------------------ |
| 384 |
no test coverage detected