AppyPrinciplesGetting聽started
appy.pod Command-line programs oclean 路 Cleaning POD templates

POD misuses notes (comments) to insert Python code in it. LibreOffice allows to put formatting within these notes. Such formatting may break the code. oclean.py聽allows to remove any formatting within such notes.

oclean can be called on a single POD template, be it an ODS or an ODT template, or on a folder. In this latter case, formatting is cleaned in every note from any POD template found within this folder and, recursively, in any of its sub-folders.

Suppose you have a template called Agenda.odt, in some folder named pod. Cleaning this folder is achieved via the following command:

appy oclean pod/Agenda.odt

The output could be:

12 styled text part(s) unstyled.

Try to run it a second time:

appy oclean pod/Agenda.odt

The output will be:

No cleaning occurred.

Indeed, everything was already cleaned.

To clean a complete folder hierarchy, run a command like this one:

appy oclean.py .

The output could be::

159 styled text part(s) unstyled on 23 file(s).

The drawback is the relative violence of such cleaning. Personally, I usually format my ODF POD notes with a narrow font, like Ubuntu Narrow, in order to see more text in the reduced space offered by the note. Such global font formatting is also removed by oclean, although it does not prevent POD for workfing perfectly well.

The advantage is that oclean also fixes some illegal data structures (like bullets within notes) that may have been produced by old versions of LibreOffice or OpenOffice.

Reference

All program options are documented hereafter.

usage: oclean.py [-h] [-s] path
聽
positional arguments:
聽 path 聽 聽 聽 聽 聽is the path to a file or folder. If a file is passed, you must
聽 聽 聽 聽 聽 聽 聽 聽 pass the path to an ODF file (odt or ods): oclean will be run
聽 聽 聽 聽 聽 聽 聽 聽 on this file only, removing any formatting found within its
聽 聽 聽 聽 聽 聽 聽 聽 POD notes (comments). If a folder is passed, oclean will be
聽 聽 聽 聽 聽 聽 聽 聽 run on all ODF files found in this folder and sub-folders.
聽
optional arguments:
聽 -h, --help 聽 聽show this help message and exit
聽 -s, --silent 聽to set if you want reduced output.