Phill has proposed merging lp:~phill-ridout/openlp/json_refactors into
lp:openlp.
Commit message:
rework json handling for custom objects
refactor path file
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~phill-ridout/openlp/json_refactors/+merge/367868
The standard library now has much better support for paths, so I've removed the
patches that were implemented.
Rework the custom object json handling
--
Your team OpenLP Core is requested to review the proposed merge of
lp:~phill-ridout/openlp/json_refactors into lp:openlp.
=== modified file 'openlp/core/api/deploy.py'
--- openlp/core/api/deploy.py 2019-04-13 13:00:22 +
+++ openlp/core/api/deploy.py 2019-05-23 20:08:25 +
@@ -34,7 +34,7 @@
Process the downloaded zip file and add to the correct directory
:param str zip_name: the zip file name to be processed
-:param openlp.core.common.path.Path app_root_path: The directory to expand the zip to
+:param pathlib.Path app_root_path: The directory to expand the zip to
:return: None
"""
=== modified file 'openlp/core/api/endpoint/controller.py'
--- openlp/core/api/endpoint/controller.py 2019-04-13 13:00:22 +
+++ openlp/core/api/endpoint/controller.py 2019-05-23 20:08:25 +
@@ -24,11 +24,11 @@
import os
import urllib.error
import urllib.request
+from pathlib import Path
from openlp.core.api.http import requires_auth
from openlp.core.api.http.endpoint import Endpoint
from openlp.core.common.applocation import AppLocation
-from openlp.core.common.path import Path
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
from openlp.core.lib import create_thumb
=== modified file 'openlp/core/app.py'
--- openlp/core/app.py 2019-05-04 09:13:29 +
+++ openlp/core/app.py 2019-05-23 20:08:25 +
@@ -32,6 +32,8 @@
import time
import os
from datetime import datetime
+from pathlib import Path
+from shutil import copytree
from traceback import format_exception
from PyQt5 import QtCore, QtWebEngineWidgets, QtWidgets # noqa
@@ -41,7 +43,7 @@
from openlp.core.common.applocation import AppLocation
from openlp.core.loader import loader
from openlp.core.common.i18n import LanguageManager, UiStrings, translate
-from openlp.core.common.path import copytree, create_paths, Path
+from openlp.core.common.path import create_paths
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings
from openlp.core.display.screens import ScreenList
@@ -316,7 +318,7 @@
"""
Setup our logging using log_path
-:param openlp.core.common.path.Path log_path: The file to save the log to.
+:param Path log_path: The file to save the log to.
:rtype: None
"""
create_paths(log_path, do_not_log=True)
=== modified file 'openlp/core/common/__init__.py'
--- openlp/core/common/__init__.py 2019-05-04 11:49:20 +
+++ openlp/core/common/__init__.py 2019-05-23 20:08:25 +
@@ -142,7 +142,7 @@
"""
Convert a path to a module name (i.e openlp.core.common)
-:param openlp.core.common.path.Path path: The path to convert to a module name.
+:param pathlib.Path path: The path to convert to a module name.
:return: The module name.
:rtype: str
"""
@@ -371,7 +371,7 @@
"""
Deletes a file from the system.
-:param openlp.core.common.path.Path file_path: The file, including path, to delete.
+:param pathlib.Path file_path: The file, including path, to delete.
:return: True if the deletion was successful, or the file never existed. False otherwise.
:rtype: bool
"""
@@ -407,7 +407,7 @@
"""
Validate that the file is not an image file.
-:param openlp.core.common.path.Path file_path: The file to be checked.
+:param pathlib.Path file_path: The file to be checked.
:return: If the file is not an image
:rtype: bool
"""
@@ -435,7 +435,7 @@
"""
Function that checks whether a binary exists.
-:param openlp.core.common.path.Path program_path: The full path to the binary to check.
+:param pathlib.Path program_path: The full path to the binary to check.
:return: program output to be parsed
:rtype: bytes
"""
@@ -462,7 +462,7 @@
"""
Utility function to incrementally detect the file encoding.
-:param openlp.core.common.path.Path file_path: Filename for the file to determine the encoding for.
+:param pathlib.Path file_path: Filename for the file to determine the encoding for.
:return: The name of the encoding detected
:rtype: str
"""
=== modified file 'openlp/core/common/applocation.py'
--- openlp/core/common/applocation.py 2019-04-13 13:00:22 +
+++ openlp/core/common/applocation.py 2019-05-23 20:08:25 +
@@ -25,12 +25,13 @@
import logging
import os
import sys
+from pathlib import Path
import appdirs
import openlp
from openlp.core.common import get_frozen_path,