예제 #1
0
def _dir_guildfile(dir, ctx):
    from guild import guildfile
    try:
        return guildfile.from_dir(dir)
    except guildfile.NoModels:
        if ctx:
            help_suffix = " or '%s' for help" % click_util.cmd_help(ctx)
        else:
            help_suffix = ""
        cli.error("%s does not contain a Guild file (guild.yml)\n"
                  "Try specifying a project path or package name%s." %
                  (cwd_desc(dir), help_suffix))
    except guildfile.GuildfileError as e:
        cli.error(str(e))
예제 #2
0
def _no_matching_run_error(spec, ctx):
    help_msg = (" or '%s' for more information" %
                click_util.cmd_help(ctx) if ctx else "")
    cli.error("could not find a run matching '%s'\n"
              "Try 'guild runs list' for a list%s." % (spec, help_msg))