On Fri, Mar 2, 2012 at 3:47 PM, Adam Porter <a...@alphapapa.net> wrote:

> This will process a directory tree and remove the first 4 lines of
> each file.  I did a quick test on a copy of my tree, but please make
> sure to back up your data first, and if it blows up, it's your fault.
>


You might want to use the HeadersDict class from zim.config. The read()
method actually parses the lines and only strips lines that are actually
headers. Much safer, because it will not change files that did not have
headers in the first place.

I would also recommend the File object from zim.fs as it does all kind of
checking for safe reading / writing on the files. But that is for the more
paranoid ;)

-- Jaap
_______________________________________________
Mailing list: https://launchpad.net/~zim-wiki
Post to     : zim-wiki@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zim-wiki
More help   : https://help.launchpad.net/ListHelp

Reply via email to