diff --git a/roentgen/grid.py b/roentgen/grid.py index a418c98..79fa47c 100644 --- a/roentgen/grid.py +++ b/roentgen/grid.py @@ -60,20 +60,22 @@ def draw_all_icons( continue if matcher.under_icon: for icon_id in matcher.under_icon: - current_set = set([icon_id] + matcher.over_icon) + current_set = [icon_id] + matcher.over_icon add() if not (matcher.under_icon and matcher.with_icon): continue for icon_id in matcher.under_icon: for icon_2_id in matcher.with_icon: - current_set: Set[str] = set( - [icon_id] + [icon_2_id] + matcher.over_icon) + current_set: List[str] = ( + [icon_id] + [icon_2_id] + matcher.over_icon + ) add() for icon_2_id in matcher.with_icon: for icon_3_id in matcher.with_icon: - current_set = set( + current_set = ( [icon_id] + [icon_2_id] + [icon_3_id] + - matcher.over_icon) + matcher.over_icon + ) if (icon_2_id != icon_3_id and icon_2_id != icon_id and icon_3_id != icon_id): add() @@ -81,7 +83,7 @@ def draw_all_icons( specified_ids: Set[str] = set() for icon in icons: - specified_ids |= icon.get_shape_ids() + specified_ids |= set(icon.get_shape_ids()) print( "Icons with no tag specification: \n " + ", ".join(sorted(extractor.shapes.keys() - specified_ids)) + "." diff --git a/roentgen/icon.py b/roentgen/icon.py index 3b5e96c..4ba5cfb 100644 --- a/roentgen/icon.py +++ b/roentgen/icon.py @@ -290,11 +290,11 @@ class Icon: shape_specifications: List[ShapeSpecification] - def get_shape_ids(self) -> Set[str]: + def get_shape_ids(self) -> List[str]: """ Get all shape identifiers in the icon. """ - return set(x.shape.id_ for x in self.shape_specifications) + return [x.shape.id_ for x in self.shape_specifications] def get_names(self) -> List[str]: """ @@ -368,8 +368,8 @@ class Icon: def __lt__(self, other) -> bool: return ( - sorted(self.shape_specifications)[0].shape.id_ - < sorted(other.shape_specifications)[0].shape.id_ + "".join([x.shape.id_ for x in self.shape_specifications]) + < "".join([x.shape.id_ for x in other.shape_specifications]) )