diff options
author | Shubham Saini <shubham6405@gmail.com> | 2018-12-11 10:01:23 +0000 |
---|---|---|
committer | Shubham Saini <shubham6405@gmail.com> | 2018-12-11 10:01:23 +0000 |
commit | 68df54d6629ec019142eb149dd037774f2d11e7c (patch) | |
tree | 345bc22d46b4e01a4ba8303b94278952a4ed2b9e /venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py |
First commit
Diffstat (limited to 'venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py')
-rw-r--r-- | venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py new file mode 100644 index 0000000..e993a51 --- /dev/null +++ b/venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/progress/counter.py | |||
@@ -0,0 +1,48 @@ | |||
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 Infinite, Progress | ||
19 | from .helpers import WriteMixin | ||
20 | |||
21 | |||
22 | class Counter(WriteMixin, Infinite): | ||
23 | message = '' | ||
24 | hide_cursor = True | ||
25 | |||
26 | def update(self): | ||
27 | self.write(str(self.index)) | ||
28 | |||
29 | |||
30 | class Countdown(WriteMixin, Progress): | ||
31 | hide_cursor = True | ||
32 | |||
33 | def update(self): | ||
34 | self.write(str(self.remaining)) | ||
35 | |||
36 | |||
37 | class Stack(WriteMixin, Progress): | ||
38 | phases = (' ', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█') | ||
39 | hide_cursor = True | ||
40 | |||
41 | def update(self): | ||
42 | nphases = len(self.phases) | ||
43 | i = min(nphases - 1, int(self.progress * nphases)) | ||
44 | self.write(self.phases[i]) | ||
45 | |||
46 | |||
47 | class Pie(Stack): | ||
48 | phases = ('○', '◔', '◑', '◕', '●') | ||