From 1599ada42dedce16ff2f1988ddffd1641cd9f5fd Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Fri, 8 Nov 2019 23:41:19 +0000 Subject: [PATCH] update docs --- .meta/mkdocs.py | 3 +++ README.rst | 16 +++++++++++++++- tqdm/std.py | 2 +- tqdm/tqdm.1 | 7 +++++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.meta/mkdocs.py b/.meta/mkdocs.py index d7b858ea..0d9ff8dd 100644 --- a/.meta/mkdocs.py +++ b/.meta/mkdocs.py @@ -1,4 +1,7 @@ from __future__ import print_function +from os import path +import sys +sys.path = [path.dirname(path.dirname(__file__))] + sys.path # NOQA import tqdm import tqdm.cli from textwrap import dedent diff --git a/README.rst b/README.rst index 22fbcb2d..b5f23f9a 100644 --- a/README.rst +++ b/README.rst @@ -406,6 +406,9 @@ Parameters If (default: None) and ``file`` is unspecified, bytes will be written in Python 2. If ``True`` will also write bytes. In all other cases will default to unicode. +* lock_args : tuple, optional + Passed to ``refresh`` for intermediate output + (initialisation, iterating, and updating). Extra CLI Options ~~~~~~~~~~~~~~~~~ @@ -460,7 +463,18 @@ Returns """Clear current bar display.""" def refresh(self): - """Force refresh the display of this bar.""" + """ + Force refresh the display of this bar. + + Parameters + ---------- + nolock : bool, optional + If ``True``, does not lock. + If [default: ``False``]: calls ``acquire()`` on internal lock. + lock_args : tuple, optional + Passed to internal lock's ``acquire()``. + If specified, will only ``display()`` if ``acquire()`` returns ``True``. + """ def unpause(self): """Restart tqdm timer from last print time.""" diff --git a/tqdm/std.py b/tqdm/std.py index 8dacf3c1..b5ff064e 100644 --- a/tqdm/std.py +++ b/tqdm/std.py @@ -874,7 +874,7 @@ class tqdm(Comparable): bytes. In all other cases will default to unicode. lock_args : tuple, optional Passed to `refresh` for intermediate output - (iterating/updating). + (initialisation, iterating, and updating). gui : bool, optional WARNING: internal parameter - do not use. Use tqdm.gui.tqdm(...) instead. If set, will attempt to use diff --git a/tqdm/tqdm.1 b/tqdm/tqdm.1 index f2ee878e..17adb32e 100644 --- a/tqdm/tqdm.1 +++ b/tqdm/tqdm.1 @@ -209,6 +209,13 @@ In all other cases will default to unicode. .RS .RE .TP +.B \-\-lock_args=\f[I]lock_args\f[] +tuple, optional. +Passed to \f[C]refresh\f[] for intermediate output (initialisation, +iterating, and updating). +.RS +.RE +.TP .B \-\-delim=\f[I]delim\f[] chr, optional. Delimiting character [default: \[aq]\\n\[aq]].