.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "automation/publish_lectures.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_automation_publish_lectures.py: Publish documentation ===================== The script shows how the documentation of this module and others is published. .. GENERATED FROM PYTHON SOURCE LINES 8-14 .. code-block:: default user = "LOGIN" ftpsite = "ftp.SOMETHING" rootw = "/www/htdocs/app/%s/helpsphinx" footer = """ """ .. GENERATED FROM PYTHON SOURCE LINES 15-16 import .. GENERATED FROM PYTHON SOURCE LINES 16-23 .. code-block:: default import sys import os import random from pyquickhelper.loghelper import get_keyword .. GENERATED FROM PYTHON SOURCE LINES 24-25 logging .. GENERATED FROM PYTHON SOURCE LINES 25-29 .. code-block:: default from pyquickhelper.loghelper import fLOG # publish_lectures fLOG(OutputPrint=True) .. GENERATED FROM PYTHON SOURCE LINES 30-31 import des fonctions dont on a besoin .. GENERATED FROM PYTHON SOURCE LINES 31-115 .. code-block:: default from pyquickhelper.filehelper import TransferFTP, FileTreeNode, FolderTransferFTP from ensae_teaching_cs.automation.ftp_publish_helper import publish_teachings_to_web ################## # accès au site web # on utilise keyring pour stocker les identifiants # à commenter ou décommenter au besoin user = get_password("web", "ensae_teaching_cs,user") pwd = get_password("web", "ensae_teaching_cs,pwd") ftpsite = get_password("web", "ensae_teaching_cs,ftp") code_google = get_password("web", "ensae_teaching_cs,google") if pwd is None or user is None or ftpsite is None or code_google is None: print("ERROR: password or user or ftpsite is empty, you should execute:") print( ' set_password("web", "ensae_teaching_cs,user", "..")') print( ' set_password("web", "ensae_teaching_cs,pwd", "..")') print( ' set_password("web", "ensae_teaching_cs,ftp", "..")') print( ' set_password("web", "ensae_teaching_cs,google", "..")') print("Exit") sys.exit(0) if code_google is None: raise ValueError("code_google is empty") ################## # liste des modules à mettre à jouer # commenter ou décommenter les modules modules = [ "actuariat_python", "code_beatrix", "cpyquickhelper", "deeponnxcustom", "ensae_projects", "jupytalk", "jyquickhelper", "mloptonnx", "mlstatpy", "onnxcustom", "pyensae", "pymmails", "pymyinstall", "pyquickhelper", "tkinterquickhelper", "pyrsslocal", "pysqllike", "python3_module_template", "teachpyx", # "ensae_teaching_cs" ] random.shuffle(modules) ################## # valeurs par défaut # emplacement local de la documentation location = "d:\\jenkins\\pymy\\%s\\%s%s\\dist\\%s" rootw = "/www/htdocs/app/%s/%s" # destination sur le site FTP tracking_id = code_tracking # identifiant suffix = ("_UT_%d%d_std" % sys.version_info[:2],) modules0 = modules modules = [_ for _ in modules if os.path.exists( location % (_, _, suffix[0], "html"))] if len(modules) == 0: _ = modules0[0] one = location % (_, _, suffix[0], "html") raise ValueError(f"No module can be updated, for example '{one}'") print("List of modules to publish:") for i, mod in enumerate(sorted(modules)): print(f" {i + 1}/{len(modules)}: {mod}") ################## # La fonction :func:`publish_teachings_to_web cache` cache beaucoup de chose. publish_teachings_to_web(login=user, ftpsite=ftpsite, tracking_id=tracking_id, location=location, rootw=rootw, modules=modules, password=pwd, suffix=suffix, force_allow=["xavierdupre"]) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.000 seconds) .. _sphx_glr_download_automation_publish_lectures.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: publish_lectures.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: publish_lectures.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_