[openlp-dev] Moving OpenLP over to pathlib
Philip Ridout
phill.ridout at gmail.com
Thu Aug 3 04:48:25 EDT 2017
OpenLP currently uses string objects to represent file and directory paths.
>From Python 3.4 pathlib, a new module introducing a Path object, was
included in the standard library.
Switching to this Path object will allow us to deal with file paths on
different platforms easier. In some cases it also reduces LOC and in my
opinion makes the code cleaner and easier to read.
As trb commented "[it's] cleaver and a different mindset."
Superfly particularly liked the proposal for storing paths in a platform
independent way.
This is going to be a big change, so will take quite a few merges.
In-between merges I will need to introduce temporary code too keep OpenLP
working until I can complete this transition.
Finally I've created a wiki page with an explanation of the pathlib, some
proposals, samples of old v new code and some differences that I have come
across. Please have a read: https://wiki.openlp.org/Scratchpad:Paths
Finally I would recommend the pathlib documentation at:
https://docs.python.org/3.4/library/pathlib.html
Phill
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openlp.io/pipermail/openlp-dev/attachments/20170803/94443fc3/attachment.html>
More information about the openlp-dev
mailing list