def get_arg_string(self, pipeline_name):
def make_optarg_text(opt, arg):<EOL><INDENT>"""<STR_LIT>"""<EOL>if arg:<EOL><INDENT>try:<EOL><INDENT>arg = os.path.expandvars(arg)<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>return "<STR_LIT>".format(opt, arg)<EOL><DEDENT>else:<EOL><INDENT>return opt<EOL><DEDENT><DEDENT>def create_argtext(name):<EOL><INDENT>"""<STR_LIT>"""<EOL>try:<EOL><INDENT>optargs = getattr(self.pipeline_args, name)<EOL><DEDENT>except AttributeError:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>_LOGGER.debug("<STR_LIT>".format(optargs.items()))<EOL>optargs_texts = [make_optarg_text(opt, arg)<EOL>for opt, arg in optargs.items()]<EOL>_LOGGER.debug("<STR_LIT>".format(optargs_texts))<EOL>return "<STR_LIT:U+0020>".join(optargs_texts)<EOL><DEDENT>default_argtext = create_argtext(DEFAULT_COMPUTE_RESOURCES_NAME)<EOL>_LOGGER.debug("<STR_LIT>",<EOL>pipeline_name)<EOL>pipeline_argtext = create_argtext(pipeline_name)<EOL>if not pipeline_argtext:<EOL><INDENT>return default_argtext<EOL><DEDENT>elif default_argtext:<EOL><INDENT>return "<STR_LIT:U+0020>".join([default_argtext, pipeline_argtext])<EOL><DEDENT>else:<EOL><INDENT>return pipeline_argtext<EOL><DEDENT>
For this project, given a pipeline, return an argument string
specified in the project config file.