Skip to content

Commit

Permalink
generate_pictures.py: Add verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrgn committed Nov 26, 2017
1 parent b9a24a3 commit 3effd0f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/generate_pictures.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
import inspect
import subprocess
import sys

from tangible import shapes

Expand All @@ -31,6 +32,10 @@ def convert(name):
file_names = map(convert, shape_names)


# Use -v parameter to output the cmds
verbose = '-v' in sys.argv


# Find and execute files
for name in file_names:
print('Processing {}.py: '.format(name), end='')
Expand All @@ -39,6 +44,10 @@ def convert(name):
'openscad -o _static/img/shapes/{0}.png --imgsize=400,260 ../examples/{0}.scad',
'rm ../examples/{0}.scad',
]
if verbose:
print()
for cmd in cmds:
print(' %s' % cmd.format(name))
try:
with open(os.devnull, 'w') as devnull:
for cmd in cmds:
Expand Down

0 comments on commit 3effd0f

Please sign in to comment.