Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(309)

Side by Side Diff: sdk/lib/_internal/pub/lib/src/progress.dart

Issue 344413004: Support pub --with-prejudice. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/log.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub.progress; 5 library pub.progress;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:io'; 8 import 'dart:io';
9 9
10 import 'log.dart' as log; 10 import 'log.dart' as log;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 74
75 /// Stop animating the progress indicator. 75 /// Stop animating the progress indicator.
76 /// 76 ///
77 /// This will continue running the stopwatch so that the full time can be 77 /// This will continue running the stopwatch so that the full time can be
78 /// logged in [stop]. 78 /// logged in [stop].
79 void stopAnimating() { 79 void stopAnimating() {
80 if (_timer == null) return; 80 if (_timer == null) return;
81 81
82 // Print a final message without a time indicator so that we don't leave a 82 // Print a final message without a time indicator so that we don't leave a
83 // misleading half-complete time indicator on the console. 83 // misleading half-complete time indicator on the console.
84 stdout.writeln("\r$_message..."); 84 stdout.writeln(log.format("\r$_message..."));
85 _timer.cancel(); 85 _timer.cancel();
86 _timer = null; 86 _timer = null;
87 } 87 }
88 88
89 /// Refreshes the progress line. 89 /// Refreshes the progress line.
90 void _update() { 90 void _update() {
91 stdout.write("\r$_message... "); 91 stdout.write(log.format("\r$_message... "));
92 92
93 // Show the time only once it gets noticeably long. 93 // Show the time only once it gets noticeably long.
94 if (_stopwatch.elapsed.inSeconds > 0) { 94 if (_stopwatch.elapsed.inSeconds > 0) {
95 stdout.write(log.gray(_time)); 95 stdout.write(log.gray(_time));
96 } 96 }
97 } 97 }
98 } 98 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/log.dart ('k') | sdk/lib/_internal/pub/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698