diff --git a/wn/_add.py b/wn/_add.py index 4ae234f..10883f9 100644 --- a/wn/_add.py +++ b/wn/_add.py @@ -55,20 +55,10 @@ def add( >>> wn.add('english-wordnet-2020.xml') Added ewn:2020 (English WordNet) - The *progress_handler* parameter takes a callable that is called - after every block of rows is inserted. The handler function - should have the following signature: + The *progress_handler* parameter takes a subclass of + :class:`wn.util.ProgressHandler`. An instance of the class will be + created, used, and closed by this function. - .. code-block:: python - - def progress_handler(n: int, **kwargs) -> str: - ... - - The *n* parameter is the number of rows last inserted into the - database. A ``status`` key on the *kwargs* indicates the current - status of adding the lexicon (``Inspecting``, ``ILI``, ``Synset``, - etc.). After inspecting the file, a ``max`` keyword on *kwargs* - indicates the total number of rows to insert. """ if progress_handler is None: progress_handler = ProgressHandler diff --git a/wn/_download.py b/wn/_download.py index c12e2d7..e57d7c7 100644 --- a/wn/_download.py +++ b/wn/_download.py @@ -46,21 +46,9 @@ def download( >>> wn.download('ewn:2020') Added ewn:2020 (English WordNet) - The *progress_handler* parameter takes a callable that is called - after every chunk of bytes is received. The handler function - should have the following signature: - - .. code-block:: python - - def progress_handler(n: int, **kwargs) -> str: - ... - - The *n* parameter is the number of bytes received in a chunk. When - a request is sent, the handler function is called with ``max`` key - in *kwargs* mapped to the total number of bytes (taken from the - response's ``Content-Length`` header). A ``status`` key may also - indicate the current status (``Requesting``, ``Receiving``, - ``Completed``). + The *progress_handler* parameter takes a subclass of + :class:`wn.util.ProgressHandler`. An instance of the class will be + created, used, and closed by this function. """ if is_url(project_or_url):