/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/progress.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
        synchronously.
67
67
 
68
68
    :ivar show_transport_activity: If true (default), transport activity
69
 
        will be shown when this task is drawn.  Disable it if you're sure
 
69
        will be shown when this task is drawn.  Disable it if you're sure 
70
70
        that only irrelevant or uninteresting transport activity can occur
71
71
        during this task.
72
72
    """
78
78
 
79
79
        :param progress_view: ProgressView to display this ProgressTask.
80
80
 
81
 
        :param ui_factory: The UI factory that will display updates;
 
81
        :param ui_factory: The UI factory that will display updates; 
82
82
            deprecated in favor of passing progress_view directly.
83
83
 
84
84
        Normally you should not call this directly but rather through
132
132
 
133
133
    def make_sub_task(self):
134
134
        return ProgressTask(self, ui_factory=self.ui_factory,
135
 
                            progress_view=self.progress_view)
 
135
            progress_view=self.progress_view)
136
136
 
137
137
    def _overall_completion_fraction(self, child_fraction=0.0):
138
138
        """Return fractional completion of this task and its parents
139
139
 
140
140
        Returns None if no completion can be computed."""
141
141
        if self.current_cnt is not None and self.total_cnt:
142
 
            own_fraction = (float(self.current_cnt) +
143
 
                            child_fraction) / self.total_cnt
 
142
            own_fraction = (float(self.current_cnt) + child_fraction) / self.total_cnt
144
143
        else:
145
144
            # if this task has no estimation, it just passes on directly
146
145
            # whatever the child has measured...
202
201
    if delt is None:
203
202
        return "-:--:--"
204
203
    delt = int(round(delt))
205
 
    return '%d:%02d:%02d' % (delt / 3600,
206
 
                             (delt / 60) % 60,
 
204
    return '%d:%02d:%02d' % (delt/3600,
 
205
                             (delt/60) % 60,
207
206
                             delt % 60)
208
207
 
209
208
 
210
 
def get_eta(start_time, current, total, enough_samples=3, last_updates=None,
211
 
            n_recent=10):
 
209
def get_eta(start_time, current, total, enough_samples=3, last_updates=None, n_recent=10):
212
210
    if start_time is None:
213
211
        return None
214
212
 
242
240
 
243
241
class ProgressPhase(object):
244
242
    """Update progress object with the current phase"""
245
 
 
246
243
    def __init__(self, message, total, pb):
247
244
        object.__init__(self)
248
245
        self.pb = pb