Outils pour utilisateurs

Outils du site


transparencia:groupes-locaux:bru-schaerbeek:bruschcnscmn:howto

Recettes

Notes utiles à la transposition.

La page de manuel de Dokuwiki concernant les recherches peut être trouvé à l'adresse : ici https://www.dokuwiki.org/start?id=fr:search

def txt_2_dir_and_enveloppe():
    ''' quick and dirty for pv schaerbeek '''
    global Str_path_base
 
    _b_dry_run = True
 
    for _str_entry_0 in os.listdir(Str_path_base):
        if os.path.splitext(_str_entry_0)[1] == '.txt':
            _str_path_entry_0 = os.path.join(Str_path_base, _str_entry_0)
            with open(_str_path_entry_0, 'r') as _file_in:
                _str_txt = _file_in.read()
                _str_path_dir = os.path.join(Str_path_base, os.path.splitext(_str_entry_0)[0].lower())
                os.mkdir(_str_path_dir)
                _str_path_dir_start = os.path.join(_str_path_dir, 'start.txt')
                _str_dw = ''
                _str_dw += '===== PV du %s =====\n' % os.path.splitext(_str_entry_0)[0].split('_')[0]
                _str_dw += 'Procès verbal de la séance du conseil communal de Schaerbeek du %s\n\n' % os.path.splitext(_str_entry_0)[0].split('_')[0]
                _str_dw += "<code>\n%s\n</code>\n" % _str_txt
                _str_dw += "\n\n----\n\n"
                _str_dw += "~~SHORTURL~~\n"
                _str_dw += '===== Discussion générale =====\n'
                _str_dw += '~~DISCUSSION~~\n'
                if _b_dry_run:
                    print(_str_dw)
                else:
                    with open(_str_path_dir_start, 'w') as _file:
                                    _file.write(_str_dw)
transparencia/groupes-locaux/bru-schaerbeek/bruschcnscmn/howto.txt · Dernière modification : 2017/12/07 15:45 de patrick