Add vlogging to svgrender.
This commit is contained in:
parent
39e0aaed71
commit
672c7de76f
1 changed files with 10 additions and 2 deletions
12
svgrender.py
12
svgrender.py
|
@ -31,6 +31,9 @@ import sys
|
||||||
from voussoirkit import betterhelp
|
from voussoirkit import betterhelp
|
||||||
from voussoirkit import pathclass
|
from voussoirkit import pathclass
|
||||||
from voussoirkit import winwhich
|
from voussoirkit import winwhich
|
||||||
|
from voussoirkit import vlogging
|
||||||
|
|
||||||
|
log = vlogging.getLogger(__name__, 'svgrender')
|
||||||
|
|
||||||
def svgrender(filepath, scales, destination, scale_suffix=True, axis='x'):
|
def svgrender(filepath, scales, destination, scale_suffix=True, axis='x'):
|
||||||
if isinstance(scales, int):
|
if isinstance(scales, int):
|
||||||
|
@ -63,8 +66,12 @@ def svgrender(filepath, scales, destination, scale_suffix=True, axis='x'):
|
||||||
|
|
||||||
inkscape = winwhich.which('inkscape')
|
inkscape = winwhich.which('inkscape')
|
||||||
command = inkscape + ' "{svg}" --export-png="{png}" {dimension} --export-area-page'
|
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)
|
command = command.format(
|
||||||
#print(command)
|
svg=svg_path.absolute_path,
|
||||||
|
png=png_path.absolute_path,
|
||||||
|
dimension=dimension,
|
||||||
|
)
|
||||||
|
log.debug(command)
|
||||||
status = os.system(command)
|
status = os.system(command)
|
||||||
if status:
|
if status:
|
||||||
print('Uh oh...')
|
print('Uh oh...')
|
||||||
|
@ -81,6 +88,7 @@ def svgrender_argparse(args):
|
||||||
axis='y' if args.y else 'x',
|
axis='y' if args.y else 'x',
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@vlogging.main_decorator
|
||||||
def main(argv):
|
def main(argv):
|
||||||
parser = argparse.ArgumentParser(description=__doc__)
|
parser = argparse.ArgumentParser(description=__doc__)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue