From 4123b9af1d7107f9d138699c2c17e701af1d5705 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Sat, 6 Dec 2014 20:08:42 +0000 Subject: [PATCH] Imported just 'which' from shutil, instead of the complete module. Also set the default song search to search as type. --- openlp/core/ui/servicemanager.py | 3 +-- openlp/plugins/presentations/lib/pdfcontroller.py | 6 +++--- openlp/plugins/songs/songsplugin.py | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/openlp/core/ui/servicemanager.py b/openlp/core/ui/servicemanager.py index e8b201cf6..3bcbaa4d4 100644 --- a/openlp/core/ui/servicemanager.py +++ b/openlp/core/ui/servicemanager.py @@ -747,8 +747,7 @@ class ServiceManager(OpenLPMixin, RegistryMixin, QtGui.QWidget, Ui_ServiceManage 'File is not a valid service.\n The content encoding is not UTF-8.')) continue os_file = ucs_file.replace('/', os.path.sep) - if not os_file.startswith('audio'): - os_file = os.path.split(os_file)[1] + os_file = os.path.basename(os_file) self.log_debug('Extract file: %s' % os_file) zip_info.filename = os_file zip_file.extract(zip_info, self.service_path) diff --git a/openlp/plugins/presentations/lib/pdfcontroller.py b/openlp/plugins/presentations/lib/pdfcontroller.py index 941be3fe1..2550ae928 100644 --- a/openlp/plugins/presentations/lib/pdfcontroller.py +++ b/openlp/plugins/presentations/lib/pdfcontroller.py @@ -31,7 +31,7 @@ import os import logging from tempfile import NamedTemporaryFile import re -import shutil +from shutil import which from subprocess import check_output, CalledProcessError, STDOUT from openlp.core.utils import AppLocation @@ -145,10 +145,10 @@ class PdfController(PresentationController): else: DEVNULL = open(os.devnull, 'wb') # First try to find mupdf - self.mudrawbin = shutil.which('mudraw') + self.mudrawbin = which('mudraw') # if mupdf isn't installed, fallback to ghostscript if not self.mudrawbin: - self.gsbin = shutil.which('gs') + self.gsbin = which('gs') # Last option: check if mudraw is placed in OpenLP base folder if not self.mudrawbin and not self.gsbin: application_path = AppLocation.get_directory(AppLocation.AppDir) diff --git a/openlp/plugins/songs/songsplugin.py b/openlp/plugins/songs/songsplugin.py index b7daebaab..be04db9cc 100644 --- a/openlp/plugins/songs/songsplugin.py +++ b/openlp/plugins/songs/songsplugin.py @@ -60,7 +60,7 @@ __default_settings__ = { 'songs/last search type': SongSearch.Entire, 'songs/last import type': SongFormat.OpenLyrics, 'songs/update service on edit': False, - 'songs/search as type': False, + 'songs/search as type': True, 'songs/add song from service': True, 'songs/display songbar': True, 'songs/display songbook': False,