def run_steps(spec, language="en"):
    """ Can be called by the user from within a step definition to execute other steps. """

    # The way this works is a little exotic, but I couldn't think of a better way to work around
    # the fact that this has to be a global function and therefore cannot know about which step
    # runner to use (other than making step runner global)
    
    # Find the step runner that is currently running and use it to run the given steps
    fr = inspect.currentframe()
    while fr:
        if "self" in fr.f_locals:
            f_self = fr.f_locals['self']
            if isinstance(f_self, StepsRunner):
                return f_self.run_steps_from_string(spec, language)
        fr = fr.f_back
def run_steps ( spec , language = "en" ) : fr = inspect . currentframe ( ) while fr : if "self" in fr . f_locals : f_self = fr . f_locals [ 'self' ] if isinstance ( f_self , StepsRunner ) : return f_self . run_steps_from_string ( spec , language ) fr = fr . f_back
Can be called by the user from within a step definition to execute other steps.