Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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>
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)
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)
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()
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)
newver = dc.Version(newverstr)
if are_updated:</font></td></tr></tbody></table></td></tr></tbody></table>
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)
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"> ')
output("\tno changelog available.")
if self.html:
output("</font></td></tr></tbody></table>")
if self.html:
output("")
pkgpath = dc.get_base_path(fam + "-0+<" + str(currver))
currver = dc.Version(pkgpath.rsplit("/", 1)[-1])
if self.html:
output("")
output("")
if self.html:
output("")
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)
def print_coda(self):
output(self.big_line_sep)
if self.html:
output("")
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()