Merge tweek

This commit is contained in:
Philip Ridout 2017-08-27 18:37:54 +01:00
parent 05e0f42859
commit ab2f354f11
1 changed files with 3 additions and 5 deletions

View File

@ -19,16 +19,14 @@
# with this program; if not, write to the Free Software Foundation, Inc., 59 # # with this program; if not, write to the Free Software Foundation, Inc., 59 #
# Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Temple Place, Suite 330, Boston, MA 02111-1307 USA #
############################################################################### ###############################################################################
import pathlib
from contextlib import suppress from contextlib import suppress
from openlp.core.common import is_win from openlp.core.common import is_win
if is_win(): if is_win():
path_variant = pathlib.WindowsPath from pathlib import WindowsPath as PathVariant
else: else:
path_variant = pathlib.PosixPath from pathlib import PosixPath as PathVariant
def path_to_str(path=None): def path_to_str(path=None):
@ -65,7 +63,7 @@ def str_to_path(string):
return Path(string) return Path(string)
class Path(path_variant): class Path(PathVariant):
""" """
Subclass pathlib.Path, so we can add json conversion methods Subclass pathlib.Path, so we can add json conversion methods
""" """