Skip to content

Commit

Permalink
vpython: set default value for capture_labels explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
0dminnimda committed Jul 19, 2021
1 parent 0fdd90b commit 00dd16d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions vpython/vpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -3138,17 +3138,14 @@ def pixel_to_world(self):
def pixel_to_world(self, value):
raise AttributeError('pixel_to_world is read-only')

def capture(self, filename, capture_labels=None):
def capture(self, filename, capture_labels=True):
if not isinstance(filename, str):
raise TypeError("'filename' for Capture must be a string.")

if filename[-4:] != ".png":
filename += ".png"

include_labels = "T"
if capture_labels is not None:
include_labels = "T" if capture_labels else "F"

include_labels = "T" if capture_labels else "F"
self.addmethod("capture", include_labels + filename)

@property
Expand Down

0 comments on commit 00dd16d

Please sign in to comment.