Skip to content

Commit 23b9ffd

Browse files
committed
Add --debug flag to python -mmatplotlib.dviread CLI.
The dviread module logs some information at the debug level (e.g., dvi "specials"). Allow printing them from the CLI, to ease verification of dvi internals.
1 parent c3f423d commit 23b9ffd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/dviread.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,12 @@ def _fontfile(cls, suffix, texname):
13471347
parser = ArgumentParser()
13481348
parser.add_argument("filename")
13491349
parser.add_argument("dpi", nargs="?", type=float, default=None)
1350+
parser.add_argument("-d", "--debug", action="store_true")
13501351
args = parser.parse_args()
13511352

1353+
if args.debug:
1354+
logging.basicConfig(level=logging.DEBUG)
1355+
13521356
def _print_fields(*args):
13531357
print(" ".join(map("{:>11}".format, args)))
13541358

0 commit comments

Comments
 (0)