Skip to content

Commit fd80be4

Browse files
committed
Merge branch 'develop' of github.com:WoLpH/python-progressbar into develop
2 parents e91bd1a + 9c590a7 commit fd80be4

20 files changed

Lines changed: 295 additions & 121 deletions

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: WoLpH

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# See https://pre-commit.com for more information
2+
# See https://pre-commit.com/hooks.html for more hooks
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v2.4.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: check-yaml
9+
- id: check-added-large-files
10+
11+
- repo: https://gitlab.com/pycqa/flake8
12+
rev: 3.7.9
13+
hooks:
14+
- id: flake8

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ python:
77
- '3.5'
88
- '3.6'
99
- '3.7'
10+
- '3.8'
1011
- pypy
1112
install:
1213
- pip install -U .
1314
- pip install -U -r tests/requirements.txt
14-
before_script: flake8 progressbar tests examples
15+
before_script: flake8 progressbar tests examples.py
1516
script:
16-
- python setup.py test
17+
- py.test
1718
- python examples.py
1819
after_success:
1920
- coveralls

CONTRIBUTING.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributing
33
============
44

55
Contributions are welcome, and they are greatly appreciated! Every
6-
little bit helps, and credit will always be given.
6+
little bit helps, and credit will always be given.
77

88
You can contribute in many ways:
99

@@ -36,7 +36,7 @@ is open to whoever wants to implement it.
3636
Write Documentation
3737
~~~~~~~~~~~~~~~~~~~
3838

39-
Python Progressbar could always use more documentation, whether as part of the
39+
Python Progressbar could always use more documentation, whether as part of the
4040
official Python Progressbar docs, in docstrings, or even on the web in blog posts,
4141
articles, and such.
4242

@@ -75,7 +75,7 @@ Ready to contribute? Here's how to set up `python-progressbar` for local develop
7575
Or without git-flow:
7676

7777
$ git checkout -b feature/name-of-your-bugfix-or-feature
78-
78+
7979
Now you can make your changes locally.
8080

8181
5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
@@ -85,7 +85,7 @@ Ready to contribute? Here's how to set up `python-progressbar` for local develop
8585
$ tox
8686

8787
To get flake8 and tox, just pip install them into your virtualenv using the requirements file.
88-
88+
8989
$ pip install -r tests/requirements.txt
9090

9191
6. Commit your changes and push your branch to GitHub with `git-flow-avh`_::
@@ -111,7 +111,7 @@ Before you submit a pull request, check that it meets these guidelines:
111111
2. If the pull request adds functionality, the docs should be updated. Put
112112
your new functionality into a function with a docstring, and add the
113113
feature to the list in README.rst.
114-
3. The pull request should work for Python 2.7, 3.3, and for PyPy. Check
114+
3. The pull request should work for Python 2.7, 3.3, and for PyPy. Check
115115
https://travis-ci.org/WoLpH/python-progressbar/pull_requests
116116
and make sure that the tests pass for all supported Python versions.
117117

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ include requirements.txt
88
include Makefile
99
include pytest.ini
1010
recursive-include tests *
11+
recursive-exclude *.pyc
12+
recursive-exclude *.pyo

Makefile

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Install
1919
The package can be installed through `pip` (this is the recommended method):
2020

2121
pip install progressbar2
22-
22+
2323
Or if `pip` is not available, `easy_install` should work as well:
2424

2525
easy_install progressbar2
26-
26+
2727
Or download the latest release from Pypi (https://pypi.python.org/pypi/progressbar2) or Github.
2828

2929
Note that the releases on Pypi are signed with my GPG key (https://pgp.mit.edu/pks/lookup?op=vindex&search=0xE81444E9CE1F695D) and can be checked using GPG:
@@ -83,7 +83,7 @@ Links
8383
- https://progressbar-2.readthedocs.org/en/latest/
8484
* Source
8585
- https://github.com/WoLpH/python-progressbar
86-
* Bug reports
86+
* Bug reports
8787
- https://github.com/WoLpH/python-progressbar/issues
8888
* Package homepage
8989
- https://pypi.python.org/pypi/progressbar2
@@ -103,7 +103,7 @@ Wrapping an iterable
103103
104104
import time
105105
import progressbar
106-
106+
107107
for i in progressbar.progressbar(range(100)):
108108
time.sleep(0.02)
109109
@@ -119,7 +119,7 @@ One option to force early initialization is by using the `WRAP_STDERR`
119119
environment variable, on Linux/Unix systems this can be done through:
120120

121121
.. code:: sh
122-
122+
123123
# WRAP_STDERR=true python your_script.py
124124
125125
If you need to flush manually while wrapping, you can do so using:

docs/_theme/LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Modifications:
1+
Modifications:
22

33
Copyright (c) 2012 Rick van Hattem.
44

55

6-
Original Projects:
6+
Original Projects:
77

88
Copyright (c) 2010 Kenneth Reitz.
99
Copyright (c) 2010 by Armin Ronacher.

docs/_theme/wolph/theme.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ stylesheet = flasky.css
44
pygments_style = flask_theme_support.FlaskyStyle
55

66
[options]
7-
touch_icon =
7+
touch_icon =

examples.py

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
#!/usr/bin/python
22
# -*- coding: utf-8 -*-
33

4+
from __future__ import absolute_import
5+
from __future__ import division
46
from __future__ import print_function
7+
from __future__ import unicode_literals
8+
from __future__ import with_statement
59

610
import functools
711
import random
@@ -81,8 +85,30 @@ def basic_widget_example():
8185

8286
@example
8387
def color_bar_example():
84-
widgets = ['\x1b[33mColorful example\x1b[39m', progressbar.Percentage(),
85-
progressbar.Bar(marker='\x1b[32m#\x1b[39m')]
88+
widgets = [
89+
'\x1b[33mColorful example\x1b[39m',
90+
progressbar.Percentage(),
91+
progressbar.Bar(marker='\x1b[32m#\x1b[39m'),
92+
]
93+
bar = progressbar.ProgressBar(widgets=widgets, max_value=10).start()
94+
for i in range(10):
95+
# do something
96+
time.sleep(0.1)
97+
bar.update(i + 1)
98+
bar.finish()
99+
100+
101+
@example
102+
def color_bar_animated_marker_example():
103+
widgets = [
104+
# Colored animated marker with colored fill:
105+
progressbar.Bar(marker=progressbar.AnimatedMarker(
106+
fill='x',
107+
# fill='█',
108+
fill_wrap='\x1b[32m{}\x1b[39m',
109+
marker_wrap='\x1b[31m{}\x1b[39m',
110+
)),
111+
]
86112
bar = progressbar.ProgressBar(widgets=widgets, max_value=10).start()
87113
for i in range(10):
88114
# do something

0 commit comments

Comments
 (0)