Minor tidyups

This commit is contained in:
Phill Ridout 2017-11-19 21:57:38 +00:00
parent 1b168dd7bf
commit a864dbbbc9
4 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ from openlp.core.common import is_win, is_macosx, add_actions
from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.common.applocation import AppLocation
from openlp.core.common.i18n import LanguageManager, UiStrings, translate
from openlp.core.common.path import Path, copyfile, create_paths, path_to_str, str_to_path
from openlp.core.common.path import Path, copyfile, create_paths
from openlp.core.common.mixins import RegistryProperties
from openlp.core.common.registry import Registry
from openlp.core.common.settings import Settings

View File

@ -37,7 +37,7 @@ from openlp.core.common.actions import ActionList, CategoryOrder
from openlp.core.common.applocation import AppLocation
from openlp.core.common.i18n import UiStrings, format_time, translate
from openlp.core.common.mixins import LogMixin, RegistryProperties
from openlp.core.common.path import Path, create_paths, path_to_str, str_to_path
from openlp.core.common.path import Path, create_paths, str_to_path
from openlp.core.common.registry import Registry, RegistryBase
from openlp.core.common.settings import Settings
from openlp.core.lib import ServiceItem, ItemCapabilities, PluginStatus, build_icon

View File

@ -78,10 +78,10 @@ class MediaPlugin(Plugin):
"""
log.debug('check_installed Mediainfo')
# Try to find mediainfo in the path
exists = process_check_binary('mediainfo')
exists = process_check_binary(Path('mediainfo'))
# If mediainfo is not in the path, try to find it in the application folder
if not exists:
exists = process_check_binary(os.path.join(str(AppLocation.get_directory(AppLocation.AppDir)), 'mediainfo'))
exists = process_check_binary(AppLocation.get_directory(AppLocation.AppDir) / 'mediainfo')
return exists
def app_startup(self):
@ -165,10 +165,11 @@ def process_check_binary(program_path):
"""
Function that checks whether a binary MediaInfo is present
:param program_path:The full path to the binary to check.
:param openlp.core.common.path.Path program_path:The full path to the binary to check.
:return: If exists or not
:rtype: bool
"""
runlog = check_binary_exists(Path(program_path))
runlog = check_binary_exists(program_path)
# Analyse the output to see it the program is mediainfo
for line in runlog.splitlines():
decoded_line = line.decode()

View File

@ -31,7 +31,6 @@ from PyQt5 import QtCore
from openlp.core.api.http import register_endpoint
from openlp.core.common import extension_loader
from openlp.core.common.i18n import translate
from openlp.core.common.path import path_to_str
from openlp.core.common.settings import Settings
from openlp.core.lib import Plugin, StringContent, build_icon
from openlp.plugins.presentations.endpoint import api_presentations_endpoint, presentations_endpoint