From 0b936041d3b88595960cb1c38180d1b8a15b5638 Mon Sep 17 00:00:00 2001 From: Vassilii Khachaturov Date: Thu, 12 Sep 2013 21:22:02 +0000 Subject: [PATCH] 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 --- gramps/gui/user.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gramps/gui/user.py b/gramps/gui/user.py index f52880cf7..5e0124902 100644 --- a/gramps/gui/user.py +++ b/gramps/gui/user.py @@ -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): """