def export_stubs(handler, scenario_name): from stubo.model.exporter import YAML_FORMAT_SUBDIR # export stubs in the old format command_links = export_stubs_to_commands_format(handler, scenario_name) # continue stub export in the new format cache = Cache(get_hostname(handler.request)) scenario_name_key = cache.scenario_key_name(scenario_name) exporter = Exporter(static_dir=handler.settings['static_path']) runnable = asbool(handler.get_argument('runnable', False)) playback_session = handler.get_argument('playback_session', None) export_dir_path, files, runnable_info = exporter.export( scenario_name_key, runnable=runnable, playback_session=playback_session, session_id=handler.get_argument('session_id', None), export_dir=handler.get_argument('export_dir', None)) # getting export links yaml_links = get_export_links(handler, scenario_name_key + "/" + YAML_FORMAT_SUBDIR, files) payload = dict(scenario=scenario_name, export_dir_path=export_dir_path, command_links=command_links, yaml_links=yaml_links) if runnable_info: payload['runnable'] = runnable_info return dict(version=version, data=payload)
def export_stubs(handler, scenario_name): from stubo.model.exporter import YAML_FORMAT_SUBDIR # export stubs in the old format command_links = export_stubs_to_commands_format(handler, scenario_name) # continue stub export in the new format cache = Cache(get_hostname(handler.request)) scenario_name_key = cache.scenario_key_name(scenario_name) exporter = Exporter(static_dir = handler.settings['static_path']) runnable = asbool(handler.get_argument('runnable', False)) playback_session = handler.get_argument('playback_session', None) export_dir_path, files, runnable_info = exporter.export(scenario_name_key, runnable=runnable, playback_session=playback_session, session_id=handler.get_argument('session_id', None), export_dir=handler.get_argument('export_dir', None)) # getting export links yaml_links = get_export_links(handler, scenario_name_key+"/"+YAML_FORMAT_SUBDIR, files) payload = dict(scenario=scenario_name, export_dir_path=export_dir_path, command_links=command_links, yaml_links=yaml_links) if runnable_info: payload['runnable'] = runnable_info return dict(version=version, data=payload)
def export_stubs(handler, scenario_name): cache = Cache(get_hostname(handler.request)) scenario_name_key = cache.scenario_key_name(scenario_name) exporter = Exporter(static_dir = handler.settings['static_path']) runnable = asbool(handler.get_argument('runnable', False)) playback_session = handler.get_argument('playback_session', None) export_dir_path, files, runnable_info = exporter.export(scenario_name_key, runnable=runnable, playback_session=playback_session, session_id=handler.get_argument('session_id', None), export_dir=handler.get_argument('export_dir', None)) links = get_export_links(handler, scenario_name_key, files) payload = dict(scenario=scenario_name, export_dir_path=export_dir_path, links=links) if runnable_info: payload['runnable'] = runnable_info return dict(version=version, data=payload)
def export_stubs(handler, scenario_name): cache = Cache(get_hostname(handler.request)) scenario_name_key = cache.scenario_key_name(scenario_name) exporter = Exporter(static_dir=handler.settings['static_path']) runnable = asbool(handler.get_argument('runnable', False)) playback_session = handler.get_argument('playback_session', None) export_dir_path, files, runnable_info = exporter.export( scenario_name_key, runnable=runnable, playback_session=playback_session, session_id=handler.get_argument('session_id', None), export_dir=handler.get_argument('export_dir', None)) links = get_export_links(handler, scenario_name_key, files) payload = dict(scenario=scenario_name, export_dir_path=export_dir_path, links=links) if runnable_info: payload['runnable'] = runnable_info return dict(version=version, data=payload)