diff --git a/HISTORY.rst b/HISTORY.rst index 89dcc4028..791c45e1d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,5 +1,4 @@ - .. _l-HISTORY: ======= @@ -128,4 +127,3 @@ current - 2018-10-06 - 0.00Mb 1.5.2275 - 2017-11-28 - 0.50Mb ============================== - diff --git a/_doc/sphinxdoc/source/api/helpgen.rst b/_doc/sphinxdoc/source/api/helpgen.rst index cec07014b..1ce9c51e0 100644 --- a/_doc/sphinxdoc/source/api/helpgen.rst +++ b/_doc/sphinxdoc/source/api/helpgen.rst @@ -13,11 +13,11 @@ configuration conversion ++++++++++ -.. autosignature:: pyquickhelper.helpgen.sphinxm_convert_doc_helper.docstring2html +.. autosignature:: pyquickhelper.helpgen.rst_converters.docstring2html .. autosignature:: pyquickhelper.helpgen.pandoc_helper.latex2rst -.. autosignature:: pyquickhelper.helpgen.sphinxm_convert_doc_helper.rst2html +.. autosignature:: pyquickhelper.helpgen.rst_converters.rst2html specific ++++++++ diff --git a/_doc/sphinxdoc/source/api/jupyter.rst b/_doc/sphinxdoc/source/api/jupyter.rst index 1a7a6e4e6..aa9de642e 100644 --- a/_doc/sphinxdoc/source/api/jupyter.rst +++ b/_doc/sphinxdoc/source/api/jupyter.rst @@ -29,13 +29,6 @@ controls .. autosignature:: pyquickhelper.ipythonhelper.interact.StaticInteract -extensions -++++++++++ - -.. autosignature:: pyquickhelper.ipythonhelper.cython_helper.ipython_cython_extension - -.. autosignature:: pyquickhelper.ipythonhelper.helper_in_notebook.load_extension - kernels +++++++ diff --git a/_doc/sphinxdoc/source/api/pycode.rst b/_doc/sphinxdoc/source/api/pycode.rst index 5255b2c5e..c10c3b09a 100644 --- a/_doc/sphinxdoc/source/api/pycode.rst +++ b/_doc/sphinxdoc/source/api/pycode.rst @@ -51,7 +51,7 @@ virtual environments .. autosignature:: pyquickhelper.pycode.venv_helper.check_readme_syntax -.. autosignature:: pyquickhelper.pycode.venv_helper.compare_module_version +.. autosignature:: pyquickhelper.texthelper.version_helper.compare_module_version .. autosignature:: pyquickhelper.pycode.venv_helper.create_virtual_env diff --git a/_doc/sphinxdoc/source/documentation_example.rst b/_doc/sphinxdoc/source/documentation_example.rst index ffed8f3fb..a0ac074f2 100644 --- a/_doc/sphinxdoc/source/documentation_example.rst +++ b/_doc/sphinxdoc/source/documentation_example.rst @@ -45,4 +45,4 @@ example with a running script a predefined link ----------------- -:epkg:`XD` +:epkg:`pep8` diff --git a/_doc/sphinxdoc/source/tutorial/sphinx.rst b/_doc/sphinxdoc/source/tutorial/sphinx.rst index 4922ea73f..d19b9d250 100644 --- a/_doc/sphinxdoc/source/tutorial/sphinx.rst +++ b/_doc/sphinxdoc/source/tutorial/sphinx.rst @@ -322,7 +322,7 @@ directory. ax.plot([0, 1], [0, 1], '--') fig.savefig(os.path.join(__WD__, "oo.png")) - text = ".. image:: oo.png\\n :width: 200px" + text = ".. image:: oo.png\\n :width: 202px" print(text) The image needs to be save in the same folder than @@ -336,7 +336,7 @@ the *rst* file. ax.plot([0, 1], [0, 1], '--') fig.savefig(os.path.join(__WD__, "oo.png")) - text = ".. image:: oo.png\\n :width: 200px" + text = ".. image:: oo.png\\n :width: 201px" print(text) Option ``:toggle:`` can hide the code or the output or both @@ -714,7 +714,7 @@ to use files. I finally decided to spend some time on Sphinx to be able to run it to convert a RST into HTML and RST. That's the purpose of the next function: -.. autosignature:: pyquickhelper.helpgen.sphinxm_convert_doc_helper.rst2html +.. autosignature:: pyquickhelper.helpgen.rst_converters.rst2html The HTML conversion is quite difficult to read: diff --git a/_doc/sphinxdoc/source/tutorial/unittest.rst b/_doc/sphinxdoc/source/tutorial/unittest.rst index 8623f9008..98647c012 100644 --- a/_doc/sphinxdoc/source/tutorial/unittest.rst +++ b/_doc/sphinxdoc/source/tutorial/unittest.rst @@ -11,7 +11,7 @@ as :epkg:`pyquickhelper`: all names are prefixed by ``ut_``. * Tests files starts with ``test_``. * Unit test must inherits from :*py:`unittest:TestCase` or - :class:`ExtTestCase ` + :py:class:`ExtTestCase ` which adds a couple of *assert* methods. One function is used to prints information but is disabled diff --git a/_unittests/ut_sphinxext/test_blocref_extension.py b/_unittests/ut_sphinxext/test_blocref_extension.py index 3245a046f..0c2bd657d 100644 --- a/_unittests/ut_sphinxext/test_blocref_extension.py +++ b/_unittests/ut_sphinxext/test_blocref_extension.py @@ -230,8 +230,7 @@ def test_blocreflist(self): tives = [("blocref", BlocRef, blocref_node, visit_blocref_node, depart_blocref_node)] - html = rst2html(content, fLOG=fLOG, - writer="html", keep_warnings=True, + html = rst2html(content, writer="html", keep_warnings=True, directives=tives) temp = get_temp_folder(__file__, "temp_blocreflist") @@ -252,6 +251,4 @@ def test_blocreflist(self): if __name__ == "__main__": - TestBlocRefExtension().test_post_parse_blocref() - TestBlocRefExtension().test_blocref_rst() - # unittest.main() + unittest.main() diff --git a/_unittests/ut_sphinxext/test_cmdref_extension.py b/_unittests/ut_sphinxext/test_cmdref_extension.py index 97027e7c2..27bed9939 100644 --- a/_unittests/ut_sphinxext/test_cmdref_extension.py +++ b/_unittests/ut_sphinxext/test_cmdref_extension.py @@ -162,6 +162,9 @@ def test_cmdreflist(self): if t1 not in html: raise Exception(html) + if 'freg0">' in html: + raise Exception(html) + def test_cmdref_rename(self): fLOG( __file__, diff --git a/src/pyquickhelper/__init__.py b/src/pyquickhelper/__init__.py index d18a45d62..302563342 100644 --- a/src/pyquickhelper/__init__.py +++ b/src/pyquickhelper/__init__.py @@ -92,8 +92,6 @@ def get_insetup_functions(): Returns function used when a module includes C++ parts. @return tuple of functions - - .. versionadded:: 1.5 """ from .pycode.insetup_helper import must_build, run_build_ext return must_build, run_build_ext diff --git a/src/pyquickhelper/benchhelper/benchmark.py b/src/pyquickhelper/benchhelper/benchmark.py index ca0df9c81..83d9d8d15 100644 --- a/src/pyquickhelper/benchhelper/benchmark.py +++ b/src/pyquickhelper/benchhelper/benchmark.py @@ -1,8 +1,6 @@ """ @file @brief Helpers to benchmark something - -.. versionadded:: 1.5 """ import os import sys @@ -238,10 +236,10 @@ def fLOG(self, *l, **p): if self._fLOG: self._fLOG(*l, **p) if hasattr(self, "_progressbars") and self._progressbars and len(self._progressbars) > 0: - bar = self._progressbars[-1] - bar.set_description(fLOGFormat( + br = self._progressbars[-1] + br.set_description(fLOGFormat( "\n", *l, **p).strip("\n").split("\n")[0]) - bar.refresh() + br.refresh() def run(self, params_list): """ diff --git a/src/pyquickhelper/cli/cli_helper.py b/src/pyquickhelper/cli/cli_helper.py index 33badb184..46e414802 100644 --- a/src/pyquickhelper/cli/cli_helper.py +++ b/src/pyquickhelper/cli/cli_helper.py @@ -1,8 +1,6 @@ """ @file @brief Automate the creation of a parser based on a function. - -.. versionadded:: 1.5 """ from __future__ import print_function import argparse @@ -21,8 +19,6 @@ def clean_documentation_for_cli(doc, cleandoc): @param cleandoc a string which tells how to clean, or a function which takes a function and returns a string - - .. versionadded:: 1.6.2290 """ for st in ('.. versionchanged::', '.. versionadded'): if st in doc: @@ -74,9 +70,6 @@ def create_cli_parser(f, prog=None, layout="sphinx", skip_parameters=('fLOG',), If an annotation offers mutiple types, the first one will be used for the command line. - - .. versionchanged:: 1.6.2290 - Parameters *options*, *cleandoc* were added. """ docf = clean_documentation_for_cli(f.__doc__, cleandoc) doctree = docstring2html(docf, writer="doctree", @@ -224,9 +217,6 @@ def flog(*l): r = rows[0][0] if not r.startswith("usage: mycommand_line ..."): raise Exception(r) - - .. versionchanged:: 1.6.2290 - Parameters *options*, *cleandoc* were added. """ if parser is None: parser = create_cli_parser( diff --git a/src/pyquickhelper/cli/encryption_cli.py b/src/pyquickhelper/cli/encryption_cli.py index 5b2f0791a..6e980d51d 100644 --- a/src/pyquickhelper/cli/encryption_cli.py +++ b/src/pyquickhelper/cli/encryption_cli.py @@ -1,8 +1,6 @@ """ @file @brief encrypt and decrypt command lines - -.. versionadded:: 1.3 """ from __future__ import print_function import os @@ -10,7 +8,7 @@ import sys -def get_parser(encrypt): +def get_parser(encrypt): # pylint: disable=W0621 """ Defines the way to parse the magic command ``%encrypt`` and ``%decrypt``. @@ -53,7 +51,7 @@ def get_parser(encrypt): return parser -def do_main(source, dest, password, encrypt, +def do_main(source, dest, password, encrypt, # pylint: disable=W0621 crypt_file, crypt_map, regex=None, fLOG=None): """ Encrypts or decrypts a folder, see @see cl EncryptedBackup. @@ -126,9 +124,6 @@ def encrypt(fLOG=print, args=None): :cmd: pyquickhelper.cli.encryption_cli:encrypt Encrypts a string from the command line. - - .. versionchanged:: 1.5 - Parameter *args* was added. """ parser = get_parser(True) if args is not None and args == ['--help']: @@ -161,9 +156,6 @@ def decrypt(fLOG=print, args=None): :cmd: pyquickhelper.cli.encryption_cli:decrypt Decrypts an encrypted string from the command line. - - .. versionchanged:: 1.5 - Parameter *args* was added. """ parser = get_parser(False) if args is not None and args == ['--help']: diff --git a/src/pyquickhelper/cli/encryption_file_cli.py b/src/pyquickhelper/cli/encryption_file_cli.py index 7c7053d1c..abb0745e7 100644 --- a/src/pyquickhelper/cli/encryption_file_cli.py +++ b/src/pyquickhelper/cli/encryption_file_cli.py @@ -1,8 +1,6 @@ """ @file @brief encrypt and decrypt command lines for just a file - -.. versionadded:: 1.3 """ from __future__ import print_function import os @@ -81,9 +79,6 @@ def encrypt_file(fLOG=print, args=None): :cmd: pyquickhelper.cli.encryption_file_cli:encrypt_file Encrypt a file from the command line. - - .. versionchanged:: 1.5 - Parameter *args* was added. """ parser = get_parser(True) try: @@ -111,9 +106,6 @@ def decrypt_file(fLOG=print, args=None): :cmd: pyquickhelper.cli.encryption_file_cli:decrypt_file Decrypt a file from the command line. - - .. versionchanged:: 1.5 - Parameter *args* was added. """ parser = get_parser(False) try: diff --git a/src/pyquickhelper/cli/pyq_sync_cli.py b/src/pyquickhelper/cli/pyq_sync_cli.py index 454a4ea50..e888aad19 100644 --- a/src/pyquickhelper/cli/pyq_sync_cli.py +++ b/src/pyquickhelper/cli/pyq_sync_cli.py @@ -1,8 +1,6 @@ """ @file @brief Wrapper function @see fn synchronize_folder into a command line. - -.. versionadded:: 1.5 """ from __future__ import print_function import os diff --git a/src/pyquickhelper/filehelper/anyfhelper.py b/src/pyquickhelper/filehelper/anyfhelper.py index 81f1fd76b..86488e6f9 100644 --- a/src/pyquickhelper/filehelper/anyfhelper.py +++ b/src/pyquickhelper/filehelper/anyfhelper.py @@ -1,8 +1,6 @@ """ @file @brief Various helpers about files - -.. versionadded:: 1.1 """ import os @@ -152,12 +150,7 @@ def read_content_ufs(file_url_stream, encoding="utf8", asbytes=False, add_source * *SB*: BytesIO * *SBb*: BytesIO, return bytes - .. versionchanged:: 1.3 - Parameter *asbytes* was added. The function can return bytes. - - .. versionchanged:: 1.4 - Parameter *add_source* was added. - The returned *source* is not reliable on Python 2.7. + The function can return bytes. """ if isinstance(file_url_stream, str # unicode# ): diff --git a/src/pyquickhelper/filehelper/download_helper.py b/src/pyquickhelper/filehelper/download_helper.py index 7c438f1cc..943cb230f 100644 --- a/src/pyquickhelper/filehelper/download_helper.py +++ b/src/pyquickhelper/filehelper/download_helper.py @@ -1,8 +1,6 @@ """ @file @brief A function to download the content of a url. - -.. versionadded:: 1.1 """ import sys import socket @@ -52,12 +50,6 @@ def get_url_content_timeout(url, timeout=10, output=None, encoding="utf8", raise format, it will decompress it. The function raises the exception @see cl InternetException. - - .. versionadded:: 1.1 - It comes from `pyrsslocal `_. - - .. versionadded:: 1.4 - Parameters *chunk*, *fLOG* were added. """ def save_content(content, append=False): "local function" @@ -92,7 +84,7 @@ def save_content(content, append=False): def _local_loop(ur): while True: res = ur.read(chunk) - size[0] += len(res) + size[0] += len(res) # pylint: disable=E1137 if fLOG is not None: fLOG("[get_url_content_timeout] downloaded", size, "bytes") @@ -102,7 +94,7 @@ def _local_loop(ur): save_content(res, app) else: break - app[0] = True + app[0] = True # pylint: disable=E1137 if timeout != -1: with urllib_request.urlopen(url, timeout=timeout) as ur: diff --git a/src/pyquickhelper/filehelper/encrypted_backup.py b/src/pyquickhelper/filehelper/encrypted_backup.py index c326ec9d2..804d0c9a2 100644 --- a/src/pyquickhelper/filehelper/encrypted_backup.py +++ b/src/pyquickhelper/filehelper/encrypted_backup.py @@ -1,8 +1,6 @@ """ @file @brief Keeps an encrypted of personal data - -.. versionadded:: 1.3 """ import re import os @@ -90,8 +88,6 @@ class EncryptedBackup: dest=os.path.join(this, "_temp") enc.retrieve_all(dest) - - .. versionadded:: 1.3 """ def __init__(self, key, file_tree_node, transfer_api, diff --git a/src/pyquickhelper/filehelper/encryption.py b/src/pyquickhelper/filehelper/encryption.py index 91fa5680f..503825a94 100644 --- a/src/pyquickhelper/filehelper/encryption.py +++ b/src/pyquickhelper/filehelper/encryption.py @@ -2,7 +2,7 @@ @file @brief Encryption functionalities. -Inspired from `AES encryption of files in Python withPyCrypto +Inspired from `AES encryption of files in Python with PyCrypto `_ """ import random @@ -163,8 +163,6 @@ def encrypt_stream(key, filename, out_filename=None, chunksize=2 ** 18, algo="AE @param algo AES (PyCryptodomex) of or fernet (cryptography) @return filename or bytes - - .. versionadded:: 1.3 """ in_size, in_close, in_stream, out_close, out_return, out_stream = open_input_output( @@ -205,11 +203,9 @@ def decrypt_stream(key, filename, out_filename=None, chunksize=3 * 2 ** 13, algo sizes can be faster for some files and machines. chunksize must be divisible by 16. - @param algo AES (PyCryptodomex) of or fernet (cryptography) + @param algo AES (:epkg:`pycryptodomex`) of or fernet (cryptography) @return filename or bytes - - .. versionadded:: 1.3 """ in_size, in_close, in_stream, out_close, out_return, out_stream = open_input_output( filename, out_filename) diff --git a/src/pyquickhelper/filehelper/file_info.py b/src/pyquickhelper/filehelper/file_info.py index c32313cc6..b24f92c7f 100644 --- a/src/pyquickhelper/filehelper/file_info.py +++ b/src/pyquickhelper/filehelper/file_info.py @@ -59,8 +59,6 @@ def is_file_string(s): @param s string @return boolean - - .. versionadded:: 1.3 """ if len(s) >= 3000: return False @@ -79,8 +77,6 @@ def is_url_string(s): @param s string @return boolean - - .. versionadded:: 1.3 """ if "\n" in s: return False diff --git a/src/pyquickhelper/filehelper/file_tree_node.py b/src/pyquickhelper/filehelper/file_tree_node.py index 85ee3d70b..3d4641992 100644 --- a/src/pyquickhelper/filehelper/file_tree_node.py +++ b/src/pyquickhelper/filehelper/file_tree_node.py @@ -95,9 +95,6 @@ def __init__(self, root, file=None, filter=None, level=0, parent=None, @param log log every explored folder @param log1 intermediate logs (first level) @param fLOG logging function to use - - .. versionchanged:: 1.1 - Parameter *fLOG* was added. """ if root is None: raise ValueError("root cannot be None") @@ -206,8 +203,6 @@ def get_content(self, encoding="utf8"): @param encoding encoding @return content as a string - - .. versionadded:: 1.1 """ if sys.version_info[0] == 2: import codecs diff --git a/src/pyquickhelper/filehelper/files_status.py b/src/pyquickhelper/filehelper/files_status.py index 51ab0716a..0af094cae 100644 --- a/src/pyquickhelper/filehelper/files_status.py +++ b/src/pyquickhelper/filehelper/files_status.py @@ -2,9 +2,6 @@ """ @file @brief keep the status of a folder, assuming this folder is not moved - -.. versionchanged:: 1.0 - This file was renamed into *files_status.py*. """ import os @@ -22,10 +19,7 @@ class FilesStatus: """ This class maintains a list of files and does some verifications in order to check if a file - was modified or not (if yes, then it will be updated to the website) - - .. versionchanged:: 1.0 - This class was renamed from FileTreeStatus into ``FilesStatus``. + was modified or not (if yes, then it will be updated to the website). """ def __init__(self, file, fLOG=noLOG): diff --git a/src/pyquickhelper/filehelper/ftp_mock.py b/src/pyquickhelper/filehelper/ftp_mock.py index 36356e361..30fd25d08 100644 --- a/src/pyquickhelper/filehelper/ftp_mock.py +++ b/src/pyquickhelper/filehelper/ftp_mock.py @@ -1,8 +1,6 @@ """ @file -@brief Mock classes - -.. versionadded:: 1.4 +@brief Mock FTP classes. """ import sys from ..loghelper.flog import noLOG diff --git a/src/pyquickhelper/filehelper/ftp_transfer.py b/src/pyquickhelper/filehelper/ftp_transfer.py index a797e5890..da6b3b80c 100644 --- a/src/pyquickhelper/filehelper/ftp_transfer.py +++ b/src/pyquickhelper/filehelper/ftp_transfer.py @@ -1,9 +1,6 @@ """ @file @brief provides some functionalities to upload file to a website - -.. versionadded:: 1.0 - moved from pyensae to pyquickhelper """ from ftplib import FTP, error_perm import os @@ -67,9 +64,6 @@ class TransferFTP: ftp.close() except Exception as e : print ("unable to close FTP connection using ftp.close") - - .. versionadded:: 1.0 - Moved prom pyensee to pyquickhelper. """ errorNoDirectory = "Can't change directory" @@ -221,14 +215,12 @@ def pwd(self): def dir(self, path='.'): """ - list the content of a path + Lists the content of a path. @param path path @return list of path - see :meth:`enumerate_ls ` - - .. versionchanged:: 1.0 + See :meth:`enumerate_ls ` """ return list(self.enumerate_ls(path)) @@ -252,8 +244,6 @@ def ls(self, path='.'): for v in res: print(v["name"]) ftp.close() - - .. versionchanged:: 1.0 """ return list(self.enumerate_ls(path)) @@ -274,8 +264,6 @@ def enumerate_ls(self, path='.'): 'sizd': '5', 'unix.gid': '000', 'modify': '111111'} - - .. versionadded:: 1.0 """ if sys.version_info[0] == 2: for a in self.run_command(self._ftp.nlst, path): @@ -299,13 +287,7 @@ def transfer(self, file, to, name, debug=False, blocksize=None, callback=None): @param callback see :tpl:`py,m='ftplib',o='FTP.storbinary'` @return status - .. versionchanged:: 1.0 - file can be a file name or a stream, - parameter *name* was added - - .. versionchanged:: 1.4 - When an error happens, the original current directory is restored. - Parameters *blocksize*, *callback* were added. + When an error happens, the original current directory is restored. """ path = to.split("/") path = [_ for _ in path if len(_) > 0] @@ -396,8 +378,6 @@ def retrieve(self, fold, name, file, debug=False): @param name name of the stream on the website @param debug if True, displays more information @return status - - .. versionadded:: 1.3 """ path = fold.split("/") path = [_ for _ in path if len(_) > 0] diff --git a/src/pyquickhelper/filehelper/ftp_transfer_files.py b/src/pyquickhelper/filehelper/ftp_transfer_files.py index 310a1e7a2..ad3bd85be 100644 --- a/src/pyquickhelper/filehelper/ftp_transfer_files.py +++ b/src/pyquickhelper/filehelper/ftp_transfer_files.py @@ -1,8 +1,6 @@ """ @file @brief Class to transfer files to a website using FTP, it only transfers updated files - -.. versionadded:: 1.0 """ from __future__ import print_function import re @@ -113,8 +111,6 @@ class FolderTransferFTP: fftp.start_transfering() ftp.close() - - .. versionadded:: 1.0 """ def __init__(self, file_tree_node, ftp_transfer, file_status, root_local=None, @@ -148,9 +144,8 @@ def filter_out(full_file_name, filename): # ... return True # if the file is filtered out, False otherwise - .. versionchanged:: 1.3 - Function *filter_out* receives another parameter (filename) - to give more information when raising an exception. + Function *filter_out* receives another parameter (filename) + to give more information when raising an exception. """ self._ftn = file_tree_node self._ftp = ftp_transfer @@ -222,11 +217,7 @@ def preprocess_before_transfering(self, path, force_binary=False, force_allow=No @param force_allow allow these strings even if they seem to be credentials @return binary stream, size - .. versionchanged:: 1.4 - Returns also *size*. - - .. versionchanged:: 1.5 - Bypass utf-8 encoding checking when the extension is ``.rst.txt``. + Bypass utf-8 encoding checking when the extension is ``.rst.txt``. """ if force_binary or self._is_binary(path): size = os.stat(path).st_size diff --git a/src/pyquickhelper/filehelper/ftp_transfer_mock.py b/src/pyquickhelper/filehelper/ftp_transfer_mock.py index 42ac7b783..9913ecd7b 100644 --- a/src/pyquickhelper/filehelper/ftp_transfer_mock.py +++ b/src/pyquickhelper/filehelper/ftp_transfer_mock.py @@ -1,9 +1,6 @@ """ @file @brief Mock class @see cl TransferFTP - -.. versionadded:: 1.0 - moved from pyensae to pyquickhelper """ from ftplib import FTP from ..loghelper.flog import noLOG @@ -16,7 +13,7 @@ class MockTransferFTP (TransferFTP): mock @see cl TransferFTP """ - def __init__(self, site, login, password, fLOG=noLOG): + def __init__(self, site, login, password, fLOG=noLOG): # pylint: disable=W0231 """ same signature as @see cl TransferFTP """ diff --git a/src/pyquickhelper/filehelper/internet_helper.py b/src/pyquickhelper/filehelper/internet_helper.py index 4d8d1550e..f1d2e64e4 100644 --- a/src/pyquickhelper/filehelper/internet_helper.py +++ b/src/pyquickhelper/filehelper/internet_helper.py @@ -42,9 +42,6 @@ def download(url, path_download=".", outfile=None, fLOG=noLOG): If *outfile* is "", the function will remove every weird character. If *outfile* is not null, the function will use it. It will be relative to the current folder and not *path_download*. - - .. versionadded:: 0.9 - """ lurl = url.lower() if lurl.startswith("file://"): @@ -152,8 +149,6 @@ def read_url(url, encoding=None): @param url url @param encoding if None, the result type is bytes, str otherwise @return str (encoding is not None) or bytes - - .. versionadded:: 1.1 """ request = urllib_request.Request(url) if sys.version_info[0] == 2: diff --git a/src/pyquickhelper/filehelper/synchelper.py b/src/pyquickhelper/filehelper/synchelper.py index 49d5fbb25..181489c78 100644 --- a/src/pyquickhelper/filehelper/synchelper.py +++ b/src/pyquickhelper/filehelper/synchelper.py @@ -287,8 +287,9 @@ def regtrue2(f): action = [] modif = 0 + report = {">": 0, ">+": 0, "<": 0, "<+": 0, "<=": 0, ">-": 0, "issue": 0} - fLOG("Starting synchronisation.") + fLOG("[synchronize_folder] Starting synchronisation.") nbcur = 0 nbprint = 0 for op, file, n1, n2 in res: @@ -307,6 +308,7 @@ def regtrue2(f): if r and status is not None: status.update_copied_file(n1.fullname) modif += 1 + report[op] += 1 if modif % 50 == 0: fLOG( "[synchronize_folder] Processed {0}/{1} (current: '{2}')".format(nbcur, len(res), file)) @@ -322,6 +324,7 @@ def regtrue2(f): if status is not None: status.update_copied_file(n1.fullname) modif += 1 + report[op] += 1 if modif % 50 == 0: fLOG( "[synchronize_folder] Processed {0}/{1} (current: '{2}')".format(nbcur, len(res), file)) @@ -345,19 +348,21 @@ def regtrue2(f): if ft is not None: action.append((">-", None, ft)) if not avoid_copy: - fLOG("- remove ", filerem) + fLOG( + "[synchronize_folder] - remove ", filerem) os.remove(filerem) if status is not None: status.update_copied_file( file, delete=True) modif += 1 + report[op] += 1 if modif % 50 == 0: fLOG( "[synchronize_folder] Processed {0}/{1} (current: '{2}')".format(nbcur, len(res), file)) status.save_dates() else: fLOG( - "- skip (probably already removed) ", filerem) + "[synchronize_folder] - skip (probably already removed) ", filerem) else: if not n2.isdir() and not no_deletion: if not avoid_copy: @@ -367,6 +372,7 @@ def regtrue2(f): status.update_copied_file( n1.fullname, delete=True) modif += 1 + report[">-"] += 1 if modif % 50 == 0: fLOG( "[synchronize_folder] Processed {0}/{1} (current: '{2}')".format(nbcur, len(res), file)) @@ -374,12 +380,20 @@ def regtrue2(f): elif n2 is not None and n1._size != n2._size and not n1.isdir(): fLOG("[synchronize_folder] problem: size are different for file %s (%d != %d) dates (%s,%s) (op %s)" % ( file, n1._size, n2._size, n1._date, n2._date, op)) + report["issue"] += 1 # n1.copy_to(f2) # raise Exception ("size are different for file %s (%d != %d) (op %s)" % (file, n1._size, n2._size, op)) if status is not None: status.save_dates(file_date) + report = [(k, v) for k, v in sorted(report.items()) if v > 0] + if len(report): + msg = ["{}={}".format(k, v) for k, v in report] + fLOG("[synchronize_folder] END: {}".format(msg)) + else: + fLOG("[synchronize_folder] END: no copy") + return action diff --git a/src/pyquickhelper/filehelper/transfer_api.py b/src/pyquickhelper/filehelper/transfer_api.py index 235afdf34..2090cc3b1 100644 --- a/src/pyquickhelper/filehelper/transfer_api.py +++ b/src/pyquickhelper/filehelper/transfer_api.py @@ -1,8 +1,6 @@ """ @file @brief API to move files - -.. versionadded:: 1.3 """ import sys import json diff --git a/src/pyquickhelper/filehelper/transfer_api_file.py b/src/pyquickhelper/filehelper/transfer_api_file.py index 35e138e0d..f7ca9eaf1 100644 --- a/src/pyquickhelper/filehelper/transfer_api_file.py +++ b/src/pyquickhelper/filehelper/transfer_api_file.py @@ -1,8 +1,6 @@ """ @file @brief API to move files using FTP - -.. versionadded:: 1.3 """ import os import sys diff --git a/src/pyquickhelper/filehelper/transfer_api_ftp.py b/src/pyquickhelper/filehelper/transfer_api_ftp.py index 8322705df..ea3eafebe 100644 --- a/src/pyquickhelper/filehelper/transfer_api_ftp.py +++ b/src/pyquickhelper/filehelper/transfer_api_ftp.py @@ -1,8 +1,6 @@ """ @file @brief API to move files using FTP - -.. versionadded:: 1.3 """ import sys import ftplib diff --git a/src/pyquickhelper/filehelper/visual_sync.py b/src/pyquickhelper/filehelper/visual_sync.py index 7602cbaa5..e0794f990 100644 --- a/src/pyquickhelper/filehelper/visual_sync.py +++ b/src/pyquickhelper/filehelper/visual_sync.py @@ -188,9 +188,7 @@ def create_visual_diff_through_html(string1, string2, notebook=False, context_si import webbrowser webbrowser.open("page.html") - .. versionchanged:: 1.1 - Parameter *notebook*, *context_size*, *inline_view* were added. - The function now uses @see fn read_content_ufs to retrieve the content. + The function uses @see fn read_content_ufs to retrieve the content. """ string1 = read_content_ufs(string1) string2 = read_content_ufs(string2) @@ -288,10 +286,7 @@ def create_visual_diff_through_html_files(file1, object if *notebook* is True An example of the results is shown in blog post :ref:`b-diffview`. - - .. versionchanged:: 1.1 - Parameter *notebook*, *context_size*, *inline_view* were added. - The function now uses @see fn read_content_ufs to retrieve the content. + The function now uses @see fn read_content_ufs to retrieve the content. """ diff = create_visual_diff_through_html(file1, file2, notebook=notebook, context_size=context_size, inline_view=inline_view) diff --git a/src/pyquickhelper/helpgen/_my_doxypy.py b/src/pyquickhelper/helpgen/_my_doxypy.py index 707664e18..14f14b6b2 100644 --- a/src/pyquickhelper/helpgen/_my_doxypy.py +++ b/src/pyquickhelper/helpgen/_my_doxypy.py @@ -23,8 +23,6 @@ def is_file_string(s): @param s string @return boolean - - .. versionadded:: 1.3 """ if len(s) >= 3000: return False diff --git a/src/pyquickhelper/helpgen/conf_path_tools.py b/src/pyquickhelper/helpgen/conf_path_tools.py index 2529912a3..b2952a676 100644 --- a/src/pyquickhelper/helpgen/conf_path_tools.py +++ b/src/pyquickhelper/helpgen/conf_path_tools.py @@ -34,9 +34,6 @@ def find_graphviz_dot(exc=True): :param exc: raise exception of be silent :return: path to dot :raises FileNotFoundError: if graphviz not found - - .. versionchanged:: 1.4 - Add parameter *exc* """ if sys.platform.startswith("win"): version = range(34, 45) @@ -73,9 +70,6 @@ def find_latex_path(exc=True): :param exc: raises an exception or be silent :return: something like ``C:\\Program Files\\MiKTeX 2.9\\miktex\\bin\\x64`` :raises FileNotFoundError: if latex not found - - .. versionchanged:: 1.4 - Add parameter *exc* """ if sys.platform.startswith("win"): latex = latex0 = r"C:\Program Files\MiKTeX 2.9\miktex\bin\x64" @@ -100,9 +94,6 @@ def find_pandoc_path(exc=True): Returns an empty string on :epkg:`linux`. @return path to :epkg:`pandoc` - - .. versionchanged:: 1.4 - Add parameter *exc* """ if sys.platform.startswith("win"): path = os.environ["USERPROFILE"] diff --git a/src/pyquickhelper/helpgen/default_conf.py b/src/pyquickhelper/helpgen/default_conf.py index 97c4a6097..3eb859572 100644 --- a/src/pyquickhelper/helpgen/default_conf.py +++ b/src/pyquickhelper/helpgen/default_conf.py @@ -105,14 +105,6 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, if hasattr(sys, ) and sys.: import module # -- HELP END EXCLUDE -- - - .. versionchanged:: 1.4 - Add parameters *extlinks*, *github_user*, *github_repo*, - *title*. Add extension - `extlinks `_. - - .. versionchanged:: 1.5 - Parameter *nblayout* was added. """ # sphinx_gallery only supports matplotlib.use('agg') # and it must be done first. @@ -384,8 +376,11 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, # epkg_role epkg_dictionary = { '7z': "http://www.7-zip.org/", + 'ASCII': "https://en.wikipedia.org/wiki/ASCII", 'Anaconda': 'http://continuum.io/downloads', 'appveyor': 'https://www.appveyor.com/', + 'bokeh': 'https://bokeh.pydata.org/en/latest/', + 'builderapi': 'http://www.sphinx-doc.org/en/stable/extdev/builderapi.html', 'bz2': 'https://en.wikipedia.org/wiki/Bzip2', 'cairosvg': 'https://github.com/Kozea/CairoSVG', 'class Sphinx': 'https://github.com/sphinx-doc/sphinx/blob/master/sphinx/application.py#L107', @@ -399,8 +394,10 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'Cython': 'http://cython.org/', 'datetime': 'https://docs.python.org/3/library/datetime.html#datetime-objects', 'docx': 'https://en.wikipedia.org/wiki/Office_Open_XML', + 'doxygen': 'http://www.doxygen.org/', 'django': 'https://www.djangoproject.com/', 'docutils': 'http://docutils.sourceforge.net/', + 'FTP': 'https://en.wikipedia.org/wiki/File_Transfer_Protocol', 'getsitepackages': 'https://docs.python.org/3/library/site.html#site.getsitepackages', 'GIT': 'http://git-scm.com/', 'git': 'http://git-scm.com/', @@ -413,22 +410,31 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'HTML': 'https://en.wikipedia.org/wiki/HTML', 'Inkscape': 'https://inkscape.org/', 'InkScape': 'https://inkscape.org/', + 'IPython': 'https://en.wikipedia.org/wiki/IPython', 'Java': 'http://www.java.com/fr/download/', + 'javascript': 'https://en.wikipedia.org/wiki/JavaScript', 'Jenkins': 'https://jenkins-ci.org/', 'jinja2': 'http://jinja.pocoo.org/docs/', 'js2py': 'https://github.com/PiotrDabkowski/Js2Py', + 'JSON': 'https://en.wikipedia.org/wiki/JSON', 'Jupyter': 'http://jupyter.org/', 'jupyter': 'http://jupyter.org/', + 'JupyterLab': 'https://jupyterlab.readthedocs.io/en/stable/', + 'Jupyter Lab': 'https://jupyterlab.readthedocs.io/en/stable/', 'latex': 'https://en.wikipedia.org/wiki/LaTeX', 'LaTeX': 'https://en.wikipedia.org/wiki/LaTeX', 'Linux': 'https://en.wikipedia.org/wiki/Linux', + 'linux': 'https://en.wikipedia.org/wiki/Linux', 'mako': 'http://www.makotemplates.org/', "matplotlib": "https://matplotlib.org/index.html", 'Markdown': 'https://en.wikipedia.org/wiki/Markdown', + 'markdown': 'https://en.wikipedia.org/wiki/Markdown', 'MD': 'https://en.wikipedia.org/wiki/Markdown', 'md': 'https://en.wikipedia.org/wiki/Markdown', 'mistune': 'https://pypi.org/project/mistune', 'MiKTeX': 'http://miktex.org/', + 'Miktex': 'http://miktex.org/', + 'miktex': 'http://miktex.org/', 'MinGW': 'http://www.mingw.org/', 'nbconvert': 'http://nbconvert.readthedocs.io/en/latest/', 'nbpresent': 'https://github.com/Anaconda-Platform/nbpresent', @@ -443,6 +449,7 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'pandoc': 'http://johnmacfarlane.net/pandoc/', 'Pandoc': 'http://johnmacfarlane.net/pandoc/', 'pdf': 'https://en.wikipedia.org/wiki/Portable_Document_Format', + 'pep8': 'https://www.python.org/dev/peps/pep-0008/', 'PEP8': 'https://www.python.org/dev/peps/pep-0008/', "PEP8 codes": 'http://pep8.readthedocs.io/en/latest/intro.html#error-codes', 'Pillow': 'http://pillow.readthedocs.io/', @@ -451,9 +458,12 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'PNG': 'https://fr.wikipedia.org/wiki/Portable_Network_Graphics', 'pycodestyle': 'http://pycodestyle.readthedocs.io/', 'pycrypto': 'https://pypi.org/project/pycrypto', + 'pycryptodome': 'https://pypi.org/project/pycryptodome/', + 'pycryptodomex': 'https://pypi.org/project/pycryptodomex/', 'pygments': 'http://pygments.org/', 'pylzma': 'https://pypi.org/project/pylzma', 'pylint': 'https://www.pylint.org/', + 'pylint error codes': 'http://pylint-messages.wikidot.com/all-codes', 'pypi': 'https://pypi.org/project/', 'PyPI': 'https://pypi.org/project/', 'python': 'http://www.python.org/', @@ -464,16 +474,22 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'rst': 'https://en.wikipedia.org/wiki/ReStructuredText', 'RST': 'https://en.wikipedia.org/wiki/ReStructuredText', 'scikit-learn': 'http://scikit-learn.org/', + 'SciTe': 'https://www.scintilla.org/SciTE.html', 'sklearn': ('http://scikit-learn.org/stable/', ('http://scikit-learn.org/stable/modules/generated/{0}.html', 1), ('http://scikit-learn.org/stable/modules/generated/{0}.{1}.html', 2)), 'scipy': 'https://www.scipy.org/', 'sphinx': 'http://www.sphinx-doc.org/en/stable/', 'Sphinx': 'http://www.sphinx-doc.org/en/stable/', + 'sphinx.ext.autodoc': 'http://www.sphinx-doc.org/en/stable/ext/autodoc.html#module-sphinx.ext.autodoc', + 'sphinx-gallery': 'https://sphinx-gallery.readthedocs.io/en/latest/', + 'Sphinx application': 'http://www.sphinx-doc.org/en/stable/_modules/sphinx/application.html', 'svg': 'https://fr.wikipedia.org/wiki/Scalable_Vector_Graphics', 'SVG': 'https://fr.wikipedia.org/wiki/Scalable_Vector_Graphics', 'SVN': 'https://subversion.apache.org/', + 'svn': 'https://subversion.apache.org/', 'tar.gz': 'https://en.wikipedia.org/wiki/Tar_(computing)', + 'toctree': 'http://www.sphinx-doc.org/en/stable/markup/toctree.html', 'travis': 'https://travis-ci.org/', 'TexnicCenter': 'http://www.texniccenter.org/', 'tinycss2': 'http://pythonhosted.org/tinycss2/', @@ -483,10 +499,14 @@ def set_sphinx_variables(fileconf, module_name, author, year, theme, theme_path, 'Visual Studio Community Edition': 'https://www.visualstudio.com/', 'Visual Studio Community Edition 2015': 'https://imagine.microsoft.com/en-us/Catalog/Product/101', 'Windows': 'https://en.wikipedia.org/wiki/Microsoft_Windows', + 'yaml': 'https://en.wikipedia.org/wiki/YAML', + 'YAML': 'https://en.wikipedia.org/wiki/YAML', + 'yml': 'https://en.wikipedia.org/wiki/YAML', 'zip': 'https://en.wikipedia.org/wiki/Zip_(file_format)', '*py': ('https://docs.python.org/3/', ('https://docs.python.org/3/library/{0}.html', 1), - ('https://docs.python.org/3/library/{0}.html#{0}.{1}', 2)), + ('https://docs.python.org/3/library/{0}.html#{0}.{1}', 2), + ('https://docs.python.org/3/library/{0}.html#{0}.{1}.{2}', 3)), '*pyf': (('https://docs.python.org/3/library/functions.html#{0}', 1),), # Custom. 'jyquickhelper': 'http://www.xavierdupre.fr/app/jyquickhelper/helpsphinx/index.html', @@ -894,8 +914,6 @@ def get_default_stylesheet(): Returns the style of additional style sheets @return list of files - - .. versionadded:: 1.5 """ rel = "_static/" + style_figure_notebook[0] # rel2 = "_static/gallery.css" # This should not be needed for sphinx-gallery. @@ -908,7 +926,5 @@ def get_default_javascript(): Returns the style of additional style sheets @return list of files - - .. versionadded:: 1.5 """ return ["_static/require.js"] diff --git a/src/pyquickhelper/helpgen/helpgen_exceptions.py b/src/pyquickhelper/helpgen/helpgen_exceptions.py index fe5c560e1..7bc487434 100644 --- a/src/pyquickhelper/helpgen/helpgen_exceptions.py +++ b/src/pyquickhelper/helpgen/helpgen_exceptions.py @@ -28,10 +28,8 @@ def __init__(self, message, file=None): class ImportErrorHelpGen(ImportError): """ - a custom exception to detect a specific location when - *ImportError* happens in the process - - .. versionadded:: 1.0 + A custom exception to detect a specific location when + *ImportError* happens in the process. """ pass @@ -39,9 +37,7 @@ class ImportErrorHelpGen(ImportError): class HelpGenConvertError(Exception): """ - exception raised when a conversion failed - - .. versionadded:: 1.2 + Exception raised when a conversion failed. """ pass @@ -49,8 +45,6 @@ class HelpGenConvertError(Exception): class NotebookConvertError(Exception): """ - exception raised when a conversion failed - - .. versionadded:: 1.3 + Exception raised when a conversion failed. """ pass diff --git a/src/pyquickhelper/helpgen/pandoc_helper.py b/src/pyquickhelper/helpgen/pandoc_helper.py index 2d0b5bce2..382f4b832 100644 --- a/src/pyquickhelper/helpgen/pandoc_helper.py +++ b/src/pyquickhelper/helpgen/pandoc_helper.py @@ -1,8 +1,6 @@ """ @file @brief Helpers to call pandoc and convert documents - -.. versionadded:: 1.5 """ import os import sys @@ -21,8 +19,6 @@ def call_pandoc(params, fLOG=noLOG): @param params parameters @param fLOG logging function @return out, err - - .. versionadded:: 1.5 """ pandoc = os.path.join(find_pandoc_path(), "pandoc") cmd = '"{0}" {1}'.format(pandoc, params) diff --git a/src/pyquickhelper/helpgen/post_process.py b/src/pyquickhelper/helpgen/post_process.py index 09b30f952..18b0381f4 100644 --- a/src/pyquickhelper/helpgen/post_process.py +++ b/src/pyquickhelper/helpgen/post_process.py @@ -43,8 +43,6 @@ def update_notebook_link(text, format, nblinks, fLOG): @param nblinks list of mappings *(reference: url)* @param fLOG logging function @return modified text - - .. versionadded:: 1.5 """ def get_url_from_nblinks(nblinks, url, format): if isinstance(nblinks, dict): @@ -142,8 +140,6 @@ def _notebook_replacements(nbtext, notebook_replacements, fLOG=None): @param notebook_replacements dictionary of replacements @param fLOG logging function @return text - - .. versionadded:: 1.6 """ if notebook_replacements is None: return nbtext @@ -170,13 +166,6 @@ def post_process_latex_output(root, doall, latex_book=False, exc=True, @param remove_unicode remove unicode characters (fails with latex) @param notebook_replacements string replacement in notebooks @param fLOG logging function - - .. versionchanged:: 1.5 - Parameters *exc*, *custom_latex_processing*, - *fLOG*, *remove_unicode* were added. - - .. versionchanged:: 1.6 - Parameter *notebook_replacements* was added. """ if os.path.isfile(root): file = root @@ -222,14 +211,6 @@ def post_process_python_output(root, doall, exc=True, nblinks=None, fLOG=None, n @param nblinks dictionary ``{ref: url}`` @param notebook_replacements string replacement in notebooks @param fLOG logging function - - .. versionadded:: 1.3 - - .. versionchanged:: 1.5 - Add parameter *exc*, *nblinks*. - - .. versionchanged:: 1.6 - Parameter *notebook_replacements* was added. """ if os.path.isfile(root): file = root @@ -267,13 +248,6 @@ def post_process_latex_output_any(file, custom_latex_processing, nblinks=None, @param remove_unicode remove unicode characters @param notebook_replacements string replacement in notebooks @param fLOG logging function - - .. versionchanged:: 1.5 - Parameters *custom_latex_processing*, *nblinks*, - *remove_unicode*, *fLOG* were added. - - .. versionchanged:: 1.6 - Parameter *notebook_replacements* was added. """ if fLOG: fLOG("[post_process_latex_output_any] ** post_process_latex_output_any ", file) diff --git a/src/pyquickhelper/helpgen/process_notebook_api.py b/src/pyquickhelper/helpgen/process_notebook_api.py index f9633bf3e..36f416358 100644 --- a/src/pyquickhelper/helpgen/process_notebook_api.py +++ b/src/pyquickhelper/helpgen/process_notebook_api.py @@ -2,8 +2,6 @@ """ @file @brief Direct calls to IPython API without running a command line - -.. versionadded:: 1.1 """ import os import sys @@ -158,8 +156,6 @@ def nb2present(nb_file, outfile, add_tag=True): @param outfile output file (a string) @param add_tag call @see me add_tag_slide @return impacted files - - .. versionadded:: 1.4 """ from ..ipythonhelper import NotebookRunner, read_nb @@ -194,9 +190,6 @@ def nb2html(nb_file, outfile, exc=True): @param outfile output file (a string) @param exc raises an exception (True) or a warning (False) @return impacted files - - .. versionchanged:: 1.5 - Parameter *exc* was added. """ from ..ipythonhelper import NotebookRunner, read_nb @@ -227,9 +220,6 @@ def nb2rst(nb_file, outfile, exc=True, post_process=True): @param exc raises an exception (True) or a warning (False) @param post_process calls @see fn post_process_rst_output @return impacted files - - .. versionadded:: 1.5 - Parameter *exc* was added. """ from ..ipythonhelper import NotebookRunner, read_nb diff --git a/src/pyquickhelper/helpgen/process_notebooks.py b/src/pyquickhelper/helpgen/process_notebooks.py index 8124e1e69..23dce66f0 100644 --- a/src/pyquickhelper/helpgen/process_notebooks.py +++ b/src/pyquickhelper/helpgen/process_notebooks.py @@ -135,18 +135,9 @@ def process_notebooks(notebooks, outfold, build, latex_path=None, pandoc_path=No formats=("ipynb", "html", "python", "rst", "slides", "pdf", "docx", "present", "github")]) - .. versionchanged:: 1.5 - For latex and pdf, a custom processor was added to handle raw data - and add ``\\begin{verbatim}`` and ``\\end{verbatim}``. - Parameter *exc*, *nblinks* were added. - Format *github*, *remove_unicode_latex* was added, - it adds a link to file on :epkg:`github`. - - .. versionchanged:: 1.6 - Parameter *notebook_replacements* was added. - - .. versionchanged:: 1.7 - Change default value for *remove_unicode_latex* to False. + For latex and pdf, a custom processor was added to handle raw data + and add ``\\begin{verbatim}`` and ``\\end{verbatim}``. + Format *github* adds a link to file on :epkg:`github`. .. todoext:: :title: check differences between _process_notebooks_in_private and _process_notebooks_in_private_cmd @@ -805,9 +796,6 @@ def build_thumbail_in_gallery(nbfile, folder_snippet, relative, rst_link, layout itself, snippet must have extension ``.png`` @return RST - .. versionadded:: 1.5 - Parameter *layout* was added. - .. versionchanged:: 1.7 Modifies the function to bypass the generation of a snippet if a custom one was found. Parameter *snippet_folder* was added. @@ -1168,8 +1156,6 @@ def build_all_notebooks_coverage(nbs, fileout, module_name, dump=None, badge=Tru @param too_old drop executions older than *too_old* days from now @param fLOG logging function @return dataframe which contains the data - - .. versionadded:: 1.5 """ if dump is None: dump = os.path.normpath(os.path.join(os.path.dirname(fileout), "..", "..", "..", "..", diff --git a/src/pyquickhelper/helpgen/rst_converters.py b/src/pyquickhelper/helpgen/rst_converters.py index c7db7eadd..4cca5ec21 100644 --- a/src/pyquickhelper/helpgen/rst_converters.py +++ b/src/pyquickhelper/helpgen/rst_converters.py @@ -1,8 +1,6 @@ """ @file -@brief Helpers to convert docstring to various format - -.. versionadded:: 1.0 +@brief Helpers to convert docstring to various format. """ import sys import re @@ -404,7 +402,7 @@ def depart_node(self, node): def correct_indentation(text): """ - Tries to improve the indentation before running :epkg:`docutil`. + Tries to improve the indentation before running :epkg:`docutils`. @param text text to correct @return corrected text diff --git a/src/pyquickhelper/helpgen/sphinx_main.py b/src/pyquickhelper/helpgen/sphinx_main.py index b597d4a5e..a3be10e53 100644 --- a/src/pyquickhelper/helpgen/sphinx_main.py +++ b/src/pyquickhelper/helpgen/sphinx_main.py @@ -1111,8 +1111,6 @@ def _check_sphinx_configuration(conf, fLOG): @param conf :epkg:`sphinx` configuration @param fLOG logging function - - .. versionadded:: 1.5 """ clean_folders = [] if hasattr(conf, "sphinx_gallery_conf"): diff --git a/src/pyquickhelper/helpgen/sphinx_main_helper.py b/src/pyquickhelper/helpgen/sphinx_main_helper.py index 35848860d..f7b484d96 100644 --- a/src/pyquickhelper/helpgen/sphinx_main_helper.py +++ b/src/pyquickhelper/helpgen/sphinx_main_helper.py @@ -79,9 +79,6 @@ def my_date_conversion(sdate): @param sdate string @return date - - .. versionadded:: 1.0 - """ first = sdate.split(" ")[0] trois = first.replace(".", "-").replace("/", "-").split("-") @@ -96,18 +93,17 @@ def produce_code_graph_changes(df): @param df dataframe (has a column date with format ``YYYY-MM-DD``) @return graph - .. versionchanged:: 1.0 - The call to :epkg:`datetime.datetime.strptime` - introduced exceptions:: + The call to :epkg:`datetime.datetime.strptime` + introduced exceptions:: - File "", line 2212, in _find_and_load_unlocked - File "", line 321, in _call_with_frames_removed - File "", line 2254, in _gcd_import - File "", line 2237, in _find_and_load - File "", line 2224, in _find_and_load_unlocked + File "", line 2212, in _find_and_load_unlocked + File "", line 321, in _call_with_frames_removed + File "", line 2254, in _gcd_import + File "", line 2237, in _find_and_load + File "", line 2224, in _find_and_load_unlocked - when generating the documentation for another project. The reason - is still unclear. It was replaced by a custom function. + when generating the documentation for another project. The reason + is still unclear. It was replaced by a custom function. """ def year_week(x): dt = datetime.datetime(x.year, x.month, x.day) @@ -186,19 +182,16 @@ def generate_changes_repo(chan, source, exception_if_empty=True, @param modify_commit function which rewrite the commit text (see below) @return string (rst tables with the changes) - .. versionchanged:: 1.0 - - pandas is not imported in the function itself but at the beginning of the module. It - seemed to cause soe weird exceptions when generating the documentation for another module:: + :epkg:`pandas` is not imported in the function itself but at the beginning of the module. It + seemed to cause soe weird exceptions when generating the documentation for another module:: - File "", line 2212, in _find_and_load_unlocked - File "", line 321, in _call_with_frames_removed - File "", line 2254, in _gcd_import - File "", line 2237, in _find_and_load - File "", line 2224, in _find_and_load_unlocked - - Doing that helps. The cause still remains obscure. + File "", line 2212, in _find_and_load_unlocked + File "", line 321, in _call_with_frames_removed + File "", line 2254, in _gcd_import + File "", line 2237, in _find_and_load + File "", line 2224, in _find_and_load_unlocked + Doing that helps. The cause still remains obscure. If not None, function *modify_commit* is called the following way (see below). *nbch* is the commit number. *date* can be returned as a datetime or a string. @@ -444,8 +437,6 @@ def format_history(src, dest, format="basic"): @param src source history (file) @param dest destination (file) - .. versionadded:: 1.5 - .. versionchanged:: 1.7 Parameter *format* was added. :epkg:`Sphinx` extension *release* is no longer used but the formatting is still available. diff --git a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py index 0979a3d0b..79a57732e 100644 --- a/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py +++ b/src/pyquickhelper/helpgen/sphinxm_convert_doc_sphinx_helper.py @@ -1,8 +1,6 @@ """ @file @brief Helpers to convert docstring to various format. - -.. versionadded:: 1.3 """ import os import sys @@ -497,7 +495,7 @@ class _MemoryBuilder: """ Builds :epkg:`HTML` output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. """ def _init(self, base_class, app): @@ -507,7 +505,7 @@ def _init(self, base_class, app): be overwritten (yet). :param base_class: base builder class - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ if "IMPOSSIBLE:TOFIND" in app.srcdir: sphinx.util.osutil.ensuredir = custom_ensuredir @@ -691,7 +689,7 @@ class MemoryHTMLBuilder(_MemoryBuilder, SingleFileHTMLBuilder): """ Builds :epkg:`HTML` output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. """ name = 'memoryhtml' format = 'html' @@ -710,7 +708,7 @@ def __init__(self, app): # pylint: disable=W0231 Most of the parameter are static members of the class and cannot be overwritten (yet). - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ _MemoryBuilder._init(self, SingleFileHTMLBuilder, app) @@ -720,7 +718,7 @@ class MemoryRSTBuilder(_MemoryBuilder, RstBuilder): """ Builds :epkg:`RST` output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. The writer simplifies the :epkg:`RST` syntax by replacing custom roles into true :epkg:`RST` syntax. """ @@ -742,7 +740,7 @@ def __init__(self, app): # pylint: disable=W0231 Most of the parameter are static members of the class and cannot be overwritten (yet). - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ _MemoryBuilder._init(self, RstBuilder, app) @@ -764,7 +762,7 @@ class MemoryMDBuilder(_MemoryBuilder, MdBuilder): """ Builds :epkg:`MD` output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. """ name = 'memorymd' format = 'md' @@ -783,7 +781,7 @@ def __init__(self, app): # pylint: disable=W0231 Most of the parameter are static members of the class and cannot be overwritten (yet). - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ _MemoryBuilder._init(self, MdBuilder, app) @@ -805,7 +803,7 @@ class MemoryDocTreeBuilder(_MemoryBuilder, DocTreeBuilder): """ Builds doctree output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. """ name = 'memorydoctree' format = 'doctree' @@ -823,7 +821,7 @@ def __init__(self, app): # pylint: disable=W0231 Most of the parameter are static members of the class and cannot be overwritten (yet). - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ _MemoryBuilder._init(self, DocTreeBuilder, app) @@ -845,7 +843,7 @@ class MemoryLatexBuilder(_MemoryBuilder, EnhancedLaTeXBuilder): """ Builds :epkg:`Latex` output in memory. The API is defined by the page - `builderapi `_. + :epkg:`builderapi`. """ name = 'memorylatex' format = 'tex' @@ -864,7 +862,7 @@ def __init__(self, app): # pylint: disable=W0231 Most of the parameter are static members of the class and cannot be overwritten (yet). - :param app: `Sphinx application `_ + :param app: :epkg:`Sphinx application` """ _MemoryBuilder._init(self, EnhancedLaTeXBuilder, app) @@ -953,8 +951,7 @@ def __init__(self, srcdir, confdir, outdir, doctreedir, buildername="memoryhtml" confoverrides=None, status=None, freshenv=False, warningiserror=False, tags=None, verbosity=0, parallel=0, new_extensions=None): ''' - Same constructor as - `sphinx application `_, + Same constructor as :epkg:`Sphinx application`. Additional parameters: @param new_extensions extensions to add to the application diff --git a/src/pyquickhelper/helpgen/sphinxm_custom_app.py b/src/pyquickhelper/helpgen/sphinxm_custom_app.py index 57c8c5f85..283a77c04 100644 --- a/src/pyquickhelper/helpgen/sphinxm_custom_app.py +++ b/src/pyquickhelper/helpgen/sphinxm_custom_app.py @@ -3,8 +3,6 @@ @file @brief Inspired from module `sphinx-testing `_ - -.. versionadded:: 1.3 """ import shutil @@ -58,9 +56,6 @@ def __init__(self, srcdir, outdir, confdir=None, doctreedir=None, @param extensions if ``'all'``, add extensions implemented by this module, use ``None`` for an empty list, 'extensions' must not be in *confoverrides* - - .. versionchanged:: 1.6 - Parameter *extensions* was added. """ self.cleanup_trees = [] self.cleanup_on_errors = cleanup_on_errors diff --git a/src/pyquickhelper/helpgen/sphinxm_mock_app.py b/src/pyquickhelper/helpgen/sphinxm_mock_app.py index 31434e1b0..5af16751f 100644 --- a/src/pyquickhelper/helpgen/sphinxm_mock_app.py +++ b/src/pyquickhelper/helpgen/sphinxm_mock_app.py @@ -1,8 +1,6 @@ """ @file -@brief Helpers to convert docstring to various format - -.. versionadded:: 1.0 +@brief Helpers to convert docstring to various format. """ import logging import warnings @@ -35,9 +33,6 @@ def __init__(self, writer, app, confoverrides, new_extensions=None): @param app see static method create @param confoverrides default options @param new_extensions additional extensions - - .. versionchanged:: 1.5 - Parameters *confoverrides*, *new_extensions* were added. """ if confoverrides is None: confoverrides = {} @@ -270,13 +265,6 @@ def create(writer="html", directives=None, confoverrides=None, new_extensions=No * a docutils node: see @see cl runpython_node as an example * two functions: see @see fn visit_runpython_node, @see fn depart_runpython_node as an example - - .. versionchanged:: 1.5 - Parameters *fLOG*, *confoverrides*, *new_extensions* were added. - The class supports more extensions. - - .. versionchanged:: 1.8 - New nodes are now optional in *directives*. """ if confoverrides is None: confoverrides = {} diff --git a/src/pyquickhelper/helpgen/style_css_template.py b/src/pyquickhelper/helpgen/style_css_template.py index bd6473396..e91c8c69d 100644 --- a/src/pyquickhelper/helpgen/style_css_template.py +++ b/src/pyquickhelper/helpgen/style_css_template.py @@ -1,8 +1,6 @@ """ @file @brief Custom style for the documentation. - -.. versionadded:: 1.5 """ #: style for thumbnails diff --git a/src/pyquickhelper/helpgen/utils_sphinx_doc.py b/src/pyquickhelper/helpgen/utils_sphinx_doc.py index e648ecd09..668c36fd3 100644 --- a/src/pyquickhelper/helpgen/utils_sphinx_doc.py +++ b/src/pyquickhelper/helpgen/utils_sphinx_doc.py @@ -136,12 +136,6 @@ def _private_process_one_file( @param replace_relative_import replace relative import @param use_sys @see fn remove_undesired_part_for_documentation @return extension, number of lines, number of lines in documentation - - .. versionchanged:: 0.9 - return extension, number of lines - - .. versionchanged:: 1.3 - Parameter *use_sys* was added. """ ext = os.path.splitext(fullname)[-1] @@ -220,11 +214,8 @@ def remove_undesired_part_for_documentation(content, filename, use_sys): # section to enable or disables - The string ```` will be replaced by the value of - parameter *use_sys*. - - .. versionchanged:: 1.3 - Parameter *use_sys* was added. + The string ```` will be replaced by the value of + parameter *use_sys*. """ marker_in = "# -- HELP BEGIN EXCLUDE --" marker_out = "# -- HELP END EXCLUDE --" @@ -1378,9 +1369,6 @@ def migrating_doxygen_doc(content, filename, silent=False, log=False, debug=Fals Function ``private_migrating_doxygen_doc`` enumerates the list of conversion which will be done. - - .. versionchanged:: 1.0 - Returns basic statistics on each files. """ if log: fLOG("migrating_doxygen_doc: ", filename) diff --git a/src/pyquickhelper/helpgen/utils_sphinx_doc_helpers.py b/src/pyquickhelper/helpgen/utils_sphinx_doc_helpers.py index ee38c1331..71b8ba74b 100644 --- a/src/pyquickhelper/helpgen/utils_sphinx_doc_helpers.py +++ b/src/pyquickhelper/helpgen/utils_sphinx_doc_helpers.py @@ -949,9 +949,9 @@ def process_look_for_tag(tag, title, files): The function parses the files instead of loading the files as a module. The function needs to replace ``\\\\`` by ``\\``, it does not takes into acount doc string starting with ``r'''``. - - .. versionchanged:: 0.9 - Calls function @see fn remove_some_indent with ``backslash=True`` to replace double backslash by simple backslash. + The function calls @see fn remove_some_indent + with ``backslash=True`` to replace double backslashes + by simple backslashes. """ def noneempty(a): if "___" in a: @@ -1078,9 +1078,6 @@ def remove_some_indent(s, backslash=False): @param s text @param backslash if True, replace double backslash by simple backslash @return text - - .. versionchanged:: 0.9 - Add parameter *backslash* to remove replace double backslash by simple backslah. """ rows = s.split("\n") mi = len(s) @@ -1116,6 +1113,6 @@ def example_function_latex(): :math:`\\left \\{ \\begin{array}{l} \\min_{x,y} \\left \\{ x^2 + y^2 - xy + y \\right \\} \\\\ \\text{sous contrainte} \\; x + 2y = 1 \\end{array}\\right .` - Brackets and baskslash might be an issue. + Brackets and backslashes might be an issue. """ pass diff --git a/src/pyquickhelper/ipythonhelper/html_forms.py b/src/pyquickhelper/ipythonhelper/html_forms.py index d00d7c9b3..9570a34a1 100644 --- a/src/pyquickhelper/ipythonhelper/html_forms.py +++ b/src/pyquickhelper/ipythonhelper/html_forms.py @@ -63,8 +63,6 @@ def custom_action(x): The function generates javascript based on the keys the dictionary ``params`` contains. The keys must follows the same as a javascript identifier (no space). - - .. versionadded:: 0.9 """ global _reg_var for k in params: diff --git a/src/pyquickhelper/ipythonhelper/interact.py b/src/pyquickhelper/ipythonhelper/interact.py index 19e05f510..ffc23d690 100644 --- a/src/pyquickhelper/ipythonhelper/interact.py +++ b/src/pyquickhelper/ipythonhelper/interact.py @@ -31,8 +31,6 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -.. versionadded:: 1.1 """ from collections import OrderedDict import itertools diff --git a/src/pyquickhelper/ipythonhelper/magic_class.py b/src/pyquickhelper/ipythonhelper/magic_class.py index d5004cbff..835f6fde2 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class.py +++ b/src/pyquickhelper/ipythonhelper/magic_class.py @@ -2,9 +2,6 @@ """ @file @brief Magic command to handle files - -.. versionadded:: 0.9 - """ from __future__ import print_function import warnings @@ -26,9 +23,6 @@ def register_file_magics(): from IPython import get_ipython ip = get_ipython() ip.register_magics(MagicFile) - - .. versionadded:: 0.9 - """ _parser_store = {} diff --git a/src/pyquickhelper/ipythonhelper/magic_class_compress.py b/src/pyquickhelper/ipythonhelper/magic_class_compress.py index 8043d889f..c998447f8 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_compress.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_compress.py @@ -2,9 +2,6 @@ """ @file @brief Magic command to handle files - -.. versionadded:: 1.3 - Magic commands coming from pyensae """ import os from IPython.core.magic import magics_class, line_magic @@ -19,9 +16,6 @@ class MagicCompress(MagicClassWithHelpers): """ Defines magic commands to compress files. - - .. versionadded:: 1.3 - Magic commands coming from pyensae """ @staticmethod diff --git a/src/pyquickhelper/ipythonhelper/magic_class_crypt.py b/src/pyquickhelper/ipythonhelper/magic_class_crypt.py index 072836403..89bc08444 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_crypt.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_crypt.py @@ -2,9 +2,6 @@ """ @file @brief Magic command to handle files - -.. versionadded:: 1.3 - Magic commands coming from pyensae """ import os import sys @@ -20,9 +17,6 @@ class MagicCrypt(MagicClassWithHelpers): """ Defines magic commands to encrypt and decrypt file. - - .. versionadded:: 1.3 - Magic commands coming from pyensae """ @staticmethod diff --git a/src/pyquickhelper/ipythonhelper/magic_class_diff.py b/src/pyquickhelper/ipythonhelper/magic_class_diff.py index f71d9eca3..f7aec1c8b 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_diff.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_diff.py @@ -2,9 +2,6 @@ """ @file @brief Magic command to handle files - -.. versionadded:: 1.3 - Magic commands coming from pyensae """ from IPython.core.magic import magics_class, line_magic from IPython.core.display import display_html @@ -19,9 +16,6 @@ class MagicDiff(MagicClassWithHelpers): """ Defines magic commands to visualize differences between files. - - .. versionadded:: 1.3 - Magic commands coming from pyensae """ @staticmethod diff --git a/src/pyquickhelper/ipythonhelper/magic_class_example.py b/src/pyquickhelper/ipythonhelper/magic_class_example.py index b4a6bb03f..338a3039c 100644 --- a/src/pyquickhelper/ipythonhelper/magic_class_example.py +++ b/src/pyquickhelper/ipythonhelper/magic_class_example.py @@ -2,9 +2,6 @@ """ @file @brief Example of a class which defines magic commands. - -.. versionadded:: 1.3 - Magic commands coming from pyensae """ from __future__ import print_function from IPython.core.magic import magics_class, line_magic @@ -33,17 +30,12 @@ class MagicClassExample(MagicClassWithHelpers): cmd = "MagicClassExample -f text" res = mg.htmlhelp(cmd) assert "NB(example of a magic command)" - - .. versionadded:: 1.3 - Magic commands coming from pyensae """ @staticmethod def htmlhelp_parser(): """ Defines the way to parse the magic command ``%htmlhelp``. - - .. versionadded:: 1.3 """ parser = MagicCommandParser(prog="htmlhelp", description='display help for an object in HTML format') diff --git a/src/pyquickhelper/ipythonhelper/magic_parser.py b/src/pyquickhelper/ipythonhelper/magic_parser.py index ebec67727..f4a3d0fb2 100644 --- a/src/pyquickhelper/ipythonhelper/magic_parser.py +++ b/src/pyquickhelper/ipythonhelper/magic_parser.py @@ -12,9 +12,7 @@ class MagicCommandParser(argparse.ArgumentParser): """ - Add method ``parse_cmd`` to :epkg:`*py:argparse:ArgumentParser`. - - .. versionadded:: 0.9 + Adds method ``parse_cmd`` to :epkg:`*py:argparse:ArgumentParser`. """ def __init__(self, prog, *l, **p): @@ -24,9 +22,6 @@ def __init__(self, prog, *l, **p): @param prog command name @param l positional arguments @param p named arguments - - .. versionchanged:: 1.2 - Parameter *prog* was made explicit in to force having a proper message for *usage()* """ argparse.ArgumentParser.__init__(self, prog=prog, *l, **p) self._keep_args = {} @@ -59,9 +54,8 @@ def add_argument(self, *args, **kwargs): * *eval_type*: *type* can be used for parsing and *eval_type* is the expected return type. - .. versionchanged:: 1.3 - The method adds parameter *no_eval* to avoid considering the parameter - value as a potential variable stored in the notebook workspace. + The method adds parameter *no_eval* to avoid considering the parameter + value as a potential variable stored in the notebook workspace. """ name = MagicCommandParser._private_get_name(*args) if name in ["help", "-h", "--h"]: @@ -95,13 +89,11 @@ def has_choices(self, name): def has_eval(self, name): """ - tells if a parameter value should be consider as a variable or some python code - to evaluate + Tells if a parameter value should be consider as a variable or some python code + to evaluate. @param name parameter name @return boolean - - .. versionadded:: 1.3 """ if name not in self._keep_args: raise KeyError("unable to find parameter name: {0} in {1}".format( @@ -110,12 +102,10 @@ def has_eval(self, name): def expected_type(self, name): """ - return the expected type for the parameter + Returns the expected type for the parameter. @param name parameter name @return type or None of unknown - - .. versionadded:: 1.3 """ if name in self._keep_args: return self._keep_args[name][1].get("type", None) @@ -129,8 +119,6 @@ def expected_eval_type(self, name): @param name parameter name @return type or None of unknown - - .. versionadded:: 1.3 """ if name in self._keep_args: return self._keep_args[name][1].get("eval_type", None) @@ -163,9 +151,9 @@ def parse_cmd(self, line, context=None, fLOG=noLOG): ev = self.eval(v, context=context, fLOG=fLOG) v_exp = self.expected_eval_type(k) if ev is not None and (v_exp is None or v_exp == type(ev)) and \ - (type(v) != type(ev) or v != ev): + (type(v) != type(ev) or v != ev): # pylint: disable=C0123 up[k] = ev - elif v_exp is not None and type(v) != v_exp: + elif v_exp is not None and type(v) != v_exp: # pylint: disable=C0123 up[k] = v_exp(v) if len(up) > 0: @@ -187,8 +175,7 @@ def eval(self, value, context, fLOG=noLOG): @param fLOG logging function @return *value* or its evaluation - .. versionchanged:: 1.3 - The method now interprets variable inside list, tuple or dictionaries (for *value*). + The method interprets variable inside list, tuple or dictionaries (for *value*). """ typstr = str # unicode# if isinstance(value, typstr): diff --git a/src/pyquickhelper/ipythonhelper/notebook_exception.py b/src/pyquickhelper/ipythonhelper/notebook_exception.py index c45cc2d74..00812b792 100644 --- a/src/pyquickhelper/ipythonhelper/notebook_exception.py +++ b/src/pyquickhelper/ipythonhelper/notebook_exception.py @@ -16,8 +16,6 @@ class InNotebookException(Exception): """ Exception raises when something wrong happened in a notebook. - - .. versionadded:: 1.3 """ pass @@ -25,8 +23,6 @@ class InNotebookException(Exception): class JupyterException(Exception): """ - Exception raises by Jupyter - - .. versionadded:: 1.3 + Exception raises by :epkg:`Jupyter`. """ pass diff --git a/src/pyquickhelper/ipythonhelper/notebook_helper.py b/src/pyquickhelper/ipythonhelper/notebook_helper.py index 3ecade6ef..d2dd26b6b 100644 --- a/src/pyquickhelper/ipythonhelper/notebook_helper.py +++ b/src/pyquickhelper/ipythonhelper/notebook_helper.py @@ -73,8 +73,6 @@ def upgrade_notebook(filename, encoding="utf-8"): @param filename filename @param encoding encoding @return modification? - - .. versionadded:: 1.0 """ with open(filename, "r", encoding=encoding) as payload: content = payload.read() @@ -132,12 +130,6 @@ def read_nb(filename, profile_dir=None, encoding="utf8", working_dir=None, @param replacements replacements to make in every cell before running it, dictionary ``{ string: string }`` @return @see cl NotebookRunner - - .. versionchanged:: 1.3 - Parameter *kernel* was added. - - .. versionchanged:: 1.5 - Parameters from NotebookRunner were added. """ if isinstance(filename, str # unicode# ): @@ -209,9 +201,7 @@ def find_notebook_kernel(kernel_spec_manager=None): The list of installed kernels is described at `Making kernel for Jupyter `_. - The function only works with Jupyter>=4.0. - - .. versionadded:: 1.3 + The function only works with *Jupyter>=4.0*. """ if kernel_spec_manager is None: from jupyter_client.kernelspec import KernelSpecManager @@ -230,9 +220,7 @@ def get_notebook_kernel(kernel_name, kernel_spec_manager=None): @param kernel_name kernel name @return KernelSpec - The function only works with Jupyter>=4.0. - - .. versionadded:: 1.3 + The function only works with *Jupyter>=4.0*. """ if kernel_spec_manager is None: from jupyter_client.kernelspec import KernelSpecManager @@ -261,8 +249,6 @@ def install_notebook_extension(path=None, overwrite=False, symlink=False, Default value is `https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip `_. - - .. versionadded:: 1.3 """ if path is None: path = "https://github.com/ipython-contrib/IPython-notebook-extensions/archive/master.zip" @@ -288,11 +274,9 @@ def install_notebook_extension(path=None, overwrite=False, symlink=False, def get_jupyter_datadir(): """ - return the data directory for the notebook + Returns the data directory for the notebook. @return path - - .. versionadded:: 1.3 """ from jupyter_client.kernelspec import KernelSpecManager return KernelSpecManager().data_dir @@ -317,9 +301,6 @@ def get_jupyter_extension_dir(user=False, prefix=None, ++++++ path: path to installed extensions (by the user) - - - .. versionadded:: 1.3 """ from notebook.nbextensions import _get_nbextension_dir return _get_nbextension_dir(nbextensions_dir=nbextensions_dir, user=user, prefix=prefix) @@ -346,8 +327,6 @@ def get_installed_notebook_extension(user=False, prefix=None, list: list of installed notebook extension (by the user) You can install extensions with function @see fn install_notebook_extension. - - .. versionadded:: 1.3 """ path = get_jupyter_extension_dir( user=user, prefix=prefix, nbextensions_dir=nbextensions_dir) @@ -417,8 +396,6 @@ def install_jupyter_kernel(exe=sys.executable, kernel_spec_manager=None, user=Fa "{connection_file}" ] } - - .. versionadded:: 1.3 """ exe = exe.replace("pythonw.exe", "python.exe") dest = install_k(kernel_spec_manager=kernel_spec_manager, diff --git a/src/pyquickhelper/ipythonhelper/notebook_runner.py b/src/pyquickhelper/ipythonhelper/notebook_runner.py index e5d1c1dd8..809dd16fe 100644 --- a/src/pyquickhelper/ipythonhelper/notebook_runner.py +++ b/src/pyquickhelper/ipythonhelper/notebook_runner.py @@ -229,9 +229,6 @@ def to_json(self, filename=None, encoding="utf8"): @param filename filename or stream @param encoding encoding @return Json string if filename is None, None otherwise - - .. versionchanged:: 1.4 - The function now returns the json string if filename is None. """ if isinstance(filename, str # unicode# ): @@ -251,11 +248,6 @@ def copy(self): Copies the notebook (just the content). @return instance of @see cl NotebookRunner - - .. versionadded:: 1.1 - - .. versionchanged:: 1.5 - Add constructor parameters. """ st = StringIO() self.to_json(st) @@ -295,9 +287,6 @@ def clean_code(self, code): @param code code (string) @return cleaned code - - .. versionchanged:: 1.4 - Do replacements. """ has_bokeh = "bokeh." in code or "from bokeh" in code or "import bokeh" in code if code is None: @@ -606,8 +595,6 @@ def __len__(self): to get this information and does cache the information. @return int - - .. versionadded:: 1.1 """ return sum(1 for _ in self.iter_cells()) @@ -958,16 +945,10 @@ def run_notebook(self, skip_exceptions=False, progress_callback=None, @param clean_function function which cleans a cell's code before executing it (None for None) @return dictionary with statistics - .. versionchanged:: 1.1 - The function adds the local variable ``theNotebook`` with - the absolute file name of the notebook. - - .. versionchanged:: 1.4 - Function *valid* can now return None to stop the execution of the notebook - before this cell. - - .. versionchanged:: 1.5 - Add parameter *context*. + The function adds the local variable ``theNotebook`` with + the absolute file name of the notebook. + Function *valid* can return *None* to stop the execution of the notebook + before this cell. ''' if self.detailed_log: self.detailed_log( @@ -1034,8 +1015,6 @@ def run_notebook(self, skip_exceptions=False, progress_callback=None, def count_code_cells(self): ''' Returns the number of code cells in the notebook. - - .. versionadded:: 1.1 ''' return sum(1 for _ in self.iter_code_cells()) @@ -1059,8 +1038,6 @@ def merge_notebook(self, nb): nb2 = read_nb("", kernel=False) nb1.merge_notebook(nb2) nb1.to_json(outfile) - - .. versionadded:: 1.1 """ if isinstance(nb, list): s = 0 @@ -1082,8 +1059,6 @@ def get_description(self): of its content. @return header, description - - .. versionadded:: 1.5 """ def split_header(s, get_header=True): s = s.lstrip().rstrip() @@ -1143,8 +1118,6 @@ def get_thumbnail(self, max_width=200, max_height=200): @return string (SVG) or Image (PIL) This functionality might not works with Python 2.7. - - .. versionadded:: 1.5 """ images = [] cells = list(self.iter_cells()) @@ -1204,8 +1177,6 @@ def _scale_image(self, in_bytes, format=None, max_width=200, max_height=200): @param max_width maximum size of the thumbnail @param max_height maximum size of the thumbnail @return Image (PIL) - - .. versionadded:: 1.5 """ # local import to avoid testing dependency on PIL: try: @@ -1250,9 +1221,7 @@ def _merge_images(self, results): Merges images defined by (buffer, format). The method uses PIL to merge images when possible. - @return [ (image, format) ] - - .. versionadded:: 1.5 + @return ``[ (image, format) ]`` """ if len(results) == 1: results = results[0] diff --git a/src/pyquickhelper/ipythonhelper/run_notebook.py b/src/pyquickhelper/ipythonhelper/run_notebook.py index ad077b036..d8c378bfe 100644 --- a/src/pyquickhelper/ipythonhelper/run_notebook.py +++ b/src/pyquickhelper/ipythonhelper/run_notebook.py @@ -1,9 +1,6 @@ """ @file @brief Functions to run notebooks. - -.. versionadded:: 1.4 - Split from *notebook_helper.py*. """ import sys import time @@ -46,8 +43,6 @@ def _cache_url_to_file(cache_urls, folder, fLOG=noLOG): The function detects if the file was already downloaded. In that case, it does not do it a second time. - - .. versionadded:: 1.4 """ if cache_urls is None: return None @@ -374,9 +369,6 @@ def execute_notebook_list_finalize_ut(res, dump=None, fLOG=noLOG): from pyquickhelper.ipythonhelper.run_notebook import _get_dump_default_path import pyquickhelper print(_get_dump_default_path(pyquickhelper)) - - - .. versionadded:: 1.5 """ if len(res) == 0: raise Exception("No notebook was run.") @@ -440,8 +432,6 @@ def notebook_coverage(module_or_path, dump=None, too_old=30): If *module_or_path* is a module, the function will get a list notebooks assuming it follows the same design as :epkg:`pyquickhelper`. - - .. versionadded:: 1.5 """ if dump is None: dump = _get_dump_default_path(module_or_path) diff --git a/src/pyquickhelper/ipythonhelper/unittest_notebook.py b/src/pyquickhelper/ipythonhelper/unittest_notebook.py index 670d1d9bb..c767a12b9 100644 --- a/src/pyquickhelper/ipythonhelper/unittest_notebook.py +++ b/src/pyquickhelper/ipythonhelper/unittest_notebook.py @@ -1,8 +1,6 @@ """ @file -@brief Functions to test a notebooks. - -.. versionadded:: 1.5 +@brief Functions to test a notebook. """ import os import shutil @@ -59,9 +57,6 @@ def test_notebook_example_pyquickhelper(self): folder = os.path.join(os.path.dirname(__file__), ".." , "..", "_doc", "notebooks") test_notebook_execution_coverage(__file__, "compare_python_distribution", folder, 'mymodule', fLOG=fLOG) - - .. versionchanged:: 1.6 - Parameter *filter_name* was added.s """ # delayed import (otherwise, it has circular references) from ..pycode import get_temp_folder diff --git a/src/pyquickhelper/ipythonhelper/widgets.py b/src/pyquickhelper/ipythonhelper/widgets.py index e2a4c90a7..f0ef31d0e 100644 --- a/src/pyquickhelper/ipythonhelper/widgets.py +++ b/src/pyquickhelper/ipythonhelper/widgets.py @@ -31,9 +31,6 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -.. versionadded:: 1.1 """ import copy diff --git a/src/pyquickhelper/jenkinshelper/jenkins_exceptions.py b/src/pyquickhelper/jenkinshelper/jenkins_exceptions.py index c7e497a41..7e30e4cd7 100644 --- a/src/pyquickhelper/jenkinshelper/jenkins_exceptions.py +++ b/src/pyquickhelper/jenkinshelper/jenkins_exceptions.py @@ -1,8 +1,6 @@ """ @file @brief Jenkins exceptions - -.. versionadded:: 1.1 """ diff --git a/src/pyquickhelper/jenkinshelper/jenkins_server.py b/src/pyquickhelper/jenkinshelper/jenkins_server.py index 824bf5702..63c0b7370 100644 --- a/src/pyquickhelper/jenkinshelper/jenkins_server.py +++ b/src/pyquickhelper/jenkinshelper/jenkins_server.py @@ -17,8 +17,6 @@ This adds a job which runs all unit tests with an estimated duration below 10 seconds. - -.. versionadded:: 1.1 """ import os @@ -370,8 +368,6 @@ def get_cmd_custom(job): @param job module and options @return script - - .. versionadded:: 1.2 """ spl = job.split() if spl[0] != "custom": @@ -750,17 +746,9 @@ def create_job_template(self, name, git_repo, credentials="", upstreams=None, sc H H(13-14) * * 0 - .. versionchanged:: 1.2 - Parameter *success_only* was added to prevent a job from running if the previous one failed. - Options *success_only* must be specified. - Parameter *update* was added to update a job instead of creating it. - - .. versionchanged:: 1.4 - Parameter *adjust_scheduler* was added to delayed some jobs if a spot is already taken. - - .. versionchanged:: 1.5 - *kwargs* can contain option *job_options*. - Parameter *clean_repo* was added. + Parameter *success_only* prevents a job from running if the previous one failed. + Options *success_only* must be specified. + Parameter *update* updates a job instead of creating it. """ if 'platform' in kwargs: raise NameError( @@ -989,7 +977,7 @@ def setup_jenkins_server(self, github, modules, get_jenkins_script=None, overwri * `Git Plugin `_ * `GitHub Plugin `_ * `GitLab Plugin `_ - * `Python `_ + * :epkg:`Python` * `Python Wrapper Plugin `_ * `Build timeout plugin `_ diff --git a/src/pyquickhelper/jenkinshelper/jenkins_server_template.py b/src/pyquickhelper/jenkinshelper/jenkins_server_template.py index e2a9e7872..c3ecd9d04 100644 --- a/src/pyquickhelper/jenkinshelper/jenkins_server_template.py +++ b/src/pyquickhelper/jenkinshelper/jenkins_server_template.py @@ -1,8 +1,6 @@ """ @file -@brief Job templates - -.. versionadded:: 1.1 +@brief Job templates. """ #: main template: the full job diff --git a/src/pyquickhelper/loghelper/convert_helper.py b/src/pyquickhelper/loghelper/convert_helper.py index 97bdf8086..93443f7ce 100644 --- a/src/pyquickhelper/loghelper/convert_helper.py +++ b/src/pyquickhelper/loghelper/convert_helper.py @@ -18,9 +18,6 @@ def str2datetime(dt, format=None): which you get by default @rtype datetime @return datetime - - .. versionchanged:: 1.0 - accept more formats (no time, T instead of space) """ if "+" in dt: dt = dt.split("+")[0].strip() @@ -45,12 +42,10 @@ def str2datetime(dt, format=None): def datetime2str(dt): """ - convert a datetime into a string + Converts a datetime into a string. @param dt datetime @return string - - .. versionadded:: 1.3 """ return dt.strftime("%Y-%m-%d %H:%M:%S") diff --git a/src/pyquickhelper/loghelper/custom_log.py b/src/pyquickhelper/loghelper/custom_log.py index 8a9030a16..d28cda24b 100644 --- a/src/pyquickhelper/loghelper/custom_log.py +++ b/src/pyquickhelper/loghelper/custom_log.py @@ -2,8 +2,6 @@ """ @file @brief Creates a custom log (open a text file and flushes everything in it). - -.. versionadded:: 1.5 """ import datetime import sys diff --git a/src/pyquickhelper/loghelper/flog.py b/src/pyquickhelper/loghelper/flog.py index cfabcbf36..e2ef5e537 100644 --- a/src/pyquickhelper/loghelper/flog.py +++ b/src/pyquickhelper/loghelper/flog.py @@ -134,10 +134,6 @@ def GetLogFile(physical=False, filename=None): :return: a pointer to a log file :rtype: str :raises OSError: if this file cannot be created - - .. versionchanged:: 1.1 - Use module `logging `_. - Parameter *filename* was added. """ if flog_static.store_log_values["__log_file"] is None: if physical: @@ -352,9 +348,6 @@ def get_relative_path(folder, file, exists=True, absolute=True): @param absolute if True return a path which starts from the root @return relative path @rtype str - - .. versionchanged:: 1.5 - Parameter *exists* was added. """ if exists: if not os.path.exists(folder): @@ -396,9 +389,6 @@ def download(httpfile, path_unzip=None, outfile=None, flatten=True, fLOG=None): @param flatten (bool) put all files in the same folder (forget subfolders) @param fLOG (str) logging function @return local file name - - .. versionchanged:: 1.5 - Parameters *fLOG*, *flatten* were added. """ if fLOG is None: fLOG = noLOG @@ -413,17 +403,14 @@ def download(httpfile, path_unzip=None, outfile=None, flatten=True, fLOG=None): def unzip(file, path_unzip=None, outfile=None, flatten=True, fLOG=noLOG): """ - unzip a file into the temporary folder, - the function expects to have only one zipped file + Unzips a file into the temporary folder, + the function expects to have only one zipped file. @param file (str) zip files @param path_unzip (str) where to unzip the file, if None, choose GetPath () @param outfile (str) if None, the function will assign a filename unless this parameter is specified @param flatten (bool) put all files in the same folder (forget subfolders) @return expanded file name - - .. versionadded:: 1.5 - Parameters *fLOG*, *flatten* were added. """ if path_unzip is None: path_unzip = GetPath() @@ -493,9 +480,6 @@ def _check_zip_file(filename, path_unzip, outfile, flatten=True, fLOG=noLOG): @param flatten unzip all files into the same directory @param fLOG logging function @return the unzipped file or filename if the format was not zip - - .. versionchanged:: 1.5 - Parameters *fLOG*, *flatten* were added. """ if path_unzip is None: raise ValueError("path_unzip cannot be None") @@ -715,9 +699,6 @@ def _check_url_file(url, path_download, outfile, fLOG=noLOG): @param outfile if None, the function will assign a filename unless this parameter is specified @param fLOG logging function @return the filename - - .. versionchanged:: 1.5 - Parameter *fLOG* was added. """ urll = url.lower() if "http://" in urll or "https://" in urll: @@ -804,9 +785,6 @@ def _check_source(fileurl, path_unzip, outfile, flatten=True, fLOG=noLOG): - a text file: do nothing If the file has already been downloaded and unzipped, it is not done twice. - - .. versionadded:: - Parameter *fLOG*, *flatten* were added. """ if outfile is not None and os.path.splitext( outfile)[1].lower() == os.path.splitext(fileurl)[1].lower(): diff --git a/src/pyquickhelper/loghelper/flog_fake_classes.py b/src/pyquickhelper/loghelper/flog_fake_classes.py index 7466a1d08..948c570f7 100644 --- a/src/pyquickhelper/loghelper/flog_fake_classes.py +++ b/src/pyquickhelper/loghelper/flog_fake_classes.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Exception specific to this module - -.. versionadded:: 1.1 +@brief Exception specific to this module. """ import logging import logging.handlers diff --git a/src/pyquickhelper/loghelper/os_helper.py b/src/pyquickhelper/loghelper/os_helper.py index 4d7e73b80..b70734ce0 100644 --- a/src/pyquickhelper/loghelper/os_helper.py +++ b/src/pyquickhelper/loghelper/os_helper.py @@ -1,8 +1,6 @@ """ @file -@brief Helpers for OS - -.. versionadded:: 1.5 +@brief Helpers for module :epkg:`*py:os`. """ import os diff --git a/src/pyquickhelper/loghelper/process_helper.py b/src/pyquickhelper/loghelper/process_helper.py index f863b898f..c0dfa0789 100644 --- a/src/pyquickhelper/loghelper/process_helper.py +++ b/src/pyquickhelper/loghelper/process_helper.py @@ -2,8 +2,6 @@ """ @file @brief Helpers about processes. - -.. versionadded:: 1.6.2291 """ from .flog import fLOG @@ -19,8 +17,6 @@ def reap_children(timeout=3, subset=None, fLOG=fLOG): @param subset subset of processes to be removed @param fLOG logging function @return killed processes - - .. versionadded:: 1.6.2291 """ import psutil killed = set() diff --git a/src/pyquickhelper/loghelper/repositories/pygit_helper.py b/src/pyquickhelper/loghelper/repositories/pygit_helper.py index 8c061dac4..909a39bac 100644 --- a/src/pyquickhelper/loghelper/repositories/pygit_helper.py +++ b/src/pyquickhelper/loghelper/repositories/pygit_helper.py @@ -30,8 +30,6 @@ def my_date_conversion(sdate): @param sdate string @return date - - .. versionadded:: 1.0 """ first = sdate.split(" ")[0] trois = first.replace(".", "-").replace("/", "-").split("-") @@ -71,7 +69,7 @@ def __init__(self, **args): self.__dict__[k] = v if hasattr(self, "name"): - if '"' in self.name: + if '"' in self.name: # pylint: disable=E0203 #defa = sys.stdout.encoding if sys.stdout != None else "utf8" self.name = self.name.replace('"', "") #self.name = self.name.encode(defa).decode("utf-8") @@ -123,8 +121,6 @@ def get_cmd_git(): Gets the command line used to run :epkg:`git`. @return string - - .. versionadded:: 1.3 """ if sys.platform.startswith("win32"): cmd = r'"C:\Program Files\Git\bin\git.exe"' @@ -428,20 +424,16 @@ def get_repo_log(path=None, file_detail=False, commandline=True, subset=None): git log --stat -- _unittests/ut_loghelper/data/sample_zip.zip - .. versionchanged:: 1.0 - For some reason, the call to @see fn str2datetime seemed to cause exception such as:: - - File "", line 2212, in _find_and_load_unlocked - File "", line 321, in _call_with_frames_removed - File "", line 2254, in _gcd_import - File "", line 2237, in _find_and_load - File "", line 2224, in _find_and_load_unlocked + For some reason, the call to @see fn str2datetime seemed to cause exception such as:: - when it was used to generate documentation for others modules than *pyquickhelper*. - Not using this function helps. The cause still remains obscure. + File "", line 2212, in _find_and_load_unlocked + File "", line 321, in _call_with_frames_removed + File "", line 2254, in _gcd_import + File "", line 2237, in _find_and_load + File "", line 2224, in _find_and_load_unlocked - .. versionchanged:: 1.5 - Enable *file_details*. + when it was used to generate documentation for others modules than *pyquickhelper*. + Not using this function helps. The cause still remains obscure. """ if file_detail: if subset is None: @@ -744,8 +736,6 @@ def clone(location, srv, group, project, username=None, password=None, fLOG=None :: clone("local_folder", "github.com", "sdpython", "pyquickhelper") - - .. versionadded:: 0.9 """ if username is not None: address = "https://{0}:{1}@{2}/{3}/{4}.git".format(username, @@ -774,8 +764,6 @@ def rebase(location, srv, group, project, username=None, password=None, fLOG=Non @param password password @param fLOG logging function @return output, error - - .. versionadded:: 0.9 """ if username is not None: address = "https://{0}:{1}@{2}/{3}/{4}.git".format(username, diff --git a/src/pyquickhelper/loghelper/repositories/pysvn_helper.py b/src/pyquickhelper/loghelper/repositories/pysvn_helper.py index 8ab73439b..aca06c1c4 100644 --- a/src/pyquickhelper/loghelper/repositories/pysvn_helper.py +++ b/src/pyquickhelper/loghelper/repositories/pysvn_helper.py @@ -69,13 +69,12 @@ def repo_ls(full, commandline=True): @param commandline use command line instead of pysvn @return output of client.ls - .. versionchanged:: 1.5 - When a path includes a symbol ``@``, another one must added to the path - to avoid the following error to happen: + When a path includes a symbol ``@``, another one must added to the path + to avoid the following error to happen: - :: + :: - svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' + svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' """ if not commandline: try: @@ -187,13 +186,12 @@ def get_repo_log(path=None, file_detail=False, commandline=True): pyquickhelper: first version - .. versionchanged:: 1.5 - When a path includes a symbol ``@``, another one must added to the path - to avoid the following error to happen: + When a path includes a symbol ``@``, another one must added to the path + to avoid the following error to happen: - :: + :: - svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' + svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' """ if path is None: path = os.path.normpath( @@ -283,13 +281,12 @@ def get_repo_version(path=None, commandline=True, log=False): @param log if True, returns the output instead of a boolean @return integer (check in number) - .. versionchanged:: 1.5 - When a path includes a symbol ``@``, another one must added to the path - to avoid the following error to happen: + When a path includes a symbol ``@``, another one must added to the path + to avoid the following error to happen: - :: + :: - svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' + svn: E205000: Syntax error parsing peg revision 'something@somewhere.fr-' """ if path is None: path = os.path.normpath( diff --git a/src/pyquickhelper/loghelper/run_cmd.py b/src/pyquickhelper/loghelper/run_cmd.py index ee8ceaf47..7f895c522 100644 --- a/src/pyquickhelper/loghelper/run_cmd.py +++ b/src/pyquickhelper/loghelper/run_cmd.py @@ -76,9 +76,6 @@ def decode_outerr(outerr, encoding, encerror, msg): @param encerror how to handle errors @param msg to add to the exception message @return converted string - - .. versionchanged:: 1.4 - If *encoding* is None, it is replaced by ``'ascii'``. """ if encoding is None: encoding = "ascii" @@ -108,8 +105,6 @@ def skip_run_cmd(cmd, sin="", shell=True, wait=False, log_error=True, timeout_listen=None, tell_if_no_output=None, prefix_log=None): """ Has the same signature as @see fn run_cmd but does nothing. - - .. versionadded:: 1.0 """ return "", "" @@ -156,23 +151,13 @@ def run_cmd(cmd, sin="", shell=sys.platform.startswith("win"), wait=False, log_e from pyquickhelper.loghelper import run_cmd out, err = run_cmd("python setup.py install", wait=True) - If you are using this function to run git function, parameter ``shell`` must be True. - - .. versionchanged:: 1.3 - Catches *SystemExit* exception. Add parameter *catch_exit*. - - .. versionchanged:: 1.4 - Changed *fLOG* default value to None. Remove parameter *do_not_log*, *secure*, *stop_waiting_if*. - Implements parameter *stop_running_if*. - Improve the behavior of the function. - See `Constantly print Subprocess output while process is running - `_. - Parameter *tell_if_no_output*, *stop_running_if* were added. - - .. versionchanged:: 1.5 - If *wait* is False, the function returns the started process. - ``__exit__`` should be called if wait if False. - Parameter *prefix_log* was added. + If you are using this function to run :ekpg:`git` function, parameter ``shell`` must be True. + The function catches *SystemExit* exception. + See `Constantly print Subprocess output while process is running + `_. + If *wait* is False, the function returns the started process. + ``__exit__`` should be called if wait if False. + Parameter *prefix_log* was added. """ if prefix_log is None: prefix_log = "" diff --git a/src/pyquickhelper/pandashelper/tblformat.py b/src/pyquickhelper/pandashelper/tblformat.py index f1ffe3105..00effbc97 100644 --- a/src/pyquickhelper/pandashelper/tblformat.py +++ b/src/pyquickhelper/pandashelper/tblformat.py @@ -51,13 +51,6 @@ def df2rst(df, add_line=True, align="l", column_size=None, index=False, - 2.99 - anythings ... - - - .. versionchanged:: 1.3 - Parameter *align* was changed, parameter *column_size* was added. - - .. versionchanged:: 1.5 - Parameter *index*, *list_table*, *title*, *header* were added. """ if index: df = df.reset_index(drop=False).copy() diff --git a/src/pyquickhelper/pandashelper/tblfunction.py b/src/pyquickhelper/pandashelper/tblfunction.py index 63e512686..102035c26 100644 --- a/src/pyquickhelper/pandashelper/tblfunction.py +++ b/src/pyquickhelper/pandashelper/tblfunction.py @@ -11,8 +11,7 @@ def isempty(s): @param s ``str`` or ``numpy.NaN`` @return boolean - .. versionchanged:: 1.3 - We import numpy in the function (delayed import). + The function imports :epkg:`numpy` (delayed import). """ if s is None: return True @@ -35,8 +34,7 @@ def isnan(s): @raise TypeError if ``s`` is not a ``float`` - .. versionchanged:: 1.3 - We import numpy in the function (delayed import). + The function imports :epkg:`numpy` (delayed import). """ if isinstance(s, float): import numpy diff --git a/src/pyquickhelper/pycode/_pylint_common.py b/src/pyquickhelper/pycode/_pylint_common.py index 762a492f8..fb5381131 100644 --- a/src/pyquickhelper/pycode/_pylint_common.py +++ b/src/pyquickhelper/pycode/_pylint_common.py @@ -30,11 +30,11 @@ def _private_test_style_src(fLOG, run_lint, verbose=False, pattern=".*[.]py$"): 'R0911', 'R0916', 'C0200', 'W0223', 'W0122', 'E1003', 'R0205', 'E0001', 'W0143'), - skip=["ftp_transfer_files.py:368: [E731]", + skip=["ftp_transfer_files.py:359: [E731]", "_nbconvert_config.py:", "convert_doc_sphinx_helper.py:31: [E402]", "magic_class.py:12: [E402]", - "windows_scripts.py:718", + "windows_scripts.py:716", "Redefining built-in 'open'", "Redefining built-in 'StringIO'", "Redefining built-in 'FileNotFoundError'", @@ -145,7 +145,7 @@ def _private_test_style_src(fLOG, run_lint, verbose=False, pattern=".*[.]py$"): "excs.py:1: R0401", "documentation_server.py:30: E0401", "Unable to import 'src.pyquickhelper.helpgen.sphinxm_mock_app'", - "utils_tests_helper.py:36", + "utils_tests_helper.py:33", "No name 'sphinxm_mock_app' in module 'src.pyquickhelper.helpgen'", "cli_helper.py:233: R1714", ]) diff --git a/src/pyquickhelper/pycode/build_helper.py b/src/pyquickhelper/pycode/build_helper.py index cfcfdec5f..5904c5389 100644 --- a/src/pyquickhelper/pycode/build_helper.py +++ b/src/pyquickhelper/pycode/build_helper.py @@ -1,8 +1,6 @@ """ @file -@brief Produce a build file for a module following *pyquickhelper* design. - -.. versionadded:: 1.1 +@brief Produces a build file for a module following *pyquickhelper* design. """ import sys @@ -240,9 +238,6 @@ def get_build_script(module, requirements=None, port=8067, default_engine_paths= @param default_engine_paths define the default location for python engine, should be dictionary *{ engine: path }*, see below. @param additional_local_path additional paths to add to PYTHONPATH @return scripts - - .. versionchanged:: 1.3 - Parameter *additional_local_path* was added. """ if requirements is None: requirements = [] @@ -266,9 +261,6 @@ def get_script_command(command, module, requirements, port=8067, platform=sys.pl @return scripts The available list of commands is given by function @see fn process_standard_options_for_setup. - - .. versionchanged:: 1.3 - Parameter *additional_local_path* was added """ if not platform.startswith("win"): raise NotImplementedError("not yet available on linux") @@ -334,11 +326,6 @@ def get_extra_script_command(command, module, requirements, port=8067, blog_list @return scripts The available list of commands is given by function @see fn process_standard_options_for_setup. - - .. versionchanged:: 1.3 - Parameter *unittest_modules*, was added. - Parameters *additional_notebook_path*, *additional_local_path* were added to add local dependencies when - running a notebook. Mostly for development purposes. """ if not platform.startswith("win"): raise NotImplementedError("linux not yet available") diff --git a/src/pyquickhelper/pycode/call_setup_hook.py b/src/pyquickhelper/pycode/call_setup_hook.py index 580acb3f0..cebc4d961 100644 --- a/src/pyquickhelper/pycode/call_setup_hook.py +++ b/src/pyquickhelper/pycode/call_setup_hook.py @@ -1,8 +1,6 @@ """ @file -@brief Helper for the setup - -.. versionadded:: 1.1 +@brief Helper for the setup. """ import os import sys @@ -28,9 +26,6 @@ def call_setup_hook_cmd(folder, module_name, function_name="_setup_hook", The function expects to find file ``__init__.py`` in ``/src/``. - - .. versionadded:: 1.2 - Split function @see fn call_setup_hook in 2 functions. """ this = os.path.abspath(os.path.dirname(__file__)) this = os.path.normpath(os.path.join(this, "..", "..")) diff --git a/src/pyquickhelper/pycode/ci_helper.py b/src/pyquickhelper/pycode/ci_helper.py index 547a2fb7a..35682cbd4 100644 --- a/src/pyquickhelper/pycode/ci_helper.py +++ b/src/pyquickhelper/pycode/ci_helper.py @@ -14,9 +14,6 @@ def is_travis_or_appveyor(env=None): The function should rely more on environement variables ``CI``, ``TRAVIS``, ``APPVEYOR``. - .. versionchanged:: 1.5 - Takes into account *circleci*. - .. versionadded:: 1.8 Parameter *env* was added. """ diff --git a/src/pyquickhelper/pycode/clean_helper.py b/src/pyquickhelper/pycode/clean_helper.py index cc954de06..d75830f00 100644 --- a/src/pyquickhelper/pycode/clean_helper.py +++ b/src/pyquickhelper/pycode/clean_helper.py @@ -1,8 +1,6 @@ """ @file @brief Various function to clean files. - -.. versionadded:: 0.9 """ from __future__ import print_function import os diff --git a/src/pyquickhelper/pycode/code_helper.py b/src/pyquickhelper/pycode/code_helper.py index bbc2206dd..d1ebf743a 100644 --- a/src/pyquickhelper/pycode/code_helper.py +++ b/src/pyquickhelper/pycode/code_helper.py @@ -17,11 +17,6 @@ def remove_extra_spaces_and_pep8(filename, apply_pep8=True, aggressive=False, is @param aggressive more aggressive @param is_string force *filename* to be a string @return number of removed extra spaces - - .. versionchanged:: 1.5 - Allow string and not only files, add parameter *aggressive*, - use ``fix_code`` instead of ``fix_line``. - Parameter *is_string* was added. """ encoding = None initial_content = None @@ -193,12 +188,6 @@ def remove_extra_spaces_folder( def file_filter(filename): return True or False - - .. versionchanged:: 1.0 - Parameter *apply_pep8* was added. - - .. versionchanged:: 1.5 - Parameter *file_filter* was added. """ neg_pattern = "|".join("[/\\\\]{0}[/\\\\]".format(_) for _ in ["build", "build2", "build3", "dist", "_venv", "_todo", "dist_module27", "_virtualenv"]) diff --git a/src/pyquickhelper/pycode/coverage_helper.py b/src/pyquickhelper/pycode/coverage_helper.py index d6db2611e..e60d5e735 100644 --- a/src/pyquickhelper/pycode/coverage_helper.py +++ b/src/pyquickhelper/pycode/coverage_helper.py @@ -1,8 +1,6 @@ """ @file @brief Publishing coverage - -.. versionadded:: 1.3 """ import os import re diff --git a/src/pyquickhelper/pycode/default_filter_warning.py b/src/pyquickhelper/pycode/default_filter_warning.py index 5ce15aa10..df86e7c82 100644 --- a/src/pyquickhelper/pycode/default_filter_warning.py +++ b/src/pyquickhelper/pycode/default_filter_warning.py @@ -1,8 +1,6 @@ """ @file @brief Function which filters ou warnings after running the unit test - -.. versionadded:: 1.5 """ import warnings diff --git a/src/pyquickhelper/pycode/default_regular_expression.py b/src/pyquickhelper/pycode/default_regular_expression.py index 776b548f3..c09469ab5 100644 --- a/src/pyquickhelper/pycode/default_regular_expression.py +++ b/src/pyquickhelper/pycode/default_regular_expression.py @@ -1,8 +1,6 @@ """ @file @brief Regular expressions. - -.. versionadded:: 1.5 """ _setup_pattern_copy_exts = ['ico', '7z', 'dll', 'so', 'yml', 'rst', 'ipynb', 'gif', 'jpg', 'jpeg', 'png', 'txt', diff --git a/src/pyquickhelper/pycode/insetup_helper.py b/src/pyquickhelper/pycode/insetup_helper.py index 82696a21c..b5badd61c 100644 --- a/src/pyquickhelper/pycode/insetup_helper.py +++ b/src/pyquickhelper/pycode/insetup_helper.py @@ -1,8 +1,6 @@ """ @file @brief Function to use inside setup.py - -.. versionadded:: 1.5 """ import os import sys diff --git a/src/pyquickhelper/pycode/linux_scripts.py b/src/pyquickhelper/pycode/linux_scripts.py index 0b2d31bbf..50cac12cd 100644 --- a/src/pyquickhelper/pycode/linux_scripts.py +++ b/src/pyquickhelper/pycode/linux_scripts.py @@ -1,8 +1,6 @@ """ @brief @file Batch file use to automate some of the tasks (setup, unit tests, help, pypi). - -.. versionadded:: 1.1 """ import sys diff --git a/src/pyquickhelper/pycode/open_script_file.py b/src/pyquickhelper/pycode/open_script_file.py index 3afaa43f3..024f34bc0 100644 --- a/src/pyquickhelper/pycode/open_script_file.py +++ b/src/pyquickhelper/pycode/open_script_file.py @@ -1,8 +1,6 @@ """ @file @brief A function to read a script and reading the encoding on the first line. - -.. versionadded:: 1.1 """ import sys diff --git a/src/pyquickhelper/pycode/py3to2.py b/src/pyquickhelper/pycode/py3to2.py index 3fadd18e8..cfeef495a 100644 --- a/src/pyquickhelper/pycode/py3to2.py +++ b/src/pyquickhelper/pycode/py3to2.py @@ -1,8 +1,6 @@ """ @file @brief Helper to convert a script written in Python 3 to Python 2 - -.. versionadded:: 1.0 """ import os @@ -85,8 +83,6 @@ def py3to2_convert_tree(folder, dest, encoding="utf8", pattern=".*[.]py$", `Cheat Sheet: Writing Python 2-3 compatible code `_ gives the difference between the two versions of Python and how to write compatible code. - - .. versionadded:: 1.0 """ exclude = ("temp_", "dist", "_doc", "build", "extensions", "nbextensions", "dist_module27", "_virtualenv", "_venv") @@ -159,8 +155,6 @@ def py3to2_convert(script, unittest_modules): @return string See see @fn py3to2_convert_tree for more information. - - .. versionadded:: 1.0 """ if os.path.exists(script): try: diff --git a/src/pyquickhelper/pycode/readme_helper.py b/src/pyquickhelper/pycode/readme_helper.py index 16e78c6ed..5e24ed91b 100644 --- a/src/pyquickhelper/pycode/readme_helper.py +++ b/src/pyquickhelper/pycode/readme_helper.py @@ -1,8 +1,6 @@ """ @file @brief Helpers about readme. - -.. versionadded:: 1.5 """ diff --git a/src/pyquickhelper/pycode/setup_helper.py b/src/pyquickhelper/pycode/setup_helper.py index b74acd07f..3af51c7a2 100644 --- a/src/pyquickhelper/pycode/setup_helper.py +++ b/src/pyquickhelper/pycode/setup_helper.py @@ -575,8 +575,6 @@ def write_version_for_setup(file_or_folder): @param file_or_folder file ``setup.py`` or folder which contains it @return version number - - .. versionadded:: 1.1 """ src = SourceRepository(commandline=True) ffolder = get_folder(file_or_folder) @@ -601,9 +599,6 @@ def clean_space_for_setup(file_or_folder, file_filter=None): @param file_or_folder file ``setup.py`` or folder which contains it @param file_filter file filter (see @see fn remove_extra_spaces_folder) @return impacted files - - .. versionchanged:: 1.5 - Parameter *file_filter* was added. """ ffolder = get_folder(file_or_folder) rem = remove_extra_spaces_folder( @@ -971,8 +966,6 @@ def _get_dump_default_path(location, module_name, argv): @return location of the dump The result is None for remote continuous integration. - - .. versionadded:: 1.5 """ from . import is_travis_or_appveyor if is_travis_or_appveyor(): diff --git a/src/pyquickhelper/pycode/tkinter_helper.py b/src/pyquickhelper/pycode/tkinter_helper.py index f49868e60..fa6a52df1 100644 --- a/src/pyquickhelper/pycode/tkinter_helper.py +++ b/src/pyquickhelper/pycode/tkinter_helper.py @@ -1,8 +1,6 @@ """ @file @brief Helpers for tkinter - -.. versionadded:: 1.1 """ import os import sys @@ -33,10 +31,6 @@ def fix_tkinter_issues_virtualenv(exc=True, fLOG=None): But it does not work if matplotlib was already imported. It is recommended to delay its import whenever it is possible. - - .. versionchanged:: 1.5 - Raises an exception by default when used before matplotlib is imported. - Parameters *exc* and *fLOG* were added. """ global _first_execution diff --git a/src/pyquickhelper/pycode/trace_execution.py b/src/pyquickhelper/pycode/trace_execution.py index 3809c8a2a..fbf8cd58f 100644 --- a/src/pyquickhelper/pycode/trace_execution.py +++ b/src/pyquickhelper/pycode/trace_execution.py @@ -1,8 +1,6 @@ """ @brief @file Various function to help investigate an error. - -.. versionadded:: 1.3 """ import sys import traceback diff --git a/src/pyquickhelper/pycode/unittestclass.py b/src/pyquickhelper/pycode/unittestclass.py index e831f80e3..324577e79 100644 --- a/src/pyquickhelper/pycode/unittestclass.py +++ b/src/pyquickhelper/pycode/unittestclass.py @@ -1,8 +1,6 @@ """ @file @brief Overwrites unit test class with additional testing functions. - -.. versionadded:: 1.5 """ import os import sys @@ -391,8 +389,6 @@ def write_file(self, filename, content, mode='w', encoding='utf-8'): def skipif_appveyor(msg): """ Skips a unit test if it runs on :epkg:`appveyor`. - - .. versionadded:: 1.6 """ if is_travis_or_appveyor() != 'appveyor': return lambda x: x @@ -403,8 +399,6 @@ def skipif_appveyor(msg): def skipif_travis(msg): """ Skips a unit test if it runs on :epkg:`travis`. - - .. versionadded:: 1.6 """ if is_travis_or_appveyor() != 'travis': return lambda x: x @@ -415,8 +409,6 @@ def skipif_travis(msg): def skipif_circleci(msg): """ Skips a unit test if it runs on :epkg:`circleci`. - - .. versionadded:: 1.6 """ if is_travis_or_appveyor() != 'circleci': return lambda x: x diff --git a/src/pyquickhelper/pycode/utils_tests.py b/src/pyquickhelper/pycode/utils_tests.py index e16e3010f..12603263a 100644 --- a/src/pyquickhelper/pycode/utils_tests.py +++ b/src/pyquickhelper/pycode/utils_tests.py @@ -1,12 +1,6 @@ """ @file @brief This extension contains various functionalities to help unittesting. - -.. versionchanged:: 1.1 - Moved to folder ``pycode``. - -.. versionchanged:: 1.4 - Split into 3 files. """ import os import sys @@ -89,10 +83,8 @@ def main_wrapper_tests(codefile, skip_list=None, processes=False, add_coverage=F This works if you installed Jenkins with your credentials. Otherwise the path to ``pandoc.exe`` needs to be changed. - And you can also read `Schedule builds with Jenkins `_. - :epkg:`node.js` might be required if a notebooks contain javascript. Parameters *add_coverage* and *report_folder* are used to compute the coverage diff --git a/src/pyquickhelper/pycode/utils_tests_helper.py b/src/pyquickhelper/pycode/utils_tests_helper.py index f657b9b7b..2c93d459d 100644 --- a/src/pyquickhelper/pycode/utils_tests_helper.py +++ b/src/pyquickhelper/pycode/utils_tests_helper.py @@ -1,9 +1,6 @@ """ @file @brief This extension contains various functionalities to help unittesting. - -.. versionadded:: 1.4 - Split from from utils_tests.py. """ from __future__ import print_function @@ -223,13 +220,12 @@ def check_pep8(folder, ignore=('E265', 'W504'), skip=None, * *W0108*: Lambda may not be necessary * *W0613*: unused argument - The full list is available at - `pylint error codes `_. + The full list is available at :epkg:`pylint error codes`. .. versionchanged:: 1.7 :epkg:`pylint` was added used to check the code. It produces the following list of errors - `pylint error codes `_. + :epkg:`pylint error codes`. .. versionchanged:: 1.8 If *neg_pattern* is empty, it populates with a default value diff --git a/src/pyquickhelper/pycode/utils_tests_private.py b/src/pyquickhelper/pycode/utils_tests_private.py index 27ea5f2cd..02941ba52 100644 --- a/src/pyquickhelper/pycode/utils_tests_private.py +++ b/src/pyquickhelper/pycode/utils_tests_private.py @@ -1,9 +1,6 @@ """ @file @brief This extension contains various functionalities to help unittesting. - -.. versionadded:: 1.4 - Split from from utils_tests.py. """ from __future__ import print_function diff --git a/src/pyquickhelper/pycode/utils_tests_stringio.py b/src/pyquickhelper/pycode/utils_tests_stringio.py index d4f0946b6..6de117091 100644 --- a/src/pyquickhelper/pycode/utils_tests_stringio.py +++ b/src/pyquickhelper/pycode/utils_tests_stringio.py @@ -1,8 +1,6 @@ """ @file -@brief A StringIO which also outputs its content for a file. - -.. versionadded:: 1.4 +@brief A :epkg:`*py:io:StringIO` which also outputs its content for a file. """ import os import sys diff --git a/src/pyquickhelper/pycode/venv_helper.py b/src/pyquickhelper/pycode/venv_helper.py index 96c8fb56a..5eeef3155 100644 --- a/src/pyquickhelper/pycode/venv_helper.py +++ b/src/pyquickhelper/pycode/venv_helper.py @@ -1,8 +1,6 @@ """ @file @brief Helpers for virtualenv - -.. versionadded:: 1.2 """ import os import sys @@ -21,8 +19,6 @@ def is_virtual_environment(): Tells if the script is run from a virtual environment. @return boolean - - .. versionadded:: 1.3 """ return (getattr(sys, "base_exec_prefix", sys.exec_prefix) != sys.exec_prefix) or hasattr(sys, 'real_prefix') @@ -31,8 +27,6 @@ class NotImplementedErrorFromVirtualEnvironment(NotImplementedError): """ Defines an exception when a function does not work in a virtual environment. - - .. versionadded:: 1.3 """ pass @@ -360,8 +354,6 @@ def check_readme_syntax(readme, folder, version="0.8", fLOG=noLOG): Unfortunately, this functionality does not work yet from a virtual environment. - - .. versionadded:: 1.3 """ if is_virtual_environment(): raise NotImplementedErrorFromVirtualEnvironment() diff --git a/src/pyquickhelper/pycode/windows_scripts.py b/src/pyquickhelper/pycode/windows_scripts.py index 5b347035f..caacf9748 100644 --- a/src/pyquickhelper/pycode/windows_scripts.py +++ b/src/pyquickhelper/pycode/windows_scripts.py @@ -1,8 +1,6 @@ """ @brief @file Batch file use to automate some of the tasks (setup, unit tests, help, pypi). - -.. versionadded:: 1.1 """ import sys diff --git a/src/pyquickhelper/serverdoc/server_helper.py b/src/pyquickhelper/serverdoc/server_helper.py index d8f968020..17b4e15ac 100644 --- a/src/pyquickhelper/serverdoc/server_helper.py +++ b/src/pyquickhelper/serverdoc/server_helper.py @@ -18,9 +18,6 @@ def get_jenkins_mappings(root, loc="dist"): @param loc *dist* by default (dist in the folder mentioned above), it could also be ``_doc/sphinxdoc/build`` @return dictionary { "name":folder } - - .. versionchanged:: 1.3 - Parameter *root* accepts a list of foldes or tuples. """ if not isinstance(root, list): roots = [root] @@ -28,15 +25,15 @@ def get_jenkins_mappings(root, loc="dist"): roots = root maps = {} - for root in roots: - if isinstance(root, tuple): - prefix, root = root + for ro in roots: + if isinstance(ro, tuple): + prefix, ro = ro else: - prefix, root = "", root - root = os.path.abspath(root) - sub = os.listdir(root) + prefix, ro = "", ro + ro = os.path.abspath(ro) + sub = os.listdir(ro) for s in sub: - fold = os.path.join(root, s) + fold = os.path.join(ro, s) if os.path.isdir(fold): dist = os.path.join(fold, loc) if os.path.exists(dist): diff --git a/src/pyquickhelper/sphinxext/__init__.py b/src/pyquickhelper/sphinxext/__init__.py index 0420d1789..7b97300c1 100644 --- a/src/pyquickhelper/sphinxext/__init__.py +++ b/src/pyquickhelper/sphinxext/__init__.py @@ -83,8 +83,6 @@ def get_default_extensions(): from pyquickhelper.sphinxext import get_default_extensions print("\\n".join(get_default_extensions())) - - .. versionadded:: 1.5 """ # We delay these imports. # They change matplotlib backend if executed. diff --git a/src/pyquickhelper/sphinxext/_private_for_unittest.py b/src/pyquickhelper/sphinxext/_private_for_unittest.py index dd0099f76..aeaa7326e 100644 --- a/src/pyquickhelper/sphinxext/_private_for_unittest.py +++ b/src/pyquickhelper/sphinxext/_private_for_unittest.py @@ -1,8 +1,6 @@ """ @file @brief Used only for unit test purpose. - -.. versionadded:: 1.5 """ diff --git a/src/pyquickhelper/sphinxext/_sphinx_common_builder.py b/src/pyquickhelper/sphinxext/_sphinx_common_builder.py index 5e72a0953..561237a60 100644 --- a/src/pyquickhelper/sphinxext/_sphinx_common_builder.py +++ b/src/pyquickhelper/sphinxext/_sphinx_common_builder.py @@ -145,7 +145,16 @@ def base_visit_image(self, node, image_dest=None): full = name dest = name else: - shutil.copy(full, dest) + if ':' in dest and len(dest) > 2: + dest = dest[:2] + dest[2:].replace(':', '_') + ext = os.path.splitext(dest)[-1] + if ext not in ('.png', '.jpg'): + dest += '.png' + try: + shutil.copy(full, dest) + except FileNotFoundError as e: + raise FileNotFoundError( + "Unable to copy from '{0}' to '{1}'.".format(full, dest)) from e full = dest else: full = dest diff --git a/src/pyquickhelper/sphinxext/blog_post_list.py b/src/pyquickhelper/sphinxext/blog_post_list.py index a9785dd53..d868e3e9b 100644 --- a/src/pyquickhelper/sphinxext/blog_post_list.py +++ b/src/pyquickhelper/sphinxext/blog_post_list.py @@ -69,8 +69,6 @@ def category2url(cat): @param cat category name @return cleaned category - - .. versionadded:: 1.2 """ return remove_diacritics(cat).replace(" ", "_") @@ -410,9 +408,6 @@ def write_aggregated_categories(self, folder, division=10, rst_links_up=None, @param rst_links_down list of rst_links to add at the bottom of a page @param only_html add item ``.. only:: html`` and indent everything @return list of produced files - - .. versionchanged:: 1.5 - Parameter *only_html* was added. """ cats = self.get_categories() res = [] @@ -540,9 +535,6 @@ def write_aggregated_post_list(folder, lp, division, prefix, encoding, @param language language @param only_html add item ``.. only:: html`` and indent everything @return list of produced files - - .. versionadded:: 1.5 - Parameter *only_html* was added """ res = [] buckets = BlogPostList.divide_list(lp, division) diff --git a/src/pyquickhelper/sphinxext/documentation_link.py b/src/pyquickhelper/sphinxext/documentation_link.py index 0c3bd75f8..983c2b079 100644 --- a/src/pyquickhelper/sphinxext/documentation_link.py +++ b/src/pyquickhelper/sphinxext/documentation_link.py @@ -1,8 +1,6 @@ """ @file @brief Automated link to documentation. - -.. versionadded:: 1.5 """ diff --git a/src/pyquickhelper/sphinxext/import_object_helper.py b/src/pyquickhelper/sphinxext/import_object_helper.py index b09d0d9f4..36460dab9 100644 --- a/src/pyquickhelper/sphinxext/import_object_helper.py +++ b/src/pyquickhelper/sphinxext/import_object_helper.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension which if all parameters are documented. - -.. versionadded:: 1.5 +@brief Defines a :epkg:`sphinx` extension which if all parameters are documented. """ import inspect from typing import Tuple @@ -17,7 +15,7 @@ def prop(self): pass @staticmethod - def stat(self): + def stat(): pass diff --git a/src/pyquickhelper/sphinxext/sphinx_autosignature.py b/src/pyquickhelper/sphinxext/sphinx_autosignature.py index b1aa9cac6..b9a6f5192 100644 --- a/src/pyquickhelper/sphinxext/sphinx_autosignature.py +++ b/src/pyquickhelper/sphinxext/sphinx_autosignature.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to describe a function, +@brief Defines a :epkg:`sphinx` extension to describe a function, inspired from `autofunction `_ and `AutoDirective `_. - -.. versionadded:: 1.5 """ import inspect import re @@ -80,13 +78,12 @@ def enumerate_cleaned_signature(doc, max_args=20): class AutoSignatureDirective(Directive): """ This directive displays a shorter signature than - `sphinx.ext.autodoc `_. - Available options: + :epkg:`sphinx.ext.autodoc`. Available options: * *nosummary*: do not display a summary (shorten) * *annotation*: shows annotation * *nolink*: add a link to a full documentation (produced by - `sphinx.ext.autodoc `_) + :epkg:`sphinx.ext.autodoc`) * *members*: shows members of a class * *path*: three options, *full* displays the full path including submodules, *name* displays the last name, diff --git a/src/pyquickhelper/sphinxext/sphinx_bigger_extension.py b/src/pyquickhelper/sphinxext/sphinx_bigger_extension.py index 71fbec690..01ce0f79b 100644 --- a/src/pyquickhelper/sphinxext/sphinx_bigger_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_bigger_extension.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to display bigger text - -.. versionadded:: 1.3 +@brief Defines a :epkg:`sphinx` extension to display bigger text """ -import cgi as cgiesc +import html as cgiesc import sphinx from docutils import nodes from sphinx.util.logging import getLogger diff --git a/src/pyquickhelper/sphinxext/sphinx_blocref_extension.py b/src/pyquickhelper/sphinxext/sphinx_blocref_extension.py index c7e976a51..6d69711a8 100644 --- a/src/pyquickhelper/sphinxext/sphinx_blocref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_blocref_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to keep track of blocs such as examples, FAQ, ... - -.. versionadded:: 1.4 +@brief Defines a :epkg:`sphinx` extension to keep track of blocs such as examples, FAQ, ... """ import sys import os @@ -194,8 +192,8 @@ def private_run(self, add_container=False): set_source_info(self, blocref) if env is not None: - targetid = 'index%s-%s%s' % (name_desc, - breftag, env.new_serialno('index%s%s' % (name_desc, breftag))) + targetid = 'index%s-%s%s' % (name_desc, breftag, + env.new_serialno('index%s%s' % (name_desc, breftag))) blocref["breftargetid"] = targetid ids = [targetid] targetnode = nodes.target(legend, '', ids=ids) @@ -441,8 +439,7 @@ def process_blocref_nodes_generic(app, doctree, fromdocname, class_name, description = ( _(brefmes) % (orig_entry, os.path.split(blocref_info['source'])[-1], - blocref_info['lineno']) - ) + blocref_info['lineno'])) desc1 = description[:description.find('<<')] desc2 = description[description.find('>>') + 2:] para += nodes.Text(desc1, desc1) @@ -464,6 +461,8 @@ def process_blocref_nodes_generic(app, doctree, fromdocname, class_name, # ignore if no URI can be determined, e.g. for LaTeX output pass + newnode.append(nodes.Text(newnode['name'])) + para += newnode para += nodes.Text(desc2, desc2) diff --git a/src/pyquickhelper/sphinxext/sphinx_cmdref_extension.py b/src/pyquickhelper/sphinxext/sphinx_cmdref_extension.py index 1381346ab..fc4196dfb 100644 --- a/src/pyquickhelper/sphinxext/sphinx_cmdref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_cmdref_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to keep track of *cmd*. - -.. versionadded:: 1.4 +@brief Defines a :epkg:`sphinx` extension to keep track of *cmd*. """ import sys from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_docassert_extension.py b/src/pyquickhelper/sphinxext/sphinx_docassert_extension.py index 02e1f7e10..8c559f7e4 100644 --- a/src/pyquickhelper/sphinxext/sphinx_docassert_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_docassert_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension which if all parameters are documented. - -.. versionadded:: 1.5 +@brief Defines a :epkg:`sphinx` extension which if all parameters are documented. """ import inspect from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_epkg_extension.py b/src/pyquickhelper/sphinxext/sphinx_epkg_extension.py index 3f796bfa0..a65edca84 100644 --- a/src/pyquickhelper/sphinxext/sphinx_epkg_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_epkg_extension.py @@ -2,8 +2,6 @@ """ @file @brief Defines a way to reference a package or a page in this package. - -.. versionadded:: 1.5 """ import sphinx diff --git a/src/pyquickhelper/sphinxext/sphinx_exref_extension.py b/src/pyquickhelper/sphinxext/sphinx_exref_extension.py index a05e2d8f4..216e4c683 100644 --- a/src/pyquickhelper/sphinxext/sphinx_exref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_exref_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to keep track of ex. - -.. versionadded:: 1.4 +@brief Defines a :epkg:`sphinx` extension to keep track of ex. """ import sys from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_ext_helper.py b/src/pyquickhelper/sphinxext/sphinx_ext_helper.py index 5016437df..2d28ab3dd 100644 --- a/src/pyquickhelper/sphinxext/sphinx_ext_helper.py +++ b/src/pyquickhelper/sphinxext/sphinx_ext_helper.py @@ -1,8 +1,6 @@ """ @file -@brief Few helpers for Sphinx - -.. versionadded:: 1.4 +@brief Few helpers for :epkg:`Sphinx`. """ diff --git a/src/pyquickhelper/sphinxext/sphinx_faqref_extension.py b/src/pyquickhelper/sphinxext/sphinx_faqref_extension.py index e4e08292c..81021ce1f 100644 --- a/src/pyquickhelper/sphinxext/sphinx_faqref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_faqref_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to keep track of FAQ. - -.. versionadded:: 1.4 +@brief Defines a :epkg:`sphinx` extension to keep track of FAQ. """ import sys from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_githublink_extension.py b/src/pyquickhelper/sphinxext/sphinx_githublink_extension.py index ea1c0159d..ae5bd2772 100644 --- a/src/pyquickhelper/sphinxext/sphinx_githublink_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_githublink_extension.py @@ -1,20 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to display a link on github. - -.. versionadded:: 1.5 - - -.. todoext:: - :title: add link to github code for each function, class... - :cost: 2 - :hidden: - :date: 2016-11-20 - :tag: done - - Add a link to the source on GitHub in the documentation for every function, - class, notebook. +@brief Defines a :epkg:`sphinx` extension to display a link on github. """ import os import sphinx diff --git a/src/pyquickhelper/sphinxext/sphinx_image_extension.py b/src/pyquickhelper/sphinxext/sphinx_image_extension.py index ff0db40ce..8e2cb5273 100644 --- a/src/pyquickhelper/sphinxext/sphinx_image_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_image_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to add button to share a page - -.. versionadded:: 1.3 +@brief Defines a :epkg:`sphinx` extension to add button to share a page """ import os import copy diff --git a/src/pyquickhelper/sphinxext/sphinx_mathdef_extension.py b/src/pyquickhelper/sphinxext/sphinx_mathdef_extension.py index 25ac1d651..3464c2f5f 100644 --- a/src/pyquickhelper/sphinxext/sphinx_mathdef_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_mathdef_extension.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to give a title to a mathematical +@brief Defines a :epkg:`sphinx` extension to give a title to a mathematical definition, theorem... Inspired from `math.py `_. - -.. versionadded:: 1.4 """ import sys import os diff --git a/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py b/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py index ce246e2ab..8fa0f15e6 100644 --- a/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_nbref_extension.py @@ -1,9 +1,7 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension to keep track of nb. - -.. versionadded:: 1.4 +@brief Defines a :epkg:`sphinx` extension to keep track of nb. """ import sys from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_postcontents_extension.py b/src/pyquickhelper/sphinxext/sphinx_postcontents_extension.py index 505f1562d..b23c01231 100644 --- a/src/pyquickhelper/sphinxext/sphinx_postcontents_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_postcontents_extension.py @@ -1,10 +1,8 @@ # -*- coding: utf-8 -*- """ @file -@brief Defines a sphinx extension which proposes a new version of ``.. contents::`` +@brief Defines a :epkg:`sphinx` extension which proposes a new version of ``.. contents::`` which takes into account titles dynamically added. - -.. versionadded:: 1.5 """ import sys from docutils import nodes @@ -156,7 +154,7 @@ def transform_postcontents(app, doctree, fromdocname): # depth = int(node["depth"]) if node["depth"] != '*' else 20 memo = {} - for depth, subnode in traverse(parent): + for _, subnode in traverse(parent): if isinstance(subnode, nodes.title): par = nodes.paragraph() ref = nodes.reference(refid=sections[-1]["ids"][0], @@ -171,7 +169,7 @@ def transform_postcontents(app, doctree, fromdocname): subnode["ids"].append("postid-{}".format(id(subnode))) nid = subnode["ids"][0] if nid in memo: - raise KeyError("node was already added '{0)'".format(nid)) + raise KeyError("node was already added '{0}'".format(nid)) else: memo[nid] = subnode bli = nodes.bullet_list() diff --git a/src/pyquickhelper/sphinxext/sphinx_rst_builder.py b/src/pyquickhelper/sphinxext/sphinx_rst_builder.py index 201c197ef..99f476541 100644 --- a/src/pyquickhelper/sphinxext/sphinx_rst_builder.py +++ b/src/pyquickhelper/sphinxext/sphinx_rst_builder.py @@ -33,8 +33,6 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -.. versionadded:: 1.5 """ import os import textwrap diff --git a/src/pyquickhelper/sphinxext/sphinx_runpython_extension.py b/src/pyquickhelper/sphinxext/sphinx_runpython_extension.py index f7ae376b7..c7f877936 100644 --- a/src/pyquickhelper/sphinxext/sphinx_runpython_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_runpython_extension.py @@ -3,8 +3,6 @@ @file @brief Defines runpython directives. See `Tutorial: Writing a simple extension `_ - -.. versionadded:: 1.2 """ import sys import os diff --git a/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py b/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py index e68ddbc21..bb72d8b10 100644 --- a/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_sharenet_extension.py @@ -2,8 +2,6 @@ """ @file @brief Defines a sphinx extension to add button to share a page - -.. versionadded:: 1.3 """ import sphinx from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_template_extension.py b/src/pyquickhelper/sphinxext/sphinx_template_extension.py index 9c7b9d82c..7045cb9bc 100644 --- a/src/pyquickhelper/sphinxext/sphinx_template_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_template_extension.py @@ -2,8 +2,6 @@ """ @file @brief Defines a sphinx extension ``tpl``, a role which use templating. - -.. versionadded:: 1.5 """ import sphinx diff --git a/src/pyquickhelper/sphinxext/sphinx_tocdelay_extension.py b/src/pyquickhelper/sphinxext/sphinx_tocdelay_extension.py index bd3812d90..11ad4666b 100644 --- a/src/pyquickhelper/sphinxext/sphinx_tocdelay_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_tocdelay_extension.py @@ -3,8 +3,6 @@ @file @brief Defines a sphinx extension which proposes a new version of ``.. toctree::`` which takes into account titles dynamically added. - -.. versionadded:: 1.5 """ import os import sys diff --git a/src/pyquickhelper/sphinxext/sphinx_toctree_extension.py b/src/pyquickhelper/sphinxext/sphinx_toctree_extension.py index 4b96a13da..5d17663dd 100644 --- a/src/pyquickhelper/sphinxext/sphinx_toctree_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_toctree_extension.py @@ -3,8 +3,6 @@ @file @brief Overwrites `toctree `_ directive to get catch exceptions when a document is processed inline. - -.. versionadded:: 1.5 """ from docutils.parsers.rst import directives from docutils import nodes diff --git a/src/pyquickhelper/sphinxext/sphinx_todoext_extension.py b/src/pyquickhelper/sphinxext/sphinx_todoext_extension.py index 1ff40545a..f8dfc797b 100644 --- a/src/pyquickhelper/sphinxext/sphinx_todoext_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_todoext_extension.py @@ -3,8 +3,6 @@ @file @brief Defines a sphinx extension to give a title to a todo, inspired from `todo.py `_. - -.. versionadded:: 1.4 """ import sys import os diff --git a/src/pyquickhelper/sphinxext/sphinx_video_extension.py b/src/pyquickhelper/sphinxext/sphinx_video_extension.py index a981f49cd..cc9ebb683 100644 --- a/src/pyquickhelper/sphinxext/sphinx_video_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_video_extension.py @@ -2,8 +2,6 @@ """ @file @brief Defines a sphinx extension to add button to share a page - -.. versionadded:: 1.3 """ import os import copy diff --git a/src/pyquickhelper/sphinxext/sphinx_youtube_extension.py b/src/pyquickhelper/sphinxext/sphinx_youtube_extension.py index 8d135cc7a..a32921da2 100644 --- a/src/pyquickhelper/sphinxext/sphinx_youtube_extension.py +++ b/src/pyquickhelper/sphinxext/sphinx_youtube_extension.py @@ -3,8 +3,6 @@ @file @brief Inspired from `sphinxcontrib.youtube `_ (not maintained anymore). - -.. versionadded:: 1.5 """ import re import sphinx diff --git a/src/pyquickhelper/sphinxext/sphinxext_helper.py b/src/pyquickhelper/sphinxext/sphinxext_helper.py index 18a9f75fa..c83754c4d 100644 --- a/src/pyquickhelper/sphinxext/sphinxext_helper.py +++ b/src/pyquickhelper/sphinxext/sphinxext_helper.py @@ -1,7 +1,6 @@ """ @file @brief Helpers for sphinx extensions. -.. versionadded:: 1.5 """ @@ -16,7 +15,8 @@ def try_add_config_value(app, name, default, rebuild, type_s=()): @param type_s expected types @return True if added, False if already present. - Rebuild can be (source: `Sphinx `_): + Rebuilds can be (source: `Sphinx.add_config_value + `_): * 'env' if a change in the setting only takes effect when a document is parsed - this means that the whole environment must be rebuilt. diff --git a/src/pyquickhelper/texthelper/diacritic_helper.py b/src/pyquickhelper/texthelper/diacritic_helper.py index a2e4013ea..2c0ff4c54 100644 --- a/src/pyquickhelper/texthelper/diacritic_helper.py +++ b/src/pyquickhelper/texthelper/diacritic_helper.py @@ -17,8 +17,6 @@ def remove_diacritics(input_str): Example:: enguérand --> enguerand - - .. versionadded:: 1.0 """ nkfd_form = unicodedata.normalize('NFKD', input_str) only_ascii = nkfd_form.encode('ASCII', 'ignore') diff --git a/src/pyquickhelper/texthelper/html_helper.py b/src/pyquickhelper/texthelper/html_helper.py index 58f0f6a2f..1b7197c6a 100644 --- a/src/pyquickhelper/texthelper/html_helper.py +++ b/src/pyquickhelper/texthelper/html_helper.py @@ -13,8 +13,6 @@ def html_in_frame(htext, style="width:100%;height:100%;"): @param htext string to clean @param style HTML style @return HTML string - - .. versionadded:: 1.3 """ html = "data:text/html;base64," + base64.b64encode(htext.encode('utf8')).decode('utf8') # noqa return ''.format(html=html, style=style) diff --git a/src/pyquickhelper/texthelper/templating.py b/src/pyquickhelper/texthelper/templating.py index 55a6bc30e..85fcc59c0 100644 --- a/src/pyquickhelper/texthelper/templating.py +++ b/src/pyquickhelper/texthelper/templating.py @@ -1,16 +1,12 @@ """ @file @brief Templating functions - -.. versionadded:: 1.4 """ class CustomTemplateException(Exception): """ - raised when a templatre could not compile - - .. versionadded:: 1.4 + Raised when a templatre could not compile. """ pass @@ -24,8 +20,6 @@ def apply_template(text, context, engine="mako"): @param context local variable to use @param engine 'mako' or 'jinja2' @return resulting text - - .. versionadded:: 1.4 """ if engine == "mako": from mako.template import Template