Skip to content

Commit

Permalink
Fix ci issues
Browse files Browse the repository at this point in the history
  • Loading branch information
joajfreitas committed Jan 15, 2025
1 parent 7c76f47 commit 25883f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions plugins/fcp_cpp/fcp_cpp/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def get_matching_impls(fcp: FcpV2, protocol: str) -> List[Impl]:
"""Get impls matching a protocol."""
return fcp.get_matching_impls_or_default(protocol)


def get_struct_from_type(fcp: FcpV2, type: str) -> Struct:
"""Get struct from type name."""
return fcp.get_type(ComposedType(type, ComposedTypeCategory.Struct)).unwrap()
Expand Down Expand Up @@ -145,11 +146,7 @@ def generate(self, fcp: FcpV2, ctx: Any) -> List[Dict[str, Union[str, Path]]]:
(
"fcp.h.j2",
"fcp_" + protocol + ".h",
{
"fcp": fcp,
"namespace": None,
"protocol": protocol
}
{"fcp": fcp, "namespace": None, "protocol": protocol},
)
for protocol in fcp.get_protocols()
]
Expand Down
3 changes: 2 additions & 1 deletion src/fcp/specs/v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ def get(self, category: str) -> Maybe[List[Any]]:

def get_matching_impl(self, struct: Struct, protocol: str) -> List[Impl]:
"""Get impl for corresponding struct with a specific protocol."""

impls = []
for extension in self.impls:
if extension.type == struct.name and extension.protocol == protocol:
Expand All @@ -111,6 +110,7 @@ def get_matching_impls(self, protocol: str) -> Generator[Impl, None, None]:
yield impl

def get_matching_impls_or_default(self, protocol: str) -> List[Impl]:
"""Get list of impls matching protocol or the default for a given struct."""
impls = []
for struct in self.structs:
tmp = self.get_matching_impl(struct, protocol)
Expand Down Expand Up @@ -155,6 +155,7 @@ def get_xpath(self, xpath: Xpath) -> Result[StructField, str]:
return Err("Field not found")

def get_protocols(self) -> List[str]:
"""Get list of unique protocol names."""
return list(set([impl.protocol for impl in self.impls]))

def to_dict(self) -> Any:
Expand Down

0 comments on commit 25883f9

Please sign in to comment.