|
55 | 55 | import time |
56 | 56 |
|
57 | 57 | # Exit error codes |
| 58 | +# Debugging |
| 59 | +VERB = None |
58 | 60 | # Fixed values |
59 | 61 | INTERNAL_ERROR = 1 |
60 | 62 | ARGS_ERROR = 2 |
@@ -271,12 +273,16 @@ def GenSCHImageDirect(file, file_hash, hash_dir, file_no_ext, layer_names, all): |
271 | 273 | # Create the PDF, or use a cached version |
272 | 274 | if not CheckOptions(name_ops, cur_sch_ops) or not isfile(name_pdf): |
273 | 275 | logger.info('Plotting the schematic') |
274 | | - cmd = ['eeschema_do', 'export', '--file_format', 'pdf', '--monochrome', '--no_frame', '--output_name', name_pdf] |
| 276 | + cmd = ['eeschema_do'] |
| 277 | + if VERB: |
| 278 | + cmd.append(VERB) |
| 279 | + cmd.extend(['export', '--file_format', 'pdf', '--monochrome', '--no_frame', '--output_name', name_pdf]) |
275 | 280 | if all: |
276 | 281 | cmd.append('--all_pages') |
277 | 282 | cmd.extend([file, '.']) |
278 | 283 | logger.debug('Executing: '+str(cmd)) |
279 | | - call(cmd) |
| 284 | + res = call(cmd) |
| 285 | + logger.debug(res) |
280 | 286 | if not isfile(name_pdf): |
281 | 287 | logger.error('Failed to plot %s' % name_pdf) |
282 | 288 | exit(FAILED_TO_PLOT) |
@@ -307,7 +313,10 @@ def GenSCHImageSVG(file, file_hash, hash_dir, file_no_ext, layer_names, kiri_mod |
307 | 313 | svgs = glob(pattern_svgs) |
308 | 314 | if ops_changed or not svgs: |
309 | 315 | logger.info('Plotting the schematic') |
310 | | - cmd = ['eeschema_do', 'export', '--file_format', 'svg', '--monochrome', '--all_pages'] |
| 316 | + cmd = ['eeschema_do'] |
| 317 | + if VERB: |
| 318 | + cmd.append(VERB) |
| 319 | + cmd.extend(['export', '--file_format', 'svg', '--monochrome', '--all_pages']) |
311 | 320 | if not kiri_mode: |
312 | 321 | cmd.append('--no_frame') |
313 | 322 | cmd.extend([file, hash_dir]) |
@@ -382,6 +391,7 @@ def run_command(command): |
382 | 391 | logger.debug('Executing: '+shlex.join(command)) |
383 | 392 | try: |
384 | 393 | res = run(command, check=True, stdout=PIPE, stderr=STDOUT).stdout.decode() |
| 394 | + logger.debug(res) |
385 | 395 | except CalledProcessError as e: |
386 | 396 | res = '' |
387 | 397 | logger.debug('Running {} returned {}'.format(e.cmd, e.returncode)) |
@@ -847,6 +857,7 @@ def get_layer(line): |
847 | 857 | # Create a logger with the specified verbosity |
848 | 858 | if args.verbose >= 2: |
849 | 859 | log_level = logging.DEBUG |
| 860 | + VERB = "-" + ("v" * (args.verbose - 1)) |
850 | 861 | elif args.verbose == 1: |
851 | 862 | log_level = logging.INFO |
852 | 863 | else: |
|
0 commit comments