Skip to content

Commit 5934a62

Browse files
committed
add a context manger to progsteps
1 parent c5ee33d commit 5934a62

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pyuvsim/utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ def __init__(self, maxval=None):
4141
self.curval = 0
4242
self.remain = None
4343

44+
def __enter__(self):
45+
return self
46+
47+
def __exit__(self, exc_type, exc_value, traceback):
48+
self.finish()
49+
4450
def update(self, count):
4551
"""
4652
Update the progress bar.

0 commit comments

Comments
 (0)