Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note:
StrEnum
requires python 3.11 or later, so this effectively becomes our minimum version if this is merged. CI actions here and in isledecomp/isle use 3.12.Resolves #51.
As of #45, items in the database (i.e. the components of the binaries) are "entities". This renames
SymbolType
toEntityType
to match. It is aStrEnum
to support setting the value via a string (see #32). We useenum.auto()
to establish the values. The expected behavior is that the raw value is a lower case string version of the enum constant.There are three other changes. The main one is the
entity_type
property method ofReccmpEntity
(formerlycompare_type
). It now always returns anEntityType
. If none is set, returnEntityType.UNKNOWN
. If the raw value in the database is not part of the enum, returnEntityType.ERRTYPE
. This seems appropriate because this method is a helper anyway, and our current code assumes that an enum is returned. You can get the raw value with the.get()
method.match_name()
fromReccmpEntity
now takes advantage of the fact thatcompare_type
is always an enum and so we use its string value directly.Similarly,
match_type_abbreviation()
fromroadmap
uses the first three characters of the enum value.