From 672c7de76feb8d34d4429bc7936a4f701477855a Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 9 Aug 2021 17:37:30 -0700 Subject: [PATCH] Add vlogging to svgrender. --- svgrender.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/svgrender.py b/svgrender.py index 33dd860..b5f6cd6 100644 --- a/svgrender.py +++ b/svgrender.py @@ -31,6 +31,9 @@ import sys from voussoirkit import betterhelp from voussoirkit import pathclass from voussoirkit import winwhich +from voussoirkit import vlogging + +log = vlogging.getLogger(__name__, 'svgrender') def svgrender(filepath, scales, destination, scale_suffix=True, axis='x'): if isinstance(scales, int): @@ -63,8 +66,12 @@ def svgrender(filepath, scales, destination, scale_suffix=True, axis='x'): inkscape = winwhich.which('inkscape') command = inkscape + ' "{svg}" --export-png="{png}" {dimension} --export-area-page' - command = command.format(svg=svg_path.absolute_path, png=png_path.absolute_path, dimension=dimension) - #print(command) + command = command.format( + svg=svg_path.absolute_path, + png=png_path.absolute_path, + dimension=dimension, + ) + log.debug(command) status = os.system(command) if status: print('Uh oh...') @@ -81,6 +88,7 @@ def svgrender_argparse(args): axis='y' if args.y else 'x', ) +@vlogging.main_decorator def main(argv): parser = argparse.ArgumentParser(description=__doc__)