~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Martin Pool
  • Date: 2009-01-21 05:30:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3956.
  • Revision ID: mbp@sourcefrog.net-20090121053044-mhynfsubozjh9wol
Corrections to finishing progress bars

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
21
21
 
22
22
import sys
23
23
import time
 
24
import warnings
24
25
 
25
26
from bzrlib.lazy_import import lazy_import
26
27
lazy_import(globals(), """
90
91
    def show_progress(self, task):
91
92
        """A task has been updated and wants to be displayed.
92
93
        """
 
94
        if task != self._task_stack[-1]:
 
95
            warnings.warn("%r is not the top progress task %r" %
 
96
                (task, self._task_stack[-1]))
93
97
        self._progress_view.show_progress(task)
94
98
 
95
99
    def progress_finished(self, task):
109
113
    task wants to be painted.
110
114
 
111
115
    Transports feed data to this through the ui_factory object.
 
116
 
 
117
    The Progress views can comprise a tree with _parent_task pointers, but
 
118
    this only prints the stack from the nominated current task up to the root.
112
119
    """
113
120
 
114
121
    def __init__(self, term_file):