module homeblog.modifypost#

Short summary#

module ensae_teaching_cs.homeblog.modifypost

Helpers which modify a post.

source on GitHub

Functions#

function

truncated documentation

_write_data

Writes datachars to writer and deals with < >

Element_writexml

information_from_xml

load_and_modify_xml_dom

modify_all_posts

modifies, checks the syntax of every post

modify_header_attributes

the function do not modify links

Text_writexml

Documentation#

Helpers which modify a post.

source on GitHub

ensae_teaching_cs.homeblog.modifypost._write_data(writer, data, section)#

Writes datachars to writer and deals with < >

Paramètres:
  • writer – stream or file

  • data – string to write

  • section – depending of this name, some special characters are processed or not (pre or !pre)

source on GitHub

ensae_teaching_cs.homeblog.modifypost.modify_all_posts(folder='.', outfolder=None, exclude=None)#

modifies, checks the syntax of every post

Paramètres:
  • folder – folder (also process subfolders)

  • outfolder – new location (the modified post is copied somewhere else), if None, replace the file

  • exclude

    if not None, function which avoids some file the function returns a True value, example:

    lambda f : "_old" in f
    

Renvoie:

files, modified where: * files is the list of files processed * modified is the list of modified files

source on GitHub

ensae_teaching_cs.homeblog.modifypost.modify_header_attributes(dom, headerattr)#

the function do not modify links

source on GitHub