Skip to content

Commit

Permalink
bump version, merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Apr 8, 2018
2 parents 5d9e820 + d9f0c7d commit d700e19
Show file tree
Hide file tree
Showing 10 changed files with 120 additions and 92 deletions.
12 changes: 9 additions & 3 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Noam Yorav-Raphael <noamraph@gmail.com> <noamraph@gmail.com>
Casper da Costa-Luis <tqdm@caspersci.uk.to> casperdcl <casper.dcl@physics.org>
Casper da Costa-Luis <tqdm@caspersci.uk.to> casperdcl <CoD11@imperial.ac.uk>
Casper da Costa-Luis <tqdm@caspersci.uk.to> casperdcl
Stephen Larroque <lrq3000@gmail.com>
Guangshuo Chen <guangshuo.chen@inria.fr> Guangshuo CHEN
Noam Yorav-Raphael <noamraph@gmail.com>
James Lu <CrazyPython@users.noreply.github.com>
Julien Chaumont <git@julienc.io>
Riccardo Coccioli <volans-@users.noreply.github.com>
Albert Kottke <albert.kottke@gmail.com>
Pablo Zivic <elsonidoq@gmail.com>
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ Finally, upload everything to pypi. This can be done easily using the
Also, the new release can (should) be added to `github` by creating a new
release from the web interface; uploading packages from the `dist/` folder
created by `[python setup.py] make build`.
The [wiki] can be automatically updated with github release notes by
running `make` within the wiki repository.
[wiki]: https://github.com/tqdm/tqdm/wiki
Notes
~~~~~
Expand Down Expand Up @@ -267,7 +271,7 @@ following:
Additionally (less maintained), there exists:
- A [wiki](https://github.com/tqdm/tqdm/wiki) which is publicly editable.
- A [wiki] which is publicly editable.
- The [gh-pages project](https://tqdm.github.io/tqdm/) which is built from the
[gh-pages branch](https://github.com/tqdm/tqdm/tree/gh-pages), which is
built using [asv](https://github.com/spacetelescope/asv/).
Expand Down
6 changes: 4 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ Changelog
---------

The list of all changes is available either on GitHub's Releases:
|GitHub-Status| or on crawlers such as
|GitHub-Status|, on the
`wiki <https://github.com/tqdm/tqdm/wiki/Releases>`__ or on crawlers such as
`allmychanges.com <https://allmychanges.com/p/python/tqdm/>`_.


Expand Down Expand Up @@ -798,8 +799,9 @@ The main developers, ranked by surviving lines of code, are:

- Casper da Costa-Luis (`casperdcl <https://github.com/casperdcl>`__, ~2/3, |Gift-Casper|)
- Stephen Larroque (`lrq3000 <https://github.com/lrq3000>`__, ~1/3)
- Noam Yorav-Raphael (`noamraph <https://github.com/noamraph>`__, ~1%, original author)
- Guangshuo Chen (`chengs <https://github.com/chengs>`__, ~1%)
- Hadrien Mary (`hadim <https://github.com/hadim>`__, ~1%)
- Noam Yorav-Raphael (`noamraph <https://github.com/noamraph>`__, ~1%, original author)
- Mikhail Korobov (`kmike <https://github.com/kmike>`__, ~1%)

There are also many |GitHub-Contributions| which we are grateful for.
Expand Down
43 changes: 24 additions & 19 deletions examples/7zx.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
-d, --debug-trace Print lots of debugging information (-D NOTSET)
"""
from __future__ import print_function
from docopt import docopt
import logging as log
from argopt import argopt
import logging
import subprocess
import re
from tqdm import tqdm
Expand All @@ -29,41 +29,45 @@
import io
__author__ = "Casper da Costa-Luis <casper.dcl@physics.org>"
__licence__ = "MPLv2.0"
__version__ = "0.2.0"
__version__ = "0.2.1"
__license__ = __licence__

RE_SCN = re.compile("([0-9]+)\s+([0-9]+)\s+(.*)$", flags=re.M)


def main():
args = docopt(__doc__, version=__version__)
if args.pop('--debug-trace', False):
args['--debug'] = "NOTSET"
log.basicConfig(level=getattr(log, args['--debug'], log.INFO),
format='%(levelname)s: %(message)s')
args = argopt(__doc__, version=__version__).parse_args()
if args.debug_trace:
args.debug = "NOTSET"
logging.basicConfig(level=getattr(logging, args.debug, logging.INFO),
format='%(levelname)s:%(message)s')
log = logging.getLogger(__name__)
log.debug(args)

# Get compressed sizes
zips = {}
for fn in args['<zipfiles>']:
for fn in args.zipfiles:
info = subprocess.check_output(["7z", "l", fn]).strip()
finfo = RE_SCN.findall(info)
finfo = RE_SCN.findall(info) # size|compressed|name

# builtin test: last line should be total sizes
log.debug(finfo)
totals = map(int, finfo[-1][:2])
# log.debug(totals)
for s in range(2):
assert (sum(map(int, (inf[s] for inf in finfo[:-1]))) == totals[s])
fcomp = dict((n, int(c if args['--compressed'] else u))
for s in range(2): # size|compressed totals
totals_s = sum(map(int, (inf[s] for inf in finfo[:-1])))
if totals_s != totals[s]:
log.warn("%s: individual total %d != 7z total %d" % (
fn, totals_s, totals[s]))
fcomp = dict((n, int(c if args.compressed else u))
for (u, c, n) in finfo[:-1])
# log.debug(fcomp)
# zips : {'zipname' : {'filename' : int(size)}}
zips[fn] = fcomp

# Extract
cmd7zx = ["7z", "x", "-bd"]
if args['--yes']:
if args.yes:
cmd7zx += ["-y"]
log.info("Extracting from {:d} file(s)".format(len(zips)))
with tqdm(total=sum(sum(fcomp.values()) for fcomp in zips.values()),
Expand All @@ -79,6 +83,8 @@ def main():
with io.open(md, mode="rU", buffering=1) as m:
with tqdm(total=sum(fcomp.values()), disable=len(zips) < 2,
leave=False, unit="B", unit_scale=True) as t:
if not hasattr(t, "start_t"): # disabled
t.start_t = tall._time()
while True:
try:
l_raw = m.readline()
Expand All @@ -98,11 +104,10 @@ def main():
"Files: ", "Size: ",
"Compressed: ")):
if l.startswith("Processing archive: "):
if not args['--silent']:
t.write(
t.format_interval(
t.start_t - tall.start_t) + ' '
+ l.lstrip("Processing archive: "))
if not args.silent:
t.write(t.format_interval(
t.start_t - tall.start_t) + ' ' +
l.lstrip("Processing archive: "))
else:
t.write(l)
ex.wait()
Expand Down
7 changes: 5 additions & 2 deletions tqdm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
from ._main import main
from ._monitor import TMonitor, TqdmSynchronisationWarning
from ._version import __version__ # NOQA
from ._tqdm import TqdmTypeError, TqdmKeyError, TqdmDeprecationWarning, \
from ._tqdm import TqdmTypeError, TqdmKeyError, TqdmWarning, \
TqdmDeprecationWarning, TqdmExperimentalWarning, \
TqdmMonitorWarning

__all__ = ['tqdm', 'tqdm_gui', 'trange', 'tgrange', 'tqdm_pandas',
'tqdm_notebook', 'tnrange', 'main', 'TMonitor',
'TqdmTypeError', 'TqdmKeyError', 'TqdmDeprecationWarning',
'TqdmTypeError', 'TqdmKeyError',
'TqdmWarning', 'TqdmDeprecationWarning',
'TqdmExperimentalWarning',
'TqdmMonitorWarning', 'TqdmSynchronisationWarning',
'__version__']

Expand Down
3 changes: 2 additions & 1 deletion tqdm/_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,8 @@ def main(fp=sys.stderr):
# sys.argv.pop(log)
# logLevel = sys.argv.pop(log)
logLevel = sys.argv[log + 1]
logging.basicConfig(level=getattr(logging, logLevel))
logging.basicConfig(level=getattr(logging, logLevel),
format="%(levelname)s:%(module)s:%(lineno)d:%(message)s")
log = logging.getLogger(__name__)

d = tqdm.__init__.__doc__ + CLI_EXTRA_DOC
Expand Down
Loading

0 comments on commit d700e19

Please sign in to comment.