/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-11-11 04:08:32 UTC
  • mto: (7143.16.20 even-more-cleanups)
  • mto: This revision was merged to the branch mainline in revision 7175.
  • Revision ID: jelmer@jelmer.uk-20181111040832-nsljjynzzwmznf3h
Run autopep8.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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) + child_fraction) / self.total_cnt
 
142
            own_fraction = (float(self.current_cnt) +
 
143
                            child_fraction) / self.total_cnt
143
144
        else:
144
145
            # if this task has no estimation, it just passes on directly
145
146
            # whatever the child has measured...
201
202
    if delt is None:
202
203
        return "-:--:--"
203
204
    delt = int(round(delt))
204
 
    return '%d:%02d:%02d' % (delt/3600,
205
 
                             (delt/60) % 60,
 
205
    return '%d:%02d:%02d' % (delt / 3600,
 
206
                             (delt / 60) % 60,
206
207
                             delt % 60)
207
208
 
208
209
 
240
241
 
241
242
class ProgressPhase(object):
242
243
    """Update progress object with the current phase"""
 
244
 
243
245
    def __init__(self, message, total, pb):
244
246
        object.__init__(self)
245
247
        self.pb = pb