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