diff options
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/bar.py')
-rw-r--r-- | venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/bar.py | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/bar.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/bar.py deleted file mode 100644 index 3fdd703..0000000 --- a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/bar.py +++ /dev/null | |||
@@ -1,88 +0,0 @@ | |||
1 | # -*- coding: utf-8 -*- | ||
2 | |||
3 | # Copyright (c) 2012 Giorgos Verigakis <verigak@gmail.com> | ||
4 | # | ||
5 | # Permission to use, copy, modify, and distribute this software for any | ||
6 | # purpose with or without fee is hereby granted, provided that the above | ||
7 | # copyright notice and this permission notice appear in all copies. | ||
8 | # | ||
9 | # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | |||
17 | from __future__ import unicode_literals | ||
18 | from . import Progress | ||
19 | from .helpers import WritelnMixin | ||
20 | |||
21 | |||
22 | class Bar(WritelnMixin, Progress): | ||
23 | width = 32 | ||
24 | message = '' | ||
25 | suffix = '%(index)d/%(max)d' | ||
26 | bar_prefix = ' |' | ||
27 | bar_suffix = '| ' | ||
28 | empty_fill = ' ' | ||
29 | fill = '#' | ||
30 | hide_cursor = True | ||
31 | |||
32 | def update(self): | ||
33 | filled_length = int(self.width * self.progress) | ||
34 | empty_length = self.width - filled_length | ||
35 | |||
36 | message = self.message % self | ||
37 | bar = self.fill * filled_length | ||
38 | empty = self.empty_fill * empty_length | ||
39 | suffix = self.suffix % self | ||
40 | line = ''.join([message, self.bar_prefix, bar, empty, self.bar_suffix, | ||
41 | suffix]) | ||
42 | self.writeln(line) | ||
43 | |||
44 | |||
45 | class ChargingBar(Bar): | ||
46 | suffix = '%(percent)d%%' | ||
47 | bar_prefix = ' ' | ||
48 | bar_suffix = ' ' | ||
49 | empty_fill = '∙' | ||
50 | fill = '█' | ||
51 | |||
52 | |||
53 | class FillingSquaresBar(ChargingBar): | ||
54 | empty_fill = '▢' | ||
55 | fill = '▣' | ||
56 | |||
57 | |||
58 | class FillingCirclesBar(ChargingBar): | ||
59 | empty_fill = '◯' | ||
60 | fill = '◉' | ||
61 | |||
62 | |||
63 | class IncrementalBar(Bar): | ||
64 | phases = (' ', '▏', '▎', '▍', '▌', '▋', '▊', '▉', '█') | ||
65 | |||
66 | def update(self): | ||
67 | nphases = len(self.phases) | ||
68 | filled_len = self.width * self.progress | ||
69 | nfull = int(filled_len) # Number of full chars | ||
70 | phase = int((filled_len - nfull) * nphases) # Phase of last char | ||
71 | nempty = self.width - nfull # Number of empty chars | ||
72 | |||
73 | message = self.message % self | ||
74 | bar = self.phases[-1] * nfull | ||
75 | current = self.phases[phase] if phase > 0 else '' | ||
76 | empty = self.empty_fill * max(0, nempty - len(current)) | ||
77 | suffix = self.suffix % self | ||
78 | line = ''.join([message, self.bar_prefix, bar, current, empty, | ||
79 | self.bar_suffix, suffix]) | ||
80 | self.writeln(line) | ||
81 | |||
82 | |||
83 | class PixelBar(IncrementalBar): | ||
84 | phases = ('⡀', '⡄', '⡆', '⡇', '⣇', '⣧', '⣷', '⣿') | ||
85 | |||
86 | |||
87 | class ShadyBar(IncrementalBar): | ||
88 | phases = (' ', '░', '▒', '▓', '█') | ||