====== Recettes ====== Notes utiles à la transposition. * Page des procès verbaux (2017-12) * http://www.schaerbeek.be/vivre-schaerbeek/organisation-politique-gestion-administrative-commune/elus/conseil-communal/proces-verbaux * Search and Replace dans la source de la page et "wget http://www.schaerbeek.be/ * Normalisation des noms YYYY-MM-DD_institution_sp-pv.pdf (N.B. script filename_src -> filename_dst) * pdftotext -layout -enc UTF-8 nomFichier.pdf * Fait une présentation sympatique mais ralenti le formatage manuel * Script "quick and dirty" pour faire des dossiers, ajouter les entêtes et les pieds de page... * Transfert ftp dans le bon dossier * **! Ouvrir chaque page pour enclencher l'indexation par Dokuwiki !** 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 += "\n%s\n\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)