def _get_tests_stanza(raw_control_files, is_server, prepend, append, client_control_file=''):
 if client_control_file:
  raw_control_files.append((client_control_file + '\nreturn locals()'))
 raw_steps = ((prepend + [add_boilerplate_to_nested_steps(step) for step in raw_control_files]) + append)
 steps = [format_step(index, step) for (index, step) in enumerate(raw_steps)]
 if is_server:
  step_template = SERVER_STEP_TEMPLATE
  footer = '\n\nstep_init()\n'
 else:
  step_template = CLIENT_STEP_TEMPLATE
  footer = ''
 header = ''.join(((step_template % i) for i in xrange(len(steps))))
 return (((header + '\n') + '\n\n'.join(steps)) + footer)

def _get_tests_stanza ( raw_control_files , is_server , prepend , append , client_control_file = '' ) : if client_control_file : raw_control_files . append ( ( client_control_file + '\nreturn locals()' ) ) raw_steps = ( ( prepend + [ add_boilerplate_to_nested_steps ( step ) for step in raw_control_files ] ) + append ) steps = [ format_step ( index , step ) for ( index , step ) in enumerate ( raw_steps ) ] if is_server : step_template = SERVER_STEP_TEMPLATE footer = '\n\nstep_init()\n' else : step_template = CLIENT_STEP_TEMPLATE footer = '' header = '' . join ( ( ( step_template % i ) for i in xrange ( len ( steps ) ) ) ) return ( ( ( header + '\n' ) + '\n\n' . join ( steps ) ) + footer )
implements the common parts of get_test_stanza .