5098: rename gui.user.User.progress to ._progress

it shadowed the gen.user.User.progress (the context manager),
breaking the ``with user.progress() ... as step:'' idiom!

svn: r23101
This commit is contained in:
Vassilii Khachaturov 2013-09-12 21:22:02 +00:00
parent 4ff73e9d8a
commit 0b936041d3

View File

@ -52,7 +52,7 @@ class User(user.User):
"""
def __init__(self, callback=None, error=None, uistate=None):
user.User.__init__(self, callback, error)
self.progress = None
self._progress = None
self.uistate = uistate
def begin_progress(self, title, message, steps):
@ -69,26 +69,26 @@ class User(user.User):
@type steps: int
@returns: none
"""
self.progress = ProgressMeter(title)
self._progress = ProgressMeter(title)
if steps > 0:
self.progress.set_pass(message, steps, ProgressMeter.MODE_FRACTION)
self._progress.set_pass(message, steps, ProgressMeter.MODE_FRACTION)
else:
self.progress.set_pass(message, mode=ProgressMeter.MODE_ACTIVITY)
self._progress.set_pass(message, mode=ProgressMeter.MODE_ACTIVITY)
def step_progress(self):
"""
Advance the progress meter.
"""
if self.progress:
self.progress.step()
if self._progress:
self._progress.step()
def end_progress(self):
"""
Stop showing the progress indicator to the user.
"""
if self.progress:
self.progress.close()
self.progress = None
if self._progress:
self._progress.close()
self._progress = None
def prompt(self, title, message, accept_label, reject_label):
"""