forked from openlp/openlp
Imported just 'which' from shutil, instead of the complete module. Also set the default song search to search as type.
This commit is contained in:
parent
402e91f688
commit
4123b9af1d
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user