How to use the rez.cli.output function in rez

To help you get started, we’ve selected a few rez examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nerdvegas / rez / to_delete / cli / diff.py View on Github external
def print_altered_packages(self, pkgs, are_updated):

        import rez.config as dc
        if len(pkgs) > 0:
            print self.big_line_sep
            if are_updated:
                tok = "updated packages:"
            else:
                tok = "rolled-back packages:"

            if self.html:
                output('<font size="2">' + tok + '</font>')
                output('')
                rowcolindex = 0
            else:
                output(tok)

            for pkg in pkgs:
                output(self.small_line_sep)
                if self.html:
                    output('<table border="0"><tbody><tr><td bgcolor="#'">')
                    output('<table border="0" cellspacing="5"><tbody><tr><td align="center"><font size="2">')
                    rowcolindex3 = 1 - self.rowcolindex3

                path = pkg[1].rsplit("/", 1)[0]
                fam = pkg[0]
                oldverstr = pkg[1].rsplit("/", 1)[-1]
                newverstr = pkg[2].rsplit("/", 1)[-1]
                oldver = dc.Version(oldverstr)</font></td></tr></tbody></table></td></tr></tbody></table>
github nerdvegas / rez / to_delete / cli / info.py View on Github external
output()
    output("info @ " + pkg.base + ":")

    if not pkg.metadata:
        error("The package appears to be missing a package.yaml.")
        sys.exit(1)

    infofile = os.path.join(pkg.base, ".metadata", "info.txt")
    pkg_info = load_metadata(infofile, force_config_version=0)

    output()

    if "description" in pkg.metadata:
        output("Description:")
        output(str(pkg.metadata["description"]).strip())
        output()

    if "authors" in pkg.metadata:
        output("Authors:")
        for auth in pkg.metadata["authors"]:
            output(auth)
        output()

    if pkg_info:
        output("REPOSITORY URL:")
        output(pkg_info['SVN'])
        output()

        release_date_secs = int(pkg_info['ACTUAL_BUILD_TIME'])
        now_secs = get_epoch_time()
        days = (now_secs - release_date_secs) / (3600 * 24)
github nerdvegas / rez / to_delete / cli / config.py View on Github external
def command(opts, parser=None):

    if opts.version:
        output(os.getenv("REZ_VERSION"))
        sys.exit(0)

    # force quiet with some options
    do_quiet = opts.quiet or opts.print_env or opts.print_pkgs or opts.print_dot

    # validate time
    time_epoch = opts.time

    # parse out meta bake
    meta_vars = (opts.meta_info or '').replace(',', ' ').strip().split()
    shallow_meta_vars = (opts.meta_info_shallow or '').replace(',', ' ').strip().split()

    # hide local pkgs
    if opts.no_local:
        from rez.settings import settings
        settings.set("packages_path", settings.nonlocal_packages_path)
github nerdvegas / rez / to_delete / cli / info.py View on Github external
sys.exit(1)

    infofile = os.path.join(pkg.base, ".metadata", "info.txt")
    pkg_info = load_metadata(infofile, force_config_version=0)

    output()

    if "description" in pkg.metadata:
        output("Description:")
        output(str(pkg.metadata["description"]).strip())
        output()

    if "authors" in pkg.metadata:
        output("Authors:")
        for auth in pkg.metadata["authors"]:
            output(auth)
        output()

    if pkg_info:
        output("REPOSITORY URL:")
        output(pkg_info['SVN'])
        output()

        release_date_secs = int(pkg_info['ACTUAL_BUILD_TIME'])
        now_secs = get_epoch_time()
        days = (now_secs - release_date_secs) / (3600 * 24)

        output("Days since last release:")
        output(days)

    output()
github nerdvegas / rez / to_delete / cli / diff.py View on Github external
def print_altered_packages(self, pkgs, are_updated):

        import rez.config as dc
        if len(pkgs) &gt; 0:
            print self.big_line_sep
            if are_updated:
                tok = "updated packages:"
            else:
                tok = "rolled-back packages:"

            if self.html:
                output('<font size="2">' + tok + '</font>')
                output('')
                rowcolindex = 0
            else:
                output(tok)

            for pkg in pkgs:
                output(self.small_line_sep)
                if self.html:
                    output('<table border="0"><tbody><tr><td bgcolor="#'">')
                    output('<table border="0" cellspacing="5"><tbody><tr><td align="center"><font size="2">')
                    rowcolindex3 = 1 - self.rowcolindex3

                path = pkg[1].rsplit("/", 1)[0]
                fam = pkg[0]
                oldverstr = pkg[1].rsplit("/", 1)[-1]
                newverstr = pkg[2].rsplit("/", 1)[-1]
                oldver = dc.Version(oldverstr)
                newver = dc.Version(newverstr)

                if are_updated:</font></td></tr></tbody></table></td></tr></tbody></table>
github nerdvegas / rez / to_delete / cli / which.py View on Github external
def command(opts, parser=None):
    from rez.packages import split_name, package_in_range
    try:
        pkg = package_in_range(*split_name(opts.pkg))
    except Exception:
        output("package not found: '" + opts.pkg + "'")
        sys.exit(1)
    else:
        output(pkg.base)
github nerdvegas / rez / to_delete / cli / diff.py View on Github external
lines2.append(l2)

                            chlog = str('\n').join(lines2)
                            chlog = '' + chlog + '<table width="100%" cellspacing="1" cellpadding="5" border="0"></table>'

                        f.close()
                        output(chlog)
                    else:
                        if self.html:
                            output('<table cellspacing="1"><tbody><tr><td><font size="2">&nbsp;')
                        output("\tno changelog available.")
                        if self.html:
                            output("</font></td></tr></tbody></table>")

                    if self.html:
                        output("")

                    pkgpath = dc.get_base_path(fam + "-0+&lt;" + str(currver))
                    currver = dc.Version(pkgpath.rsplit("/", 1)[-1])

                if self.html:
                    output("")
                    output("")

            if self.html:
                output("")
github nerdvegas / rez / to_delete / cli / diff.py View on Github external
pkgs_ = []
            for pkg in pkgs:
                pkg_ = pkg.rsplit("=", 1)[0]
                pkgs_.append(pkg_)

            pkglist = str(", ").join(pkgs_)
            if self.html:
                output("")
                output('  <font size="2">' + tok + '</font>')
                output('  ')
                output('      <table bgcolor="#'" cellpadding="5" border="0"><tbody><tr><td>')
                output("         <font size="2">" + pkglist + "</font>")
                output("      </td></tr></tbody></table>")
                output("  ")
                output("")
                rowcolindex3 = 1 - self.rowcolindex3
            else:
                output(tok + "\t" + pkglist)
github nerdvegas / rez / to_delete / cli / diff.py View on Github external
def print_coda(self):
        output(self.big_line_sep)

        if self.html:
            output("")
github nerdvegas / rez / to_delete / cli / info.py View on Github external
output("Authors:")
        for auth in pkg.metadata["authors"]:
            output(auth)
        output()

    if pkg_info:
        output("REPOSITORY URL:")
        output(pkg_info['SVN'])
        output()

        release_date_secs = int(pkg_info['ACTUAL_BUILD_TIME'])
        now_secs = get_epoch_time()
        days = (now_secs - release_date_secs) / (3600 * 24)

        output("Days since last release:")
        output(days)

    output()