forked from openlp/openlp
Merge branch 'alpha2-fixes' into 'master'
Various alpha2 fixes See merge request openlp/openlp!207
This commit is contained in:
commit
70ae1a8494
@ -68,7 +68,11 @@ class AppLocation(object):
|
|||||||
path = get_frozen_path(FROZEN_APP_PATH, _get_os_dir_path(dir_type)) / 'i18n'
|
path = get_frozen_path(FROZEN_APP_PATH, _get_os_dir_path(dir_type)) / 'i18n'
|
||||||
else:
|
else:
|
||||||
path = _get_os_dir_path(dir_type)
|
path = _get_os_dir_path(dir_type)
|
||||||
return path
|
# resolve() does not work on windows
|
||||||
|
if is_win():
|
||||||
|
return Path.cwd() / path
|
||||||
|
else:
|
||||||
|
return path.resolve()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_data_path():
|
def get_data_path():
|
||||||
|
@ -365,7 +365,7 @@ class BGExtract(RegistryProperties):
|
|||||||
for book in content:
|
for book in content:
|
||||||
td_element = book.find('td', {'class': 'book-name'})
|
td_element = book.find('td', {'class': 'book-name'})
|
||||||
strings = [text for text in td_element.stripped_strings]
|
strings = [text for text in td_element.stripped_strings]
|
||||||
book_name = strings[0]
|
book_name = strings[2].strip()
|
||||||
if book_name:
|
if book_name:
|
||||||
books.append(book_name)
|
books.append(book_name)
|
||||||
return books
|
return books
|
||||||
@ -381,7 +381,7 @@ class BGExtract(RegistryProperties):
|
|||||||
soup = get_soup_for_bible_ref(bible_url)
|
soup = get_soup_for_bible_ref(bible_url)
|
||||||
if not soup:
|
if not soup:
|
||||||
return None
|
return None
|
||||||
bible_select = soup.find('select', {'class': 'search-translation-select'})
|
bible_select = soup.find('select', {'class': 'search-dropdown'})
|
||||||
if not bible_select:
|
if not bible_select:
|
||||||
log.debug('No select tags found - did site change?')
|
log.debug('No select tags found - did site change?')
|
||||||
return None
|
return None
|
||||||
|
@ -538,6 +538,7 @@ class SongMediaItem(MediaManagerItem):
|
|||||||
new_media_file.weight = media_file.weight
|
new_media_file.weight = media_file.weight
|
||||||
new_song.media_files.append(new_media_file)
|
new_song.media_files.append(new_media_file)
|
||||||
self.plugin.manager.save_object(new_song)
|
self.plugin.manager.save_object(new_song)
|
||||||
|
new_song.init_on_load()
|
||||||
self.on_song_list_load()
|
self.on_song_list_load()
|
||||||
|
|
||||||
def generate_slide_data(self, service_item, *, item=None, context=ServiceItemContext.Service, **kwargs):
|
def generate_slide_data(self, service_item, *, item=None, context=ServiceItemContext.Service, **kwargs):
|
||||||
|
@ -138,7 +138,7 @@ def test_get_directory_for_app_dir(mocked_get_frozen_path):
|
|||||||
directory = AppLocation.get_directory(AppLocation.AppDir)
|
directory = AppLocation.get_directory(AppLocation.AppDir)
|
||||||
|
|
||||||
# THEN: check that the correct directory is returned
|
# THEN: check that the correct directory is returned
|
||||||
assert directory == Path('app', 'dir'), 'Directory should be "app/dir"'
|
assert directory == Path.cwd() / Path('app', 'dir'), 'Directory should be "app/dir"'
|
||||||
|
|
||||||
|
|
||||||
@patch('openlp.core.common.applocation.get_frozen_path')
|
@patch('openlp.core.common.applocation.get_frozen_path')
|
||||||
@ -160,7 +160,7 @@ def test_get_directory_for_plugins_dir(mocked_sys, mocked_split, mocked_abspath,
|
|||||||
directory = AppLocation.get_directory(AppLocation.PluginsDir)
|
directory = AppLocation.get_directory(AppLocation.PluginsDir)
|
||||||
|
|
||||||
# THEN: The correct directory should be returned
|
# THEN: The correct directory should be returned
|
||||||
assert directory == Path('dir', 'plugins'), 'Directory should be "dir/plugins"'
|
assert directory == Path.cwd() / Path('dir', 'plugins'), 'Directory should be "dir/plugins"'
|
||||||
|
|
||||||
|
|
||||||
@patch('openlp.core.common.sys')
|
@patch('openlp.core.common.sys')
|
||||||
|
Loading…
Reference in New Issue
Block a user