~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-23 18:14:16 UTC
  • mfrom: (3948.2.8 progress)
  • Revision ID: pqm@pqm.ubuntu.com-20090123181416-tku4gdtorboy6d0y
(mbp) further progress bar fixes

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(), """
87
88
        """
88
89
        self._progress_view.show_transport_activity(byte_count)
89
90
 
90
 
    def show_progress(self, task):
 
91
    def _progress_updated(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
 
    def progress_finished(self, task):
96
 
        CLIUIFactory.progress_finished(self, task)
97
 
        if not self._task_stack:
98
 
            # finished top-level task
99
 
            self._progress_view.clear()
 
99
    def _progress_all_finished(self):
 
100
        self._progress_view.clear()
100
101
 
101
102
 
102
103
class TextProgressView(object):
109
110
    task wants to be painted.
110
111
 
111
112
    Transports feed data to this through the ui_factory object.
 
113
 
 
114
    The Progress views can comprise a tree with _parent_task pointers, but
 
115
    this only prints the stack from the nominated current task up to the root.
112
116
    """
113
117
 
114
118
    def __init__(self, term_file):