Skip to content
Snippets Groups Projects
Commit b348c22e authored by Nathan Hertz's avatar Nathan Hertz
Browse files

Added __getitem__ method to CapabilitySequence; fixed

CapabilityStep.from_str() method
parent 1c4c9d86
No related branches found
No related tags found
No related merge requests found
......@@ -25,7 +25,7 @@ class CapabilityStep(CapabilityStepIF):
:return: CapabilityStep of given string
"""
step_list = step_string.split(' ')
step_type = CapabilityStepType[step_list[0]]
step_type = CapabilityStepType.from_string(step_list[0])
if step_list[1]:
step_value = step_list[1]
else:
......@@ -73,6 +73,9 @@ class CapabilitySequence(CapabilitySequenceIF):
"""
return len(self.steps)
def __getitem__(self, step_number: int) -> CapabilityStep:
return self.steps[step_number]
def __str__(self) -> str:
"""
Provides a string representation of the object
......@@ -103,6 +106,7 @@ class CapabilityStepType(Enum):
@classmethod
def from_string(cls, string: str) -> CapabilityStepType:
print(string)
strings = {
'prepare-and-run-workflow': cls.PrepareAndRunWorkflow,
'await-qa': cls.AwaitQA,
......
......@@ -219,7 +219,6 @@ class Capability(Base, CapabilityIF):
return CapabilityRequest(
capability=self.id,
parameters=parameters,
future_products=future_products,
versions=versions,
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment